[KLUG Members] Duplicating a HD
Bruce Smith
bruce at armintl.com
Fri Apr 22 11:14:08 EDT 2005
> I have an older system with a HD that is getting flakey (HD not recognized
> at bootup). I want to put a second HD in the system and duplicate the flakey
> one to the newer one.
>
> I plan to boot Knoppix, then from the KDE desktop uncheck the ro property of
> the newer HD.
> I will then open a root shell and do something like a dd if=/dev/hda1
> of=/dev/hdc1.
"dd" will only work correctly if the two hard drives are _exactly_ the
same size (in sectors).
Otherwise, partition the new hard drive (fdisk), create a file system on
the new partition (mkfs<tab><tab>), mount both new & old filesystems,
and use "cp -a" or tar to copy the files from one filesystem to another.
I usually use tar:
(tar cplf - /oldfs) | (cd /newfs; tar xpvf -)
> Since this is the first time I have tried something like this I am not
> confident about the syntax to duplicate a whole drive. I don't know if there
> are any dd options I need to include.
If this is a bootable system, you need to boot the system another way
the first time (grub boot floppy) and run grub-install (or lilo,
depending on your boot manager) once the new HDD is up and running.
> Is it better to wipe the newer HD to get rid of existing data before I do
> the dd?
Doesn't matter, except don't use "dd"! :-)
- BS
More information about the Members
mailing list