I upgraded a Ubuntu Maverick to Precise server but I get the following error while updating grub:

error: physical volume pv0 not found.

Now, for my system I have /dev/sda through /dev/sde

  • /dev/sda1 is a Linux partition for /boot
  • and /dev/sda5 is an LVM partition
  • /dev/sdb through /dev/sde are PVs for the LVM

By looking at my vg config, pv0 is /dev/sda5

I only have one Volume Group called "ns2" where the root (/) and some other logical volumes for the system.

I tried looking on the Web for help but they said I should upgrade to Grub2 as it is better to LVM support. I did that and I get the same error. I haven't rebooted the server but I have the feeling it is not going to boot. Still, I want to fix that error.

My boot partition is not in an LVM volume so even grub1 or grub2 should look at it without problems.

Any ideas? I just tried reinstalling grub but I get the same error, still it seems to go "fine".

What can I check before rebooting? This server is in another location and I have no remote access to the console, so I want to go there ready if something needs to be done.

Edit: Added more information http://pastebin.com/Smr1pB8W

Edit: Added pvs information http://pastebin.com/yubMd232

  • Output for egrep -v "^#|^$" /boot/grub/grub.cf ? – jirib May 25 '12 at 7:17
  • You can check it at pastebin.com/Smr1pB8W – rreg May 25 '12 at 7:29
  • How about the output of "ls -l $(pvs -v | awk '/lvm2/ {print $1}')" ? – Zach Morgan May 26 '12 at 1:12
  • Here is the output, pastebin.com/yubMd232 – rreg May 26 '12 at 2:20
  • @zachmorgan When you have more rep you'll be able to ask for clarification using comments. – Iain May 26 '12 at 13:39

It sounds like you didn't reboot between upgrading LVM2/GRUB and the kernel.

You will want to "pin" an old grub version long enough to reboot your system into a current kernel version. At that point you should be good to unpin, upgrade grub and everything should be kosher.

Add this to /etc/apt/preferences:

# Force grub to 1.98+20100804-5ubuntu3

Package: grub-pc

Pin: release n=maverick

Pin-Priority: 1000

Now apt-get update && apt-get -s dist-upgrade. Assuming you get a line like "Inst grub-pc [ 1.98+20100804-5ubuntu3] ...." (and the resulting dependency shuffling doesn't break your system... watch for things like libc downgrades) you can "apt-get dist-upgrade" to force grub back to sanity. I would suggest running "update-grub" one more time to make sure you're not walking into an un-bootable situation.

Let me know how it goes :)

  • I downgrade it and the errors went away, I still need to be there physically just in case something happens. I'll come back later with an update. – rreg May 29 '12 at 2:05
  • I uninstalled the grub-pc package then pinned it down and installed the one from maverick. Everything is working now, I still want to try to update to the one from precise but right now I don't have to. Thank you. – rreg May 29 '12 at 9:47
  • Great! Like I mentioned above, you should be fine to change everything back to stable now. Grub is an incredibly resilient tool, it's unfortunate that the error messages are so cryptic at times. :) – Zach Morgan Jun 2 '12 at 17:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.