You are not logged in.

#1 2022-11-21 22:07:47

markean
Member
Registered: 2021-03-20
Posts: 2

[SOLVED] GRUB not showing after update

Hi,

I would like to ask for some help in restoring my grub after an update.

I updated my system yesterday and accidently entered the following command before turning off the computer.

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

Today I turned on my computer again and the entire grub page is gone on boot and automatically redirects to the bios setting.

So I downloaded and created a bootable Arch linux ISO in an usb using another laptop.

Below are the steps that I have taken after booting with the usb stick.

1. Identified root partition and mount it:

mount /dev/nvme0n1p3 /mnt

2. Mount EFI partition as well:

mount /dev/nvme0n1p1 /mnt/boot

Please note that dev/nvme0n1p2 is a swap partition.

3. Entered

arch-chroot /mnt 

4. Editted /etc/default/grub and uncommented:

GRUB_DISABLE_OS_PROBER=false 

4. Entered

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg 

Then I have the following messages:

Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
ERROR: mkdir /var/lock/dmraid
grub-probe: error: cannot find a GRUB drive for /dev/sda1. Check your device.map. 
Adding boot menu entry for UEFI Firmware Settings ...
Adding boot menu entry for UEFI Firmware Settings ...

/dev/sda1 is the usb directory. After reboot grub is back but only the two UEFI firmware items are shown.
I guess the grub-mkconfig command was not executed as expected and the installed arch linux was not detected.
At this point I do not know how I should proceed. Since I am not familiar with all these commands, I do not want to break my existing system.

I would appreciate any help in restoring my system. Thank you in advance.

Last edited by markean (2022-11-22 00:35:34)

Offline

#2 2022-11-21 23:32:37

xerxes_
Member
Registered: 2018-04-29
Posts: 988

Re: [SOLVED] GRUB not showing after update

When you boot archiso I think you should not only mount your boot partition but also all partitions which you have in /etc/fstab into /mnt directory in their folders created for them by you, especially mount '/', '/home' , and then 'arch-chroot /mnt' and do your grub operations. You should see in output that everything is OK (os-prober may fail if you don't have windows installed on other partition).

If it still fail add --removable option at the end of command:

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

Last edited by xerxes_ (2022-11-21 23:35:53)

Offline

#3 2022-11-22 00:32:41

markean
Member
Registered: 2021-03-20
Posts: 2

Re: [SOLVED] GRUB not showing after update

xerxes_ wrote:

When you boot archiso I think you should not only mount your boot partition but also all partitions which you have in /etc/fstab into /mnt directory in their folders created for them by you, especially mount '/', '/home' , and then 'arch-chroot /mnt' and do your grub operations. You should see in output that everything is OK (os-prober may fail if you don't have windows installed on other partition).

If it still fail add --removable option at the end of command:

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

The following commands (in order) fixed the problem:

mount /dev/nvme0n1p3 /mnt
mount /dev/nvme0n1p1 /mnt/boot/efi
arch-chroot /mnt
grub-mkconfig -o /boot/grub/grub.cfg 
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub

I think changing the order of grub-mkconfig and grub-install and specifying /mnt/boot/efi instead of /mnt/boot were the keys.

Thank you!

Last edited by markean (2022-11-22 00:36:00)

Offline

#4 2022-11-22 06:53:05

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

Re: [SOLVED] GRUB not showing after update

Do you usually mount your ESP to /boot or /boot/efi because what you've done now should match where they are normally mounted (e.g. in fstab or whatever). If you usually use /boot/efi, that's fine. But if you usually use /boot, you may run into trouble later if you don't correct it.


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

Board footer

Powered by FluxBB