root partition move

Rajinder Yadav at
Mon Jul 27 02:11:00 UTC 2009

On Sun, Jul 26, 2009 at 9:09 PM, Tyler Aviss<tjaviss-Re5JQEeQqe8AvxtiuMwx3w at> wrote:
> On Sun, Jul 26, 2009 at 5:52 PM, James Knott<james.knott-bJEeYj9oJeDQT0dZR+AlfA at> wrote:
>> Rajinder Yadav wrote:
>>> A while back I saved my linux partition using a rescue disk along with
>>> partimage.
>>> I recently did a restore of the system without any issues just to
>>> verify the process, because I like to tinker with stuff =)
>>> I am wondering though, would it be possible to move the root partition
>>> to another partition during the restore? What would be required to
>>> tell the kernel to use say /dev/sdb2 instead of /dev/sdb8 to mount
>>> root? a simple change to /etc/fstab?
>>> Would the partition move break any other programs from running, or
>>> linkage i.e. /etc/ or is stuff in here pretty self
>>> contained to the file structure layout irrelevant to what partition
>>> it's mounted on?  I would think is the case.
>> That should be OK, but you'll have to edit /etc/fstab, to reflect the
>> changes.
> Be sure to update /boot/grub/menu.lst (or /etc/grub.conf) if you're
> using GRUB, and /etc/lilo.conf if you're using LILO.
> For GRUB you'll need to update the sections like
> root (hd0,0)
> and kernel /vmlinuz root=/dev/sda1
> and if you have it the line for the menu background (splashimage?)
> For the "root" part in grub, drives in GRUB start at 0, so if your
> root was on the first partition of the first disk it would be (hd0,0),
> and sda2 would be (hd0,1) etc. If you're using a separate boot
> partition, notably for XFS users etc, then the "root (hd0,0)" would
> actually be whatever /boot is mounted as.

Tyler thanks for the information, I was going to follow up on asking
about the boot loader stuff, but you read my mind and caught that.
Right now I have my kernel on a separate /boot partition. So I can
move root around without worrying about the bootloader stuff.

> If you get stuck, post know what your actual before/after partition
> layout is and I can probably sort it out.GRUB's not that difficult
> once you figure out the whole numbered partition thing,but it can be
> annoying.

I find GRUB quite annoying myself, I currently have WinXP, Kubuntu and
Kubuntu64 installed on separate partition. What I hate about GRUB is
that it's stupid and finds WinXP but not another Linux. So when I
installed a 2nd Linux, it would not update /root/grub/menu.lst as I
expected ... I pretty much hacked my way to adding the missing Linux.

> Anothe note: Sometimes, especially with Ubuntu, you may have UUID's in
> the grub.conf or menu.lst and /etc/fstab. While the idea is nice, I
> prefer to replace these with physical mappings as somebody they get
> messed up with kernel updates or drive changes.

In GRUB, I recall seeing all this UUID stuff and it threw me off, I
still have no idea where it's defined.

> And lastly, a useful trick is to label partitions when you're
> assigning a filesystem (or after with tune2fs, xfs_admin, etc) then
> you can have fstab entries like
> LABEL:root    /  ext3        relatime   00
> etc

I didn't know how to label a drive till now. I saw it used in fstab
but was not sure where the label was getting defined. It never
occurred to me it was a volume label =)

> The only thing to watch out for with that is that you don't have
> duplicate labels or for example a USB drive with the same label as a
> physical disk, etc.
> --

I will keep the labels unique, thanks again!

Kind Regards,
Rajinder Yadav
The Toronto Linux Users Group.      Meetings:
TLUG requests: Linux topics, No HTML, wrap text below 80 columns

More information about the Legacy mailing list