[H-GEN] Coping one h/d to another

dash dash at redhat.com
Wed Apr 5 23:09:36 EDT 2006


On Wed, 2006-04-05 at 18:17 +1000, David wrote:
> [ Humbug *General* list - semi-serious discussions about Humbug and     ]
> [ Unix-related topics. Posts from non-subscribed addresses will vanish. ]
> 
> Hi All....ive seen the answer to this one before but cant seem to find 
> the answer......i have hda drive set up with a Win XP primary partition 
> which has gone belly up.....the Extended partition has Mandriva Linux 
> 2006 in 3 partitions hda5 /boot hda6 Swap and hda7 /.......it is these 3 
> partitions that i want to copy to hdb which has hdb1 /boot hdb2 Swap and 
> hdb3 / setup on it.....have looked at the Upgrade H/D Mini HOW TO but am 
> a little confused.....
> have tried to recover the primary partition but would have to writ a new 
> partition table on the disk an that would loose all data..
> Any help appreciated
> David Munn

I've done this before by using dd.  This works when the partition sizes
are the same.  Not sure what to do if partition tables are different
accept copying files.  I did something like:
#dd if=/dev/hda1 of=/dev/hdb1
#dd if=/dev/hda2 of=/dev/hdb2
#dd if=/dev/hda3 of=/dev/hdb3
However my parition tables were exactly the same and yours aren't.  I
also had to run e2label to match the labels in /etc/fstab
#e2label /dev/hdb1 /
#e2label /dev/hdb2 /boot
and then i removed hda and put hdb as the master and reinstalled grub
Regards
Dave





More information about the General mailing list