Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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
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.
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
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.)
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.
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?
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.