[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[debian-user] How to copy a laptop HD?



Hi,

I have an old laptop with a 10G HD.  I have it partitioned into a swap
partition hda5, an ext3 boot partition hda6, and an ext3 root
partition hda7 (all logical).  I acquired an 80G HD, and through an
USB interface I have it partitioned the same way, only with bigger
root partition, :).

I did a copy of the contents of each partitions, except by /proc under
root, into the new created ones, but I used "cp -a" instead of "dd".
This might have prevented copying the boot sector, necessary for the
boot sector probably...

Do you suggest using "dd" instead?  Would it work even if the destine
partition is bigger (I read somewhere it works perfectly when source
and destine are the same size, but I never read it works perfectly
when destine is bigger)...

What about the HD MBR?  I've tried already using "dd if=/dev/hda
of=~/full_mbr.bin bs=512 count=1 && dd if=~/full_mbr.bin of=/dev/sda
bs=446 count=1", but it didn't seem to work...  I wouldn't know if
using count=2 to include the boot sector would work since the boot
partition is the 2nd one (the swap is the 1st one)...

Any ways, I'm still on trials, but I haven't gotten grub to work yet.
I tried also "grub-install" on sda, but that doesn't seem to work, it
only does with chroot to the mounted root of sda and with a bind to
the mounted boot of sda, however partially since it doesn't get to
read stage2.  Running manually grub over the chroot seems to overcome
the stage2 thing, but I still don't get grub to work after booting.

The thing is that as this is a laptop, and changing the HD on the only
IDE slot is getting less fun each time, I was thinking what would be a
good recipy to follow.  Maybe using dd for each partition, or for the
whole HD would work, although I find it hard to believe it would (the
partition tables at least should be different, since the difference in
sizes), but I just might be too skeptical, and using dd for the whole
HD is what works out of the box after partitioning the HD, :).

Please suggest, recommend, etc, :).

Thanks,

-- 
Javier


Reply to: