0

I have a dualbooted system with windows + ubuntu on LVM:

/dev/sda1 -> efi
/dev/sda2-4 -> windows
/dev/sda5 -> LVM

/dev/vgsys/root -> /
/dev/vgsys/home -> /home

The drive it was on started getting corrupted so I recently transferred to a new SSD. Upon transferring and reinstalling some programs that had been corrupted (like wpasupplicant and sed, LOL) the system was working fine until, like a moron, I performed a system upgrade and rebooting despite seeing grub spit out some errors I've never seen before. Now my system doesn't boot and I'm trying to figure out why via a system rescue boot drive.

I tried purging and reinstalling grub which did appear to address some issues I was having (at the expense of losing some custom grub config settings that i did not back up, of course) but whenever I run grub-install or update-grub I get these bizarre and terrifying errors I haven't been able to find documented anywhere online. I copied them by hand so it might not be 100% accurate:

File descriptor 4 (/dev/sda1) leaked on vgs invocation. Parent PID 12201: grub-install
Internal error:  cfg tree element not declared as boolean.
Internal error:  cfg tree element not declared as boolean.
Internal error:  cfg tree element not declared as string.
Internal error:  cfg tree element not declared to allow empty values.
  Internal error:  cfg tree element not declared as boolean.
  Internal error:  cfg tree element not declared as boolean.
  Internal error:  cfg tree element not declared as string.
  Internal error:  cfg tree element not declared as boolean.
  Internal error:  cfg tree element not declared as array.
  Internal error:  cfg tree element not declared as array.
  Internal error:  cfg tree element not declared as array.
  Internal error:  cfg tree element not declared as boolean.
  Internal error:  cfg tree element not declared as integer.
  Internal error:  cfg tree element not declared as string.
  Internal error:  cfg tree element not declared as string.
  Internal error:  cfg tree element not declared as string.
  Internal error:  cfg tree element not declared as boolean.
  Internal error:  cfg tree element not declared as boolean.
  Internal error:  cfg tree element not declared as string.
  Internal error:  cfg tree element not declared as boolean.
  Internal error:  cfg tree element not declared as boolean.
  Internal error:  cfg tree element not declared as boolean.
  Internal error:  cfg tree element not declared as boolean.
  Internal error:  cfg tree element not declared as boolean.
  Internal error:  cfg tree element not declared as string.
  Internal error:  cfg tree element not declared as array.
  Ignoring invalid activation/mlock_filter entry in config file
  Internal error:  cfg tree element not declared as boolean.
  Internal error:  cfg tree element not declared as integer.
  Ignoring too small pv_min_size 0KB, using default 512KB.
  Internal error:  cfg tree element not declared as boolean.
  Internal error:  cfg tree element not declared as string.
  Internal error:  cfg tree element not declared as boolean.
  Internal error:  cfg tree element not declared as boolean.
  Internal error:  cfg tree element not declared as boolean.
  Internal error:  cfg tree element not declared as boolean.
  Internal error:  cfg tree element not declared as string.
  Internal error:  cfg tree element not declared as string.
  Internal error:  cfg tree element not declared as boolean.
  Internal error:  cfg tree element not declared as string.
  Internal error:  cfg tree element not declared to allow empty values.
  Internal error:  cfg tree element not declared as string.
  Internal error:  cfg tree element not declared as integer.
  Internal error:  cfg tree element not declared as string.
  Internal error:  cfg tree element not declared as array.
  Expecting string in devices/types in config file
  _control_fd: close failed: Bad file descriptor

then it seems to repeat another time.

I actually have seen File descriptor 4 (/dev/sda1) leaked on vgs invocation. Parent PID 12201: grub-install before and it is allegedly harmless. Some of other errors seem to also be related to LVM like pv_min_size so I'm sort of guessing this is an LVM issue in general.

I tried to do a grub-install on an external thumbdrive that I created with an efi and boot partition:

umount /boot/efi
mv /boot /boot.bad
mkdir /boot
mount /dev/sdb2 /boot
mkdir /boot/efi
mount /dev/sdb1 /boot/efi
grub-install --efi-directory=/boot/efi

and actually didn't get any errors. But whenever I run update-grub I get those errors again. Where are they coming from and how do I fix it?

update: I found this page that contains some of the cfg tree element.. messages, wonder what it means...

erp
  • 697
  • 2
  • 8
  • 16
  • 1
    Does running `lvs` or similar also give these errors? – psusi May 12 '22 at 15:03
  • hm it looks like it does! didn't realize since i was using lvs outside of the chroot, which doesn't yield the same errors. – erp May 12 '22 at 15:07
  • 1
    Wait, so if you run `lvs` from other boot media it doesn't complain but running the copy in the system does? Sounds like maybe your lvm binaries are corrupt. – psusi May 12 '22 at 15:21
  • yes!! thank you!!! I had the same thought and now `update-grub` is not giving me issues! i'll do some more testing in a couple hours but fingers crossed i can mark this as resolved (if you do the 'answer question' i'd be happy to mark it as the solution). there's a lot more corrupt than i thought though it's probably a good idea to do a fresh install soon. – erp May 12 '22 at 15:27

1 Answers1

1

as @psusi pointed out, the issue was that my lvm binaries were corrupt. I ran

apt-cache depends lvm2 | grep Depends | awk '{print $2}' | xargs apt install --reinstall -y
apt install --reinstall -y lvm2

to reinstall lvm2 and all its dependencies, which solved my problem.

erp
  • 697
  • 2
  • 8
  • 16