Web Hosting Talk







View Full Version : Complete backup of HD - dd?


zoidberg
01-14-2002, 03:27 PM
Hi,

I have a Mandrake 7.1 server running on an internal network that I would like to backup. I have only been using Linux a short time, so please bare with me.

I have two identical IDE hard drives. I would like to make an exact copy from the first one to the second, and unplug the second drive. Then if anything happens to the machine just swap drives and be up and running immediatly. Sound good so far?

Would the command "dd if=/dev/hda1 of=/dev/hdb1 bs=1024" accomplish this? Will this copy absolutely everything including partitions, MBR? Does the second drive have to be formatted or made bootable beforehand?

Thanks

palmtree
01-14-2002, 03:52 PM
I've only done this once, so hopefully I can remember..
Yes, that sounds like it would work. I setup the exact same scenario and it worked without a problem. We also setup the dd command in a script and then called the script in cron so we didn't forget to run it.

I would double check the syntax of the command though.. And no, I don't think the drive needs to be formatted.. but I can't remember.. edit: oh yeah, and I think the 2nd drive DOES need to be bootable!

laterz,
raqworld

priyadi
01-14-2002, 05:37 PM
One problem though, you need to unmount (or mount read-only) before doing backup with dd. To mount the disk as read-only you need to disable most services, so your server will be unable to serve request at the same time you are doing backup. :(

If you want to do that on live servers, I suggest software RAID mirroring.

zoidberg
01-14-2002, 06:20 PM
Thanks for the responses guys.

Remember in the origional post when I said you would have to bare with me... :)
The server is only really used for part of the day, so it isn't really a problem shutting it down to do this. So it would be better to unmount everything before the copy? As in a umount -a? Would I then have to have the dd program on a floppy?

This is scary and confusing, maybe I should just go with PQ DriveCopy or the like. Has anyone had any experiences copying linux installations with these tools?
I'm not too proud to use a GUI!

Thanks again

priyadi
01-14-2002, 09:02 PM
Originally posted by zoidberg
Remember in the origional post when I said you would have to bare with me... :)
The server is only really used for part of the day, so it isn't really a problem shutting it down to do this. So it would be better to unmount everything before the copy? As in a umount -a? Would I then have to have the dd program on a floppy?


You won't be able to unmount everything, especially the root partition. It is a good idea (or maybe even necessary) to boot using floppy and run dd from that.

But considering the complexity, I strongly suggest that you look for another solution, like software RAID.

zoidberg
01-15-2002, 06:16 PM
Thanks priyadi,

I will definitely look into some other solutions, and do some more reading on the subject.