PDA

View Full Version : [ubuntu] 8.04 ->10.04 Grub, Grub2 and LVM



rsteinmetz70112
June 29th, 2010, 07:24 PM
I upgraded 8.04 LTS to 10.4 LTS and have since been unable to boot the system. I can start it using a Desktop CD and all of the files are still there.

The root partition is installed on a RAID array with LVM

GRUB is the boot manager, it was not automatically upgraded to GRUB2 during the upgrade. I'm not sure if it should have been.

It appears that although lvm2 is installed GRUB is not loading the kernel module and therefore the root device cannot be found.

How can I force GRUB to load lvm2?

Can I upgrade GRUB to GRUB2 in this condition?

moonport
June 29th, 2010, 08:03 PM
Try this: http://www.ibm.com/developerworks/linux/library/l-grub2/index.html

May be help.

stlsaint
June 29th, 2010, 08:17 PM
I upgraded 8.04 LTS to 10.4 LTS and have since been unable to boot the system

I think this is your first area of error. Maybe im reading wrong but you did a upgrade instead of a fresh install. If you attempted to go straight to 10.04 from 8.04 than this is where your error has come from. I dont think grub is your issue, if would suggest a re-install of 10.04. Also what errors are you getting with not being able to boot. I run lvm and i simply install grub as usual and it works.

rsteinmetz70112
June 29th, 2010, 11:24 PM
The upgrade from 8.04 LTS to 10.04 LTS iis supposed to be supported.

Using a Live CD I can access everything after a little additional work, which I'm geting pretty good at.

Somehow the RAID and/or LVM is not being recognized as the kernel loads. This is perhaps not a GRUB problem but it should be fixable.

Is there a step by step boot option to allow me to see each message as it flies by?

darkod
June 29th, 2010, 11:38 PM
I might be wrong, but can grub1 boot lvm2?

You do have the primary /boot partition outside of the lvm needed for lvm to function right?

You also say, you can boot the system with manual commands. Not sure how much the raid complicates things, but after you manage to boot your system, shouldn't you be able to simply remove grub1 with all settings and install grub2?

sudo mv /boot/grub /boot/grub_old
sudo apt-get purge grub grub-common
sudo apt-get install grub-pc grub-common

Don't forget you need to use Space bar to select on which device to install grub2 when it asks, not Enter. Otherwise it would leave nothing selected.

The operation might be little risky because if grub2 doesn't install fine, and you have removed grub1, there is nothing to boot. But it doesn't boot anyway. :)

rsteinmetz70112
June 30th, 2010, 07:48 PM
I've made a little progress since my last post. I've discovered that Grub seems to be working but that the init script process is causing the problem.

Working around in initramfs I have discovered that both mdadm and lvm are loaded in initramfs.

If I run the init script I get a group of error messages indicating that a number of devices already exist including /sys /proc /dev/pts /dev/.initramfs

I get the error messages listed below.


ln: /tmp/mountroot-fail-hooks.d/20-lvm2: File Exists
ln: /tmp/mountroot-fail-hooks.d/10-mdadm: File exists

Finally a message that /dev/mapper/remus-root does not exist and get dumped back into the shell..

Upon checking I find that neither of the array device exist
/dev/md0
/dev/md1
Nor is there anything in /dev/mapper

Taking it a step farther I found that if I run


./mdadm -A /dev/md0
./mdadm -A /dev/md1

The arrays are available.

If I run


./mdadm -A --scan

I get an error about /dev/urandom - not sure what that means.

After activating the arrays I can run lvm


lvm> lvmscan
lvm> vgcfgrestore remus
lvm> vgcfgrestore data
lvm> quit

All of the volume groups are available and created in /dev/mapper

Then <cntrl D> boots the hard drive. I get an nvidia driver error but It still boots and I'm sure I can deal with that later.

So the question is why aren't the arrays and volume groups being initialized properly? The commands are there and the devices exist on the drives.

I tried reinstalling lvm2 and that recreates initramfs, but stil no luck.