Copy entire disk in FC3

I'm running FC3 and I'd like to copy the entire /dev/hda to /dev/hdc, including all the boot info, so that I can boot off of it in case of failure. This will be a one time thing. I'm doing an app upgrade and I'm very afraid the install will go wrong, so I want to be able to quickly be back up in case of failure.
Any ideas?

Both are 10GB drives, but from different manufacturers. I doubt that makes a difference, but I wanted to include that info.

Hi !
I don't think is necesarely to copy the entire disk/partition... a backup will be enough, but if you insist try to do it with dd (man dd). In Linux it should be something like this:

dd if=/dev/hda of=/dev/hdc

I've never done this before, but it should work.

I agree with Sergiu-IT, you don't have to clone the entire disk. You can just copy important system files in / /usr or /home by using the tar command. I think you can use "tar cvzf /dev/hdc /usr /boot / /home"; and if your original system fails after an application update, you can just restore these directories back to your /dev/hda.

dd if=/dev/hda of=/dev/hdc should work, but you will have to edit the fstab file in /etc/fstab in order to boot from /dev/hdc properly, Since dd will "clone" the disk content in /dev/hda with fstab using /dev/hda's configuration. Unless of course, you physically reconfigure the drives by changing the cables to make "/dev/hdc" become "/dev/hda". I had this similar problem once with my Red Hat Linux 9.

Important: Make sure your target disk (/dev/hdc) is at least with capacity equal or greater than your /dev/hda, or it'll generate an error on /dev/hdc.

If you really want to clone a disk, you may as well consider third party tools, such as http://www.partimage.org

Thanks everyone for your input. This is for my personal linux box (actually Mythtv is the app that sits there).

I think I'm going to go with the dd solution.

tar cvpjf backup.tar.bz2 / --exclude /proc /dev /mnt /sys /media

Whats FC3? Is it a back-up utility?

No, it is Fedora Core 3 :wink:

thanks, Im new to linux/unix systems so i may ask stupid questions :slight_smile:

You should keep in mind that using dd with the default block size will result in a VERY slow copy. You might want to try something like this:

dd if=/dev/hda of=/dev/hdc bs=$((1024**2*2))

which will give you a 2MB block instead of a 1k block. *Much* faster.

The command did not work.

# dd if=/dev/rdsk/c1t1d0s2 of=/dev/rdsk/c1t2d0s2 bs=$((1024**2*2))
syntax error: `(' unexpected

What should be done?

Regards,
Savitha

Which shell are you using?

Use bash

Cheers
ZB