Thursday, September 8, 2016

ubuntu - Grub2 reports physical volume pv0 not found when probing/installing



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


Answer



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 :)


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...