You are not logged in.
I have a btrfs system with a separate home partition which is also btrfs.
I had an update on Windows and it basically removed grub and turned on Secure Boot which didn’t allow me to get into the USB arch iso. But now I got into the live usb, and I tried mounting the partitions, chrooting into it, and then trying to re-install grub using "grub-install" but it gives me an error.
I mounted the root partition, the home partition and the efi partition into their respective directories and then chrooted into the '@' subvolume in the root partition:
mount /dev/nvme0n1p5 /mnt
mount /dev/nvme0n1p7 /mnt/@/home
mount /dev/nvme0n1p4 /mnt/@/boot/efi
arch-chroot /mnt/@and then I ran the command:
grub-install —targer=x86_64-efi —efi-directory=/boot/efi —bootloader-id=archlinux-2 —recheckand it gives me this error:
grub-install: error: cannot find a device for /boot/grub (is /dev mounted?).Also note that when I chroot into `/mnt/@` it gives me this warning:
==> WARNING: @ is not a mountpoint. This may have undesirable side effects.[SOLVED]:
You can just re-create the GRUB boot entry from the live environment, for example:
# efibootmgr --create --disk /dev/nvme0n1 --part 4 --label 'Arch' --loader '/EFI/archlinux-2/grubx64.efi'No need to mess around with a chroot or re-run grub-install.
Last edited by an4s911 (2023-05-16 09:31:54)
Offline
I had an update on Windows and it basically removed grub
Did it actually remove the GRUB boot entry or did it just place the Windows entry above it in the boot order?
Please share the output of
efibootmgr -uIf the GRUB entry is still there use efibootmgr's -o option to fix things.
I mounted the root partition to `/mnt` and then mount the home partition to "/mnt/@/home", and then I mounted the EFI parition to "/mnt/@/boot/efi" and then chrooted into "/mnt/@"
You should post the actual commands rather than vague descriptions.
and it gives me this error:
grub-install: error: cannot find a device for /boot/grub (is /dev mounted?).
Either (bind) mount the API filesystems before using chroot or use arch-chroot(8) instead, which will mount /dev/ automagically.
Also note that when I chroot into `/mnt/@` it gives me this warning:
==> WARNING: @ is not a mountpoint. This may have undesirable side effects.
Once again, please share the exact command used to mount the root subvolume. Looks like you did it wrong.
EDIT: so you need something like
# mount -o subvol=@ /dev/sdXY /mnt
# arch-chroot /mntHow did you install Arch originally?
Last edited by Head_on_a_Stick (2023-05-16 08:25:13)
Jin, Jîyan, Azadî
Offline
an4s911 wrote:I had an update on Windows and it basically removed grub
Did it actually remove the GRUB boot entry or did it just place the Windows entry above it in the boot order?
As I understand, it actually removed GRUB, because I can't find the option in the boot menu.
Please share the output of
efibootmgr -uIf the GRUB entry is still there use efibootmgr's -o option to fix things.
I can add it here. Currently I am on windows, so I will reboot into the live usb and check the output and then come back here and add
an4s911 wrote:I mounted the root partition to `/mnt` and then mount the home partition to "/mnt/@/home", and then I mounted the EFI parition to "/mnt/@/boot/efi" and then chrooted into "/mnt/@"
You should post the actual commands rather than vague descriptions.
mount /dev/nvme0n1p5 /mnt
mount /dev/nvme0n1p7 /mnt/@/home
mount /dev/nvme0n1p4 /mnt/@/boot/efi
arch-chroot /mnt/@I apologize, I should have added these commands.
an4s911 wrote:and it gives me this error:
grub-install: error: cannot find a device for /boot/grub (is /dev mounted?).Either (bind) mount the API filesystems before using chroot or use arch-chroot(8) instead, which will mount /dev/ automagically.
I don't know what you mean by that. How do I (bind) mount the API filesystems. As included in the commands above, I did use "arch-chroot", but seems like it didn't mount /dev/.
EDIT: so you need something like
# mount -o subvol=@ /dev/sdXY /mnt # arch-chroot /mnt
Ok, I will try that and report back. Thank you.
Last edited by an4s911 (2023-05-16 08:35:42)
Offline
You can just re-create the GRUB boot entry from the live environment, for example:
# efibootmgr --create --disk /dev/nvme0n1 --part 4 --label 'Arch' --loader '/EFI/archlinux-2/grubx64.efi'No need to mess around with a chroot or re-run grub-install.
EDIT: or from Windows:
bcdedit /set "{bootmgr}" path "\EFI\archlinux-2\grubx64.efi"Last edited by Head_on_a_Stick (2023-05-16 09:11:32)
Jin, Jîyan, Azadî
Offline
I can do that?
The —disk part needs to be the efi parition or the whole disk? Because there are two efi partitions in the disk, one for Windows and one for Linux.
Offline
Read the manpage. You should do that anyway for any new command. EDIT: the Linux ESP is what you need (ie, the partition to be mounted under /boot/efi/ in the installed system).
Last edited by Head_on_a_Stick (2023-05-16 09:12:46)
Jin, Jîyan, Azadî
Offline
EDIT: or from Windows:
bcdedit /set "{bootmgr}" path "\EFI\archlinux-2\grubx64.efi"
I tried that tho. But didn’t work
Offline
That command would only work if grubx64.efi was on the Windows ESP. You'll have to use efibootmgr instead. I'm sure it's doable from Windows but I don't know how (sorry).
Last edited by Head_on_a_Stick (2023-05-16 09:16:57)
Jin, Jîyan, Azadî
Offline
You can just re-create the GRUB boot entry from the live environment, for example:
# efibootmgr --create --disk /dev/nvme0n1 --part 4 --label 'Arch' --loader '/EFI/archlinux-2/grubx64.efi'No need to mess around with a chroot or re-run grub-install.
This worked. Thank you so much.
Offline