b4rt
My problem with Arch Linux
Last week, I had a problem with my Arch Linux installation. I have been using Arch for over 4 years, and I must say that it is the most stable distribution that I have used in over 14 years. However, I made a mistake by modifying the Grub config (I hate you Nvidia, I hate you).
I have a somewhat special installation of Arch Linux with a fully encrypted disk over GPT, which caused one of the problems. First of all, after modifying the Grub config, I saved and updated it and then restarted my PC (at least I had saved a backup of my old Grub config). After that, I only had an infinite loop of reboots on my computer.
Normally, you would have a message to decrypt your disk, and then the Grub would be displayed. However, after my changes, after entering my decryption password, Grub just crashed, and my PC started to reboot.
Attempting to decrypt master key…
Enter passphrase for hd1, gpt2.
To repair this issue, you need to reinstall GRUB, and in my case, the following were the necessary steps:
Use lsblk to identify the encrypted partition.
root@b4rt$ lsblk
Unlock the encrypted partition.
root@b4rt$ cryptsetup luksOpen /dev/sda1 cryptdiskb4rt
Use vgscan to detect the LVM volume group from this encrypted partition.
root@b4rt$ vgscan
Use vgchange to activate the volume group.
root@b4rt$ vgchange -ay
Now use Lvscan to get the lvm name from your root file system. You will have a similar to this:
root@b4rt$ sudo lvscan
ACTIVE '/dev/vg/swap' [8.00 GiB] inherit
ACTIVE '/dev/vg/root' [500.00 GiB] inherit
ACTIVE '/dev/vg/home' [1.32 TiB] inherit
Mount your root volume.
root@b4rt$ mount /dev/vg/root /mnt
Dont forget to mount this:
root@b4rt$
mount --bind /dev /mnt/dev
mount --bind /sys /mnt/sys
mount --bind /proc /mnt/proc
Use chroot
root@b4rt$ chroot /mnt /bin/bash
Now install grub
root@b4rt$ grub-install /dev/sda
Edit and rollback your configuration from:
/etc/default/grub
Now run this to regenerate the Grub config
root@b4rt$ sudo grub-mkconfig -o /boot/grub/grub.cfg
Finally, exit from Arch and Reboot.
After that, finally i’m able to use my pc again.
Never edit the grub configuration, unless you know 100% that you are not going to screw up your distro.
- mayo 5, 2023
- , 11:08 pm
- , Linux