[Gllug] moving system from one disc to another

John Edwards john at cornerstonelinux.co.uk
Tue Aug 31 14:22:35 UTC 2010


On Tue, Aug 31, 2010 at 03:06:34PM +0100, t.clarke wrote:
> Unfortunately the system in question uses fixed partitioning and filesystem
> sizes.  So I don't think resize2fs will work - as the manual page says the
> underlying partition has to be big enough.  Or am I missing something ??

gparted (GUI for parted and other tools) is easier to use than fdisk
and resize2fs. I don't think they can resize the root filesystem if
you are using it, so you may need to boot from a live CD with these
tools (Knoppix and Ubuntu 10.04 should have them).


An alternative method is to plug in both drives and create the
partitions you want. Then use 'rsync -Hav' to copy from one filesystem
to the other (-H to preserve hard links) and run 'grub-install' on the
new drive. Doing this while booting from a live CD will be cleaner as
you will not copy across the transient files in /dev and /var/run.

The new filesystems will have a different UUID, which is a problem is
GRUB, LILO or /etc/fstab addresses drives by UUID instead of device
names such as /dev/sda1.

Two options to fix this:

1) Change /etc/fstab and your boot loader to use the new UUIDs.
Safer but more work.

2) Use tune2fs to change the UUID of the new drive to be the same as
the old. You can then change the old drive to have a different UUID,
but that means the old drive will be be bootable. If you don't change
the UUID then you will meet problems when two filesystems have the
same UUID.


-- 
#---------------------------------------------------------#
|    John Edwards   Email: john at cornerstonelinux.co.uk    |
#---------------------------------------------------------#
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: Digital signature
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20100831/dde804c4/attachment.pgp>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list