Intro

 

Try to replace outdated broken kernel with LTS one from HWE pack.

apt-get install linux-generic-lts-trusty linux-image-generic-lts-trusty

 

 

Goes boom, here are the errors broken out to their own command

root@zz:~# update-grub
error: physical volume pv0 not found.
error: physical volume pv0 not found.
Generating grub.cfg ...
error: physical volume pv0 not found.
error: physical volume pv0 not found.
error: physical volume pv0 not found
error: physical volume pv0 not found.
error: physical volume pv0 not found.
error: physical volume pv0 not found.
error: physical volume pv0 not found.
error: physical volume pv0 not found.
error: physical volume pv0 not found.
error: physical volume pv0 not found
error: physical volume pv0 not found.
Found linux image: /boot/vmlinuz-3.13.0-85-generic
Found initrd image: /boot/initrd.img-3.13.0-85-generic
error: physical volume pv0 not found.
error: physical volume pv0 not found.
error: physical volume pv0 not found.
error: physical volume pv0 not found.
Found linux image: /boot/vmlinuz-3.11.0-26-generic
Found initrd image: /boot/initrd.img-3.11.0-26-generic
Found linux image: /boot/vmlinuz-3.11.0-15-generic
Found initrd image: /boot/initrd.img-3.11.0-15-generic
error: physical volume pv0 not found.
error: physical volume pv0 not found.
error: physical volume pv0 not found.
error: physical volume pv0 not found.
error: physical volume pv0 not found.
Found memtest86+ image: /memtest86+.bin
done

 

Notes:

  1. There is one line of error message per kernel per LV (took me long to find the relation)
  2. That's because Linux doesn't really have different device major's for PV's VG's LV's. It's all block devices and grub tries them all
  3. Why look at your boot device or something like that with even just the slightest, tinyest preference?
  4. obviously, we are in big trouble

 

If you rebooted, look at this:

http://askubuntu.com/questions/26886/fixing-unbootable-installation-on-lvm-root-from-desktop-livecd

I hope you didn't reboot.

 

 

Overview:

The ubuntu 12 installer doesn't configure /etc/default/grub to properly add lvm support.

It seems dpkg-reconfigure grub-pc *could* help but in practice the version you have in Ubuntu 12 might still  be too old to handle this.

You need to make a new device map and manually make sure it's not tripping over addn'l PVs that aren't assigned to root VG. This is worse than 1993's AIX, seriously.

You still need the trusty kernel to actually be "allowed" to do-release-upgrade to 14.04 LTS safely.

 

 

 

Add this to /etc/default-grub

GRUB_PRELOAD_MODULES="lvm"

 (this missing setting not configured by the ubuntu installer is most likely the issues root cause)

 

 

Giving explicit info slightly improves matters

root@zz:~# grub-install --boot-directory=/boot /dev/sda
error: physical volume pv0 not found.
error: physical volume pv0 not found.
error: physical volume pv0 not found.
error: physical volume pv0 not found.
error: physical volume pv0 not found.
error: physical volume pv0 not found.
Installation finished. No error reported.

 

 

update-grub

-> still gives the error

 

Bug reports

Documented in this bug at Ubuntu:

https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1014159

Don't get me wrong, noone on the Ubuntu project does anything about this just because those people ended up with broken systems.

 

 

Less shitty information can be found in the Debian bugtracker at:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=650724#43

(But behold, they are also not yet at the point where this is fixed, after it got reported in December 2011

 

The trick

 

One person had awesome advice though.

 

Generate a grub device map

# grub-mkdevicemap

 

It'll contain all your disks, up to a floppy if you're on VMware.

So, please edit it to only contain the LVM PVs that are in the volume group that contains your root volume!!!!!! 

root@zz:~# cat /boot/grub/device.map 
(hd0)   /dev/sda

If you have two PVs in that VG you might need to zoom around the root LV to be on the first disk of the VG. In my case there was only one PV, so I kicked out all entries but the one for hd0.

 

 

 

After this, things are fine:

root@zz:~# update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.13.0-85-generic
Found initrd image: /boot/initrd.img-3.13.0-85-generic
Found linux image: /boot/vmlinuz-3.11.0-26-generic
Found initrd image: /boot/initrd.img-3.11.0-26-generic
Found linux image: /boot/vmlinuz-3.11.0-15-generic
Found initrd image: /boot/initrd.img-3.11.0-15-generic
Found memtest86+ image: /memtest86+.bin
done

 

Late advice

 

 

So alternative to grub-mkdevicemap could be this dpkg-reconfigure grub-pc?


Of course the message is not "perfect" unless you're assuming that every person on the planet has no other job than being involved in grub2 development and aware of it's bugs. And, to be honest, out of 7bn people, who has anything else to do than track grub bugs that cause error messages that tell you should check a deprecated config file that doesn't exist on your system. I think we all need to admit we should be grub devs.

 

 

 

Also "interesting" is a sad case of forum advice where the hivemind successfully "helped" a user to suffer a almost complete dataloss out of this issue.

http://ubuntuforums.org/showthread.php?t=2113414&page=10