You are not logged in.

#1 2017-04-22 13:22:35

josephemorgan91
Member
Registered: 2017-01-08
Posts: 24

Re-installing arch- grub-mkconfig gives 'failed to connect to lvmetad'

I was having some problems with my arch install that I suspect were because of accumulated 'learning moments' as I've experimented with the OS over the last few months. I've got all my dotfiles backed up, so I thought "why not just go for a fresh install?"

My first problem was that I failed to realize that the "Beginners Guide" had been remov- excuse me, merged with the installation guide. The installation guide is much more brief, which is fine, but it felt a lot more like doing something new than redoing something that I didn't have a problem with the first time.

Here are the general steps I followed:

  • Booted up installation media, made sure to do so via UEFI as my laptop gives me the option.

  • Reformatted my old arch partition

  • mounted said partition to /mnt, mounted (existing and previously functional) EFI partition to /mnt/boot/

  • pacstrapped and arch-chrooted into /mnt

Everything seemed to be working fine up to this point. I continued to carefully follow the installation guide, until I came to the section regarding installing grub. I wasn't exactly sure what to do, I know my grub had been working fine before. I figured I had to reinstall it, but did I have to do grub-mkconfig? There seemed to be a configuration file already present. I installed grub and I tried rebooting to see if grub would work, but all I got was the grub command line. I reloaded the live media, re-chrooted and ran grub-mkconfig, but got a weird error that it 'failed to connect to lvmetad.' According to my research, this seems related to partitioning using logical volume management. I'm not 100% clear on what that is, but I hadn't changed any partitions at any point in the install process so I can't figure out what this error message means.

One strange, possibly unrelated symptom is something that I've noticed as a result of having various linux distros installed on my laptop over the years. If I press f12 during boot, it allows me to choose my boot device. It's got a few things under 'legacy boot options,' and a few more under 'UEFI boot options.' Previously, the default was one called 'grub' under the UEFI category, however there are various other options for OS's that I've since uninstalled, including a couple duplicates of grub, and one "Linux Boot Manager".

I'm wondering if these are somehow conflicting and causing my problems. I've considered formatting my EFI partition following a guide I found on the wiki, but I'm worried I'll lose access to Windows, which would put me a pickle with my online classes. The whole EFI partition is something I only vaguely understand and I'm not confident in my ability to quickly repair any damage I do.

Any recommendations? I'll post any output that would be helpful, just let me know. Thanks!

Offline

#2 2017-04-22 13:56:08

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: Re-installing arch- grub-mkconfig gives 'failed to connect to lvmetad'

josephemorgan91 wrote:

Previously, the default was one called 'grub' under the UEFI category, however there are various other options for OS's that I've since uninstalled, including a couple duplicates of grub, and one "Linux Boot Manager".

I'm wondering if these are somehow conflicting and causing my problems.

Perhaps.

You can delete old NVRAM entries by booting up the Arch live ISO image and using:

# efibootmgr -b xxxx -B

*Do not* format the EFI system partition as it contains files that WIndows needs to boot.

Also:

josephemorgan91 wrote:

I installed grub

Please post the exact command used.

Offline

#3 2017-04-23 01:16:32

josephemorgan91
Member
Registered: 2017-01-08
Posts: 24

Re: Re-installing arch- grub-mkconfig gives 'failed to connect to lvmetad'

Awesome! Thanks so much for the reply. I'm currently working out exactly how to post output from my chrooted arch install, I'll reboot now and try to get exact grub install command that I used.

I know that I was following the guide, if memory serves I did a

pacman -S grub os-prober

and a

grub-install target-x86_64-efi  --efi-directory=/boot --bootloader-id=grub

Prior to my arch-chroot, verified with fdisk that /dev/sda1 was my efi partition. I

mount /dev/sda1 /mnt/boot

'ed. After my arch-chroot, I verified with

df

that sda1 was mounted at boot.

I did notice that prior to running the grub-install command, there was a directory called grub containing a grub.cfg in my mounted EFI partition. There was also an .efi stub for grub in the EFI folder. That's why I first tried to boot without running grub-install or grub-mkconfig. When that didn't work, I deleted the grub .efi stub and

mv

'ed the grub directory to grub.bak. I then ran the two commands, which recreated the grub .efi stub and grub directory, but the grub-mkconfig gave me the 'failed to connect to lvmetad' error, and said it was using a fallback method. The fallback method DID produce a grub.cfg in the correct directory, however there are no menuenty sections.

At this point, grub still only presented me with a command prompt, which wasn't really surprising given the contents of grub.cfg.

The next thing I tried was to go into the /boot/grub.bak directory that I had backed up and examine the grub.cfg located there. I found that there were menu entries for arch, but that the UUID for the partition containing my root filesystem differed from that which was in my fstab. I did something along the lines of

ls -l /dev/devices/by-uuid

(can't remember the location I ls'd for sure without having it in front of me) to verify that the UUID in my fstab was correct for /dev/sda4. I then copied the menuentry for Arch from my backup grub.cfg, replacing the incorrect UUID with the one in fstab for /dev/sda4.

This successfully gave me a menu when booting, but when I select Arch Linux, all I get is an error that /vmlinux couldn't be found. I wasn't super happy with the copy from backup solution anyway, as it doesn't explain why grub seems to think that I'm using LVM when I don't believe I am.

If it's any help, I also didn't run a single

parted

command during the installation, only a

mkfs.ext4 /dev/sda4

.

Please give me a list of any useful output that I can post, and I'll push it to github or something from arch and copy it here.

Thanks again for the reply.

Offline

#4 2017-04-23 02:19:03

josephemorgan91
Member
Registered: 2017-01-08
Posts: 24

Re: Re-installing arch- grub-mkconfig gives 'failed to connect to lvmetad'

So I've done a little bit more research and found this thread on stackexchange: https://unix.stackexchange.com/question … n-lvm-disk

One of the replies says to do the following:

I ran across the same issue just now, and found another workaround. Basically, it involves making the hosts /run directory available to the guest.

First, we mount /run where it can be accessed by the guest. I will assume that your install partition is mounted at /mnt

mkdir /mnt/hostrun
mount --bind /run /mnt/hostrun
Then, we chroot into the guest, and mount our host's /run/lvm in the guest's /run

arch-chroot /mnt /bin/bash
mkdir /run/lvm
mount --bind /hostrun/lvm /run/lvm
You can then run grub-mkconfig and grub-install without any LVM errors. This also makes the commands behave if you are installing with LVM, for what it's worth.

When done, remember to umount /run/lvm before exiting the chroot.

I followed those instructions, and it DID get rid of the error I was experiencing... but I'm getting a different error when I run grub-mkconfig now.

One by one, I get a (not exact quote)

/dev/sdx/ not initialized in UDEV

for each partition on my SSD. It creates the same grub.cfg as it was creating before. Strangely, if I run the command again, it proceeds without errors, but still produces a grub.cfg without menu entries.

I'm starting to wonder if I should just reformat my /dev/sda4 and try the installation process again, with a different bootloader. A few posts that I found referenced that there was a known issue with the grub-mkconfig helper script, but these were from circa 2014 so I wouldn't expect the issue to still be present. I know that the first time I installed arch, it worked just fine, but this was using the removed merged beginners guide. I'm also wondering if there is a step that was present in the beginners guide, that an author thought was implied in the current installation guide. There's an archived beginners guide floating around that's translated from russian, and it's much, much longer with a lot more explanation of the steps. I'm not really willing to use it because its almost a year old, but it does make me a little sad about all that information that's been removed merged with the installation guide. During this process, I've re-read the installation guide at least a half-dozen times, and I'm pretty certain that I followed it exactly, barring the partitioning section.

Should I just try to use a bootloader other than grub? I'd really prefer to understand why I'm having this issue in the first place, but my primary concern is having a functional development environment for school.

Thanks for the help

Offline

#5 2017-04-24 21:08:20

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: Re-installing arch- grub-mkconfig gives 'failed to connect to lvmetad'

Have you attempted to boot from the GRUB command line?

https://www.linux.com/learn/how-rescue- … ub-2-linux

A manually written menu entry can be just a few lines long:

https://github.com/Head-on-a-Stick/conf … rub.cfg#L3

I prefer systemd-boot because it is already included in the base system and requires no extra packages.

Offline

Board footer

Powered by FluxBB