Skip to content
This repository was archived by the owner on May 31, 2021. It is now read-only.

How to recover GRUB when NVRAM resets in ArchLinux

raznar0k edited this page Jul 22, 2020 · 1 revision

How to recover GRUB when NVRAM resets in ArchLinux

STEP 0. do lsblk and check for your mounted Arch Linux Drives

> lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 931.5G  0 disk
├─sda1   8:1    0   450M  0 part
├─sda2   8:2    0    16M  0 part
├─sda3   8:3    0 464.8G  0 part /mnt/WINUSR_FILES
├─sda4   8:4    0   471M  0 part
└─sda5   8:5    0 465.8G  0 part /mnt/GAMES
sdb      8:16   0 232.9G  0 disk
├─sdb1   8:17   0   529M  0 part
├─sdb2   8:18   0   100M  0 part
├─sdb3   8:19   0    16M  0 part
├─sdb4   8:20   0  93.3G  0 part
├─sdb5   8:21   0   100M  0 part
└─sdb6   8:22   0 115.6G  0 part /
sdc      8:32   0 465.8G  0 disk
└─sdc1   8:33   0 465.8G  0 part /mnt/MISC
sdd      8:48   0 465.8G  0 disk
├─sdd1   8:49   0   128M  0 part
└─sdd2   8:50   0 465.7G  0 part /mnt/TOSHIBA
sde      8:64   0  74.5G  0 disk
├─sde1   8:65   0   200M  0 part
├─sde2   8:66   0  73.7G  0 part
└─sde3   8:67   0 619.9M  0 part

This is to know where to mount the drives that we need. your lsblk will be different from my lsblk, so I will give you specific variables that will be substituted to which drive is which.

sdxe/EFI      
sdxb/Arch Boot

for further explanation, sdxe will be your EFI drive, again, it can be any, depending on your lsblk, and sdxb would be where your Arch Boot is located.

As for me, my EFI drive is sdb5 (100M), and my Arch Boot Drive is sdb6(115.6G). these substitutes to these values accordingly. So, the substitution for me would be like this:

sdxe/EFI       ==  sdb5
sdxb/Arch Boot ==  sdb6

STEP 1. make mount drives

mkdir /mnt/boot /mnt/boot/efi

STEP 2. mount drives

mount /dev/sdxb /mnt
mount /dev/sdxe /mnt/boot/efi

in my example, that would be like this:

mount /dev/sdb6 /mnt
mount /dev/sdb5 /mnt/boot/efi

STEP 3: arch-chroot into /mnt

arch-chroot /mnt

STEP 4: reintstall GRUB

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

in my example, that would be like this:

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

for further clarification, the substitution of sdx would depend on where they are both located in your lsblk.

STEP 5: make grub.cfg

grub-mkconfig -o /boot/grub/grub.cfg

STEP 6: reboot

reboot