Moving /root partition

Richard A Downing richard at
Tue Oct 18 02:09:12 PDT 2005

Tom wrote:
> How do I correctly move the root partition to another partition? Im also
> want to move /usr /var as well and probably /home

I've not tried this, but I think it should work.

Boot using something like this grub line:

kernel (hd0,5)/boot/lfskernel-1.2.3 root=/dev/hda4 init=/bin/bash

This will stop ANY bootscripts from running and leave you with / mounted
readonly and bash running as root.

Mount your previously prepared target root partition at, say, /mnt/temp,
read/write.  And for each directory EXCEPT /mnt in /: cp -a /dir
/mnt/temp to copy the files (it'll take a while).

Edit /mnt/temp/etc/fstab to reflect the new situation.

You'll then need to reboot by hand ('cos /boot/grub/menu.lst is wrong)
and give grub a line like:

kernel (hd0,7)/boot/lfskernel-1.2.3 root=/dev/hda6

to point it at your new setup. Once it's up: edit /boot/grub/menu.lst to
reflect the new situation and re-setup grub according to the book.

As I say, I 'ain't tried it.  Make sure you have a GRUB floppy or LiveCD
handy.  (and wait to see if some clever person replies to this to point
out why I'm wrong)


More information about the lfs-support mailing list