You are not logged in.

#1 2013-07-31 01:14:11

dankgnu
Member
Registered: 2013-07-17
Posts: 3

Boot partition corrupted on encrypted install, trouble repairing GRUB

Long story short, my boot partition got thoroughly messed up. I have an encrypted install with luks and dm-crypt. I have tried many guides for fixing grub and none are working.

Here is where I'm running into trouble:

I've booted an arch install cd, modprobe'd dm_crypt, mounted my encrypted root with cryptsetup, run arch-chroot, mounted the boot partition to /boot, run grub-install /dev/sda, and then grub-mkconfig -o /boot/grub/grub.cfg

When running grub-mkconfig I get 12 instances of "WARNING: Failed to connect to lvmetad: No such file or directory. Falling back to internal scanning." followed by "done". Upon reboot I am met with the grub prompt.

Any ideas?

Offline

#2 2013-07-31 01:26:04

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: Boot partition corrupted on encrypted install, trouble repairing GRUB

Welcome to Arch/the forums.

Did you mount /boot before or after arch-chroot? I thought usually you did it first but you seem to have done it afterwards? I don't know that would matter or not just that's what the instructions always seem to say.

Do you know how it got messed up?

Please post grub.cfg and /etc/default/grub.

Are you booting in bios or efi mode?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#3 2013-07-31 01:42:38

dankgnu
Member
Registered: 2013-07-17
Posts: 3

Re: Boot partition corrupted on encrypted install, trouble repairing GRUB

Thanks for the warm welcome!

I mounted /boot after chroot, as per this guide: http://azd325.github.io/blog/2013/03/30 … h-usb-key/

I ran mkfs.ext4 on my boot partition. Insanely stupid error on my part.

Bios mode.

/etc/default/grub

/boot/grub/grub.cfg

Offline

#4 2013-07-31 02:02:04

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: Boot partition corrupted on encrypted install, trouble repairing GRUB

OK. Well the wiki is usually more up to date and more accurate. However https://wiki.archlinux.org/index.php/Chroot says it is OK to mount them after just simpler and safer to do so before.

I am not surprised grub is unhappy - it doesn't seem to have any entries at all in grub.cfg. I guess it doesn't even give you a menu? (I am not sure how it would make one.)

Did you remember to reinstall the linux package before generating grub.cfg? That's the only thing I can think right now would cause it to just find nothing at all. I've seen it generate entries which wouldn't work but it is acting as if there is nothing there whatsoever. What is the contents of /boot? (Not everything under /boot/grub. Just the top level.)

EDIT: I only asked what happened to /boot in case it suggested any deeper problem. "Corruption" could mean hardware failure, for example. Just wiping it is not that bad wink. Seen much worse lately, anyway. (You could have run it on / or /home, after all.)

Last edited by cfr (2013-07-31 02:06:39)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#5 2013-07-31 02:19:50

dankgnu
Member
Registered: 2013-07-17
Posts: 3

Re: Boot partition corrupted on encrypted install, trouble repairing GRUB

There's the problem! I reinstalled the kernel and now I get a grub menu and attempted boot. I've also fixed my /etc/default/grub by readding GRUB_CMDLINE_LINUX=”cryptdevice=/dev/sda2:main”.

I briefly got the error "device `/dev/mapper/main-root` not found." - Which I easily solved by running grub-mkconfig once again after adding the cryptdevice string.

Thank you for your help!

Last edited by dankgnu (2013-07-31 02:25:16)

Offline

Board footer

Powered by FluxBB