LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-27-2009, 12:32 PM   #1
Ducttapemasterj
LQ Newbie
 
Registered: Nov 2008
Posts: 9

Rep: Reputation: 0
dd question


I am relatively new to Linux backup strategies, and I have a couple quick questions.
I have BackupPC running a backup pool for all the computers in my network. I'd like to be able to take a backup of the whole thing offsite as sort of disaster insurance of sorts. Anyway it seems to me that the easiest way to do that would be to clone the entire hard drive with "dd" to my USB hard drive.
The questions I have about that are:
1. Is it true that if a disaster were to occur and the old computer was lost, I could just take the USB harddrive, clone it back to a harddrive on a new computer, boot up, and have everything back - then be able to restore the various BackupPC clients from there?
2. Can I run the "dd" with the source harddrive booted, or should I boot the computer from a live cd, mount the source harddrive and "dd" from there?
3. Will the restored clone be bootable from the get-go, or do I need to do anything special with the MBR or boot partition?
Any insight would be greatly appreciated! Thanks!
 
Old 01-27-2009, 12:54 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,336

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Quote:
Originally Posted by Ducttapemasterj View Post

it seems to me that the easiest way to do that would be to clone the entire hard drive with "dd" to my USB hard drive.
At first look most people think that cloning with dd is the easiest backup method. If you look into the backup problem further then you will find that there are better ways to do backups than dd. I recommend that you set up a backup system based on using the cp, rsynch, or tar commands.

There are the following problems with dd:

dd copies the entire partition including free space. This takes up a lot more backup space than necessary and takes longer to run backups.

dd faithfully copies any errors you have in your file system. If you have to restore a corrupt file system you will find that the errors are also restored from the backup.

If you have any hard links then the hard links will not be correct if you restore to any place other than the exact location where the backup originated. In other words if you backed up hda1 and later restored it to hdb2 then none of your hard links would work.

dd is a pain when trying to restore to a partition which is a different size than the original partition.


-------------------------
Steve Stites
 
Old 01-27-2009, 07:07 PM   #3
Ducttapemasterj
LQ Newbie
 
Registered: Nov 2008
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks for the pointers!
OK, so that in mind I immediately went and got up to speed on Rsync, which looks like a really handy tool. But there's a couple things I'm still a little vague on. It seems as though there is a lot of info on backing up a system, but not as much on restoring it when something does actually go wrong. O
Let's say I go with rsync. My output from "mount -l" is as follows:

/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw) []
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/sda1 on /boot type ext3 (rw) [/boot]
none on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
/dev/sdb1 on /media/VERBATIM type ntfs (rw) [/boot]

Ideally I'd like to preserve just about everything, devices, filesystems, everything (I think). I want to be able to use the backup to just restore the whole thing onto a new server and be up and running in the minimum possible time. Storage space isn't really an issue, time is the single most important thing.
After reading the MAN pages, would something like this do the trick:

Rsync -lHDp / /media/VERBATIM/rootbackup/

Any input or critiques again are welcome as I'm still pretty new to this particular area.
Thanks!
 
Old 01-27-2009, 07:35 PM   #4
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,336

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Quote:
Originally Posted by Ducttapemasterj View Post

But there's a couple things I'm still a little vague on. It seems as though there is a lot of info on backing up a system, but not as much on restoring it when something does actually go wrong. O
Restoring with rsynch is just the reverse of backing up. Restoring can be as simple as reversing the src and dest fields in the rsynch command but is usually more complicated. In any case there is no one size fits all method of restoring. It depends on the type of problem that you are trying to fix.

If you have a working system then you can boot into that system and selectively copy as much of the backup tree as necessary to replace the file(s) that you have lost. Most restores are of this nature, you replace a few files that you have accidentally lost without having to restore everything.

If you have lost the entire system then you will have to boot a liveCD, probably format the / partition, and then use rsynch to copy the entire / system to the proper partition.

You could practice restoring a few files. For example if you are backing up Trash you could empty the Trash and then use rsynch to restore the Trash backup to the Trash.

Then empty the Trash again. Boot a liveCD and try restoring the Trash working from the liveCD.

Once you master those two problems you should be able to handle any restore problem you encounter.

----------------------------
Steve Stites
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SPAM question - General Internet Security question LuggerHouse Linux - Security 1 09-07-2007 08:30 AM
Two things: (Probably Simple) Grub question, and a gDesklets question Wilffo Linux - Software 3 05-20-2006 01:33 PM
Question, Apples Contribution to Open Source + MacOs file structure question Higgy3k Other *NIX 5 07-25-2005 04:23 AM
Not your regular GRUB question - just a short question for a fried MBR!! ziphem Linux - General 3 01-31-2005 01:51 PM
login prompt question & kde scheme question JustinCoyan Slackware 2 06-09-2004 02:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration