LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Making a backup of the entire LINUX OS (http://www.linuxquestions.org/questions/linux-general-1/making-a-backup-of-the-entire-linux-os-506044/)

cr9c1 11-29-2006 07:24 PM

Making a backup of the entire LINUX OS
 
I've looked over a few options for making a backup of the entire linux os, pretty much a duplicate image of the drive. Some people have rsync scripts that does this, others use RAID, LVM, etc.

I need a fast, easy hack to make an image of my harddrive onto another harddrive, so in the event of failure, I can plug in a kernel boot disk or install lilo on the 2nd drive and just boot to it.

Anybody have any ideas, or an rsync script that would image drive c to drive d (hda to hdb)?

Or any other solutions that are easy to install and operate? I'm running Slackware 11.0

hepburnenthorpe 11-29-2006 08:01 PM

check out man dd.

bigrigdriver 11-29-2006 08:01 PM

Suppose you have two hard drives: hda is the working drive; hdb is the backup drive. Hdb is large enough to hold the contents of hda.

Use the dd command to make a bit-for-bit mirror image of hda on hdb (including the MBR). Every time you use dd, it will overwrite the previous image.

In the event of a disaster on hda, just open the box and switch the jumpers, changing hda from master to slave, and hdb from slave to master. Then boot up.

Search these forums for discussion on the use of dd.

TigerOC 11-30-2006 05:37 AM

As bigrigdriver said use the dd command. I have just recovered a drive that was dying on my server this way.;
Ideally you need to shutdown multiuser interfaces by doing as root;

int1 to take the system into single user mode and then do;

dd if=/dev/hda of=/dev/hdb bs=4k

interpretation; DiskDump InputFile=/dev/hda to OutputFile=/dev/hdb in chunks of 4kB

Read this in-depth summary Learn dd command

msound 11-30-2006 09:37 AM

Use dd like these guys said to create the initial image, then use rsync to keep specific directories synced (ie: home dirs, documentroots, mailboxes, etc.)

dohpaz 11-30-2006 09:48 AM

You can use dd as others have suggested, and rsync is also great for incremental backups. I use a tool call G4U(Ghost for Unix) which uses dd I think. I like it because it allows me to easily make full image backups over the network to an ftp server. It also simplifies drive to drive backups as well.

http://www.feyrer.de/g4u/

theNbomr 11-30-2006 04:18 PM

For those of you who are making image backups using dd, how are you managing to get a valid image of the 'system' partition(s), while the machine is running? Doesn't a partiton have to be unmounted before copying it's image?

--- rod.

eerok 11-30-2006 05:43 PM

I've used mondo on debian, and it works very well (though it's a little fussy) ... however, I see no official slack package for it. It's nice because it gives you a thoroughly verified bootable cd/dvd with your backup data and the restore tools on it.

I've also used tarballs for backups. I don't like dd because who knows what hardware or fs I'll end up restoring to? The more flexible a backup is, the more useful it is to me.

phil.d.g 11-30-2006 06:45 PM

Quote:

Originally Posted by theNbomr
For those of you who are making image backups using dd, how are you managing to get a valid image of the 'system' partition(s), while the machine is running? Doesn't a partiton have to be unmounted before copying it's image?

--- rod.

No, you can copy it whilst it is mounted; in my experiance the only problems are stray pid files.

You could also pipe the output of dd through gzip and into a file for a compressed backup. You'll then need a live cd to restore the backup.

As said you can use tar to backup the system, when you untar to your new filesystem on your new drive you'll need to install a mbr.

Sören Schneider 11-30-2006 06:45 PM

dd
like befor said.
http://www.linuxquestions.org/questi...d.php?t=362506


All times are GMT -5. The time now is 06:19 PM.