[sclug] Moving root filesystem from one drive to another

Tom Dawes-Gamble tmdg at weardale.cl
Wed Aug 2 20:54:12 UTC 2006


Hi,


On Wed, 2006-08-02 at 13:41 +0100, James Wyper wrote:
> Hello everyone,

> Here's what I plan to do - could you let me know if I've missed
> anything or if you can suggest shortcuts:
> 
> 1.  Backup /home and /usr, just in case.
> 
> 2.  Swap IDE cables so the old hda becomes hdb (and vice versa)
> 
> 3.  Boot Knoppix.  Use parted and/or fdisk to create a new 4GB primary
> partition on (the new) hda - let's call this hda4.
> 

I would just make this change.  Create the fourth partition on the
current hdb drive. Copy the contents of / to the  new hdb4. Then change
lilo to boot using the new partition.

Sorry I'm rusty on lilo so cant give a real example.  But these steps
should work if you know how to do them.

booted normally.

# fdisk /dev/hdb
	create your new partition.  type 83  Make it bootable (active).

# mkfs -t ext2 /dev/hdb4
# mkdir /mnt/nroot
# mount /dev/hdb4 /mnt/nroot
# (cd /;tar cf - /etc /boot /var and so on exclude /home /mnt
and /usr /proc )|(cd /mnt/nroot; tar xvf - )

Edit the /mnt/nroot/etc/fstab to mount /dev/hdb4 on /

Now edit your lilo.conf to add a new boot option that boots from /hdb4
and has '/' on /dev/hda4

Write the new lilo and test that it can boot the new option that is
still booting from drive /dev/hda but with root and boot on hdb.
Verify you can still boot the old way i.e. root and boot on hda.

Now write the lilo to /dev/hdb and test that you can boot from hdb.

Assuming that works swap your 3 gig drive for the new drive.
Make sure you can still boot hdb.

If it fails put the old drive back and suss out the problem.

Install Kubuntu to the new disk.  You should be able to configure it to
boot hdb too. 

If your feeling really brave you could just skip the testing of lilo
configs and  swap the 3.2 G drive for the new drive and install kubuntu
on the new drive and set that up to boot the hdb stuff.

If the worst comes to the worst you can always revert to your old disk
and it should work since you don't need to change it.

regards,
tom.
-- 
There are 10 types of people in the world.
Those that understand Binary and those that don't.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.tmdg.co.uk/pipermail/sclug/attachments/20060802/15d3c89e/attachment.bin


More information about the Sclug mailing list