Link to home
Start Free TrialLog in
Avatar of prof666
prof666

asked on

Replace Linux boot disk

My current system has a RAID0 stripe in software (sda and sdb) as md0 (two SATA 250GB disks), the MBR and /boot partition are on standard IDE disk (as the md0 will not boot...software raid). This setup works very well. The boot disk (hda) is 160GB and has another partition on it that is now full. As a consiquence the disk is now 99% full. I want to replace it with a IDE 400GB unit.

My question is if I connect this 400GB IDE disk up via an external USB caddy, can I then use dd to copy the entire 160GB structure over to the 400GB disk, then do a direct swapout and it will still boot and load the md0? I will backup and restore the larger partition on hda (so i can erase and create a larger partition).

If this is not a good method...can someone suggest a better one?

BTW: the /boot partition is ext3...all others are reiser3
ASKER CERTIFIED SOLUTION
Avatar of cjl7
cjl7
Flag of Sweden image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I agree that tar or cpio is the better method here!

This will work, provided that the partitions for the boot drive remain the same. i.e, the old hda1 is copied to the new hda1. Swap partitions on the boot drive will need to be the same as the original.

If you can't manage that, then you will need to edit the /etc/grub.conf , and the /etc/fstab files or the equivalent for your distro. Best try and keep the partitions labelled examctly the same.

Good luck! - Even if it doesn't quite work, you can always put the original drive back in whilst you work out what went wrong (if this is a production system). However, the process isn't that complicated, and you should eb able to manage it reasonably easily.

HTH:)

Avatar of Duncan Roe
tar / cpio is much better. If you use dd, the 400GB disk will look like a 160G disk to the system (been there, done that ;)
...but have you got the T-Shirt duncan? ;)........and how many days did it waste redoing it once the mistake was realised? I had a 60GB drive that took 4 hours just to copy from an IDE to a SATA.....I rebooted and then the penny dropped! - ooops - we all make mistakes....but hopefully we learn from them:)