[Techtalk] Gentoo Kernel Upgrade - unable to mount root partition

Conor Daly conor.daly-linuxchix at cod.homelinux.org
Thu Nov 1 19:01:01 UTC 2007

On Wed, Oct 31, 2007 at 04:03:28PM -0700 or so it is rumoured hereabouts, 
Maria McKinley thought:
> Conor Daly wrote:
> > 
> > One of the suggestions I've heard on this subject is that you reserve a
> > partition on your disk to be a backup install of your working system.
> > When you do the upgrade on the main partition, the backup install is still
> > working fine so you can try stuff on the main install without fear of
> > losing the machine entirely.  It does mean sacrificing a certain amount of
> > disk space but, 3 Gb should suffice and is a pretty small part of modern
> > drives...
> > 
> > One of the suggestions I've heard on this subject is that you reserve a
> > Conor
> This sounds like a great idea, but I'm trying to imagine how this would 
> work. It can't be enough just to copy the root partition over to another 
> partition, you also need to make adjustments to the boot loader, and you 
> need to differentiate between the cases where you are actually upgrading 
> the kernel and when you are upgrading other packages. I tried to find a 
> tutorial that might explain how to do this using grub, but didn't 
> couldn't find one. Does anyone know of instructions about this?
> ~maria

It's basically a matter of copying / partition and adding a stanza to the
/boot/grub/menu.lst to point to the new /.  You need to edit that
/etc/fstab also for the correct / partition.  That's pretty much it.
Assuming, of course, that you don't have separate /usr or /var or similar

For example:

# New kernel installed.
title Fedora Core (
        root (hd0,0)
        kernel /boot/vmlinuz- ro root=/dev/hda1
        initrd /boot/initrd-
# existing kernel
title Fedora Core (2.6.18-1.2798.fc6)
        root (hd0,0)
        kernel /boot/vmlinuz-2.6.18-1.2798.fc6 ro root=/dev/hda1
        initrd /boot/initrd-2.6.18-1.2798.fc6.img
# backup copy of existing kernel
title Fedora Core Backup (2.6.18-1.2798.fc6)
        root (hd0,3)
        kernel /boot/vmlinuz-2.6.18-1.2798.fc6 ro root=/dev/hda4
        initrd /boot/initrd-2.6.18-1.2798.fc6.img

and in /dev/hda4/etc/fstab you have 

/dev/hda4      /       ext3    defaults 1 1

instead of: 

/dev/hda1      /       ext3    defaults 1 1

in /dev/hda1/etc/fstab .

When your new system is happily working, sync it to the backup partition
and edit the grub.conf and backup fstab.  Something like:

mount /dev/hda4 /mnt/tmp
rsync -x -a --delete / /mnt/tmp
vi /mnt/tmp/etc/fstab
vi /boot/grub/menu.lst

should do the whole thing...

Conor Daly <conor.daly at cod.homelinux.org>
Version: 3.1
GCS/G/S/O d+(-) s:+ a+ C++(+) UL++++ US++ P>++ L+++>++++ E--- W++ !N
PS+ PE Y+ PGP? tv(-) b+++(+) G e+++(*) h-- r+++ z++++ 
http://www.geekcode.com/ http://www.ebb.org/ungeek/

More information about the Techtalk mailing list