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

dash dash at redhat.com
Thu Apr 6 01:01:19 EDT 2006


On Thu, 2006-04-06 at 13:09 +1000, dash wrote:
> [ Humbug *General* list - semi-serious discussions about Humbug and     ]
> [ Unix-related topics. Posts from non-subscribed addresses will vanish. ]
> 
> 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

I meant to say "partition tables are different sizes"

> 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

note that if 2 hd's have partitions with the same labels it probably
won't boot properly.  you can fix this by setting the label on the first
hd to "somethingelse".  that is if you wanted to keep the old hd in as a
2ndary hd.





More information about the General mailing list