You are not logged in.

#1 2022-10-05 06:10:19

godpraisearch
Member
Registered: 2022-04-21
Posts: 49

[SOLVED] GRUB doesn't boot after updating config

So I attempted to switch to Linux-lts by downloading it and updating grub with this command:

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

as I saw in an average linux user video and restarted my laptop. Now my laptop doesn’t want to boot, it goes straight into BIOS. No idea what to do now…

Forgot to say: Before entering BIOS it displays “Welcome to GRUB” in tiny letters.

SOLVED!!

The solution that worked for me was the following (thanks to the help of multiple users).

- Boot into a live system on a usb.

Chroot into your device with arch-chroot (in my case I had to install it onto to my ubuntu live system, link here https://launchpad.net/ubuntu/focal/+pac … l-scripts)

sudo arch-chroot /...(root drive of your computer)
sudo mount /dev/(your boot partition) /boot

Make the boot config file

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

Reintall linux (my main was arch so I use pacman)

sudo pacman -S linux

After that, reboot.

Last edited by godpraisearch (2022-10-16 10:00:18)

Offline

#2 2022-10-05 09:06:18

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,202

Re: [SOLVED] GRUB doesn't boot after updating config

You are running into the issue mentioned in the news a while ago: https://archlinux.org/news/grub-bootloa … ibilities/ you need to actually update your GRUB payload due to a new config option getting introduced for grub-mkconfig that's incompatible with older GRUB versions.

Offline

#3 2022-10-05 21:32:42

godpraisearch
Member
Registered: 2022-04-21
Posts: 49

Re: [SOLVED] GRUB doesn't boot after updating config

I used the command

sudo mount /dev/sda6 /mnt" and "sudo grub-install --root-directory=/mnt /dev/sda

and it installed grub, but then I tried using

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

and got

/usr/sbin/grub-probe: error: failed to get canonical path of `/cow'.

Last edited by godpraisearch (2022-10-11 07:23:48)

Offline

#4 2022-10-05 21:45:22

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,202

Re: [SOLVED] GRUB doesn't boot after updating config

You need to chroot into the system and run the current gub-install from the actual system, also are you sure you have a BIOS/MBR boot? That install command would be wrong if you're actually using UEFI: https://wiki.archlinux.org/title/GRUB#Installation

Last edited by V1del (2022-10-05 21:46:43)

Offline

#5 2022-10-05 22:42:43

godpraisearch
Member
Registered: 2022-04-21
Posts: 49

Re: [SOLVED] GRUB doesn't boot after updating config

I tried to chroot into the mounted device nvme0n1p2 (

sudo mount /dev/nvme0n1p1 /mnt") by inputing "sudo chroot /mnt

and it gave me

chroot: failed to run command ‘/bin/bash’: No such file or directory

. Sorry I'm not that good at using the command line, so it probably a stupid mistake.

Last edited by godpraisearch (2022-10-11 07:24:28)

Offline

#6 2022-10-05 23:22:02

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,202

Re: [SOLVED] GRUB doesn't boot after updating config

https://wiki.archlinux.org/title/Instal … le_systems
https://wiki.archlinux.org/title/Instal … ide#Chroot

And check your partition layout you need to know your root and your ESP partition, these are basic operations here, which instructions did you follow to install Arch/did you use the archinstall script?

Post the outputs of

lsblk -f

https://wiki.archlinux.org/title/List_o … n_services

Offline

#7 2022-10-05 23:28:16

godpraisearch
Member
Registered: 2022-04-21
Posts: 49

Re: [SOLVED] GRUB doesn't boot after updating config

NAME FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
loop0
     squash 4.0                                                    0   100% /rofs
loop1
     squash 4.0                                                    0   100% /snap/core20/1587
loop2
     squash 4.0                                                    0   100% /snap/bare/5
loop3
     squash 4.0                                                    0   100% /snap/firefox/1635
loop4
     squash 4.0                                                    0   100% /snap/gnome-3-38-2004/112
loop5
     squash 4.0                                                    0   100% /snap/gtk-common-themes/1535
loop6
     squash 4.0                                                    0   100% /snap/snapd/16292
loop7
     squash 4.0                                                    0   100% /snap/snapd-desktop-integration/14
loop8
     squash 4.0                                                    0   100% /snap/snap-store/582
sda                                                                         
├─sda1
│    crypto 2           bedaacce-bb21-4a8b-b918-56bc79923966                
│ └─luks-bedaacce-bb21-4a8b-b918-56bc79923966
│    ext4   1.0   Linux Drive
│                       dc6f20f8-1c9f-484a-a43c-7d13af6a31ea                
└─sda2
     vfat   FAT32 Other 555B-18B2                              54.2G    71% /media/ubuntu/Other
sdb                                                                         
└─sdb1
     vfat   FAT32 UBUNTU 22_0
                        9E0A-DD62                                 4G    47% /cdrom
nvme0n1
│                                                                           
├─nvme0n1p1
│    vfat   FAT32       38D6-EAD3                               471M     2% /mnt
├─nvme0n1p2
│    crypto 2           94c9e3c7-6abc-4cdf-a2df-8be3662ffb2c                
│ └─luks-94c9e3c7-6abc-4cdf-a2df-8be3662ffb2c
│    ext4   1.0         2c829835-ebbd-45d2-98c5-d21df1ce09cc    6.1G    78% /media/ubuntu/2c829835-ebbd-45d2-98c5-d21df1ce09cc
└─nvme0n1p3
     crypto 2           1d1c184a-8aa4-4471-8093-754cfe68bfc5

I'm running this off of a live-usb running ubuntu so the command arch-chroot doesnt exist for me.
I did use archinstall btw.

Last edited by godpraisearch (2022-10-11 07:24:53)

Offline

#8 2022-10-06 00:00:54

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,202

Re: [SOLVED] GRUB doesn't boot after updating config

Please use code tags for pasting outputs.

You technically could have access to it: https://packages.ubuntu.com/kinetic/arc … ll-scripts in any case chroot manually in that case: https://wiki.archlinux.org/title/Chroot#Using_chroot

Unmount all these current mount points of the nvme drive. You need to mount your /dev/nvme0n1p2 to /mnt (...maybe is that your root partition? seems small but I guess archinstall script), chroot in. Look at your fstab. If it mounts nvme0n1p1 to /boot mount it there as well, if it doesn't mount it to whatever other location mounts p1. Then run

grub-install --target=x86_64-efi --efi-directory=esp--bootloader-id=GRUB

where esp is the mount point of nvme0n1p1 (so either /boot or whatever else there was)

Last edited by V1del (2022-10-06 00:01:34)

Offline

#9 2022-10-06 00:27:13

godpraisearch
Member
Registered: 2022-04-21
Posts: 49

Re: [SOLVED] GRUB doesn't boot after updating config

The partition nvme0n1p1 is my encrypted root partition. When decrypted, its nvme0n1p2 shown as

luks-94c9e3c7-6abc-4cdf-a2df-8be3662ffb2c

and its mounted at

/media/ubuntu/2c829835-ebbd-45d2-98c5-d21df1ce09cc

. Running

sudo chroot /media/ubuntu/2c829835-ebbd-45d2-98c5-d21df1ce09cc

works, but running

grub-install --target=x86_64-efi --efi-directory=esp--bootloader-id=GRUB

replacing "esp" with "/boot" returns

Installing for x86_64-efi platform.
grub-install: error: cannot find a device for /boot (is /dev mounted?).

I don't understand this because I clearly mounted as can be seen in my

lsblk -f

output.

Update: I also tried while in chroot, to run

grub-install ..." but is returned "Installing for i386-pc platform. 
grub-install: error: cannot find a device for /boot/grub (is /dev mounted?).

Last edited by godpraisearch (2022-10-11 07:27:57)

Offline

#10 2022-10-06 07:49:03

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,202

Re: [SOLVED] GRUB doesn't boot after updating config

You need to mount nvme0n1p1 to the /boot location while in your chroot before that EFI command can work

FWIW I'll split this sub-discussion off so you can come back to your original issue once this is fixed.

Mod note split from https://bbs.archlinux.org/viewtopic.php?id=280160

Last edited by V1del (2022-10-06 07:50:17)

Offline

#11 2022-10-08 20:32:00

godpraisearch
Member
Registered: 2022-04-21
Posts: 49

Re: [SOLVED] GRUB doesn't boot after updating config

So I was able to chroot into root, I then created a grub folder in the boot directory and attempted to input

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

, but get the error

/usr/bin/grub-probe: error: cannot find a device for / (is /dev mounted?)

.

I am following the tutorial: https://www.youtube.com/watch?v=r7meKJsjqfY. It says after I just have to run

cd /boot/grub/" and "grub-install /media/ubuntu/2c829835...

Please correct me if I'm wrong.

Last edited by godpraisearch (2022-10-11 07:28:41)

Offline

#12 2022-10-08 20:54:22

Roken
Member
From: South Wales, UK
Registered: 2012-01-16
Posts: 1,281

Re: [SOLVED] GRUB doesn't boot after updating config

Don't just chroot - use arch-chroot.


Ryzen 5900X 12 core/24 thread - RTX 3090 FE 24 Gb, Asus Prime B450 Plus, 32Gb Corsair DDR4, Cooler Master N300 chassis, 5 HD (1 NvME PCI, 4SSD) + 1 x optical.
Linux user #545703

/ is the root of all problems.

Offline

#13 2022-10-08 21:16:36

godpraisearch
Member
Registered: 2022-04-21
Posts: 49

Re: [SOLVED] GRUB doesn't boot after updating config

The command arch-chroot doesn't exist, could it be because I'm running a ubuntu live usb?

Offline

#14 2022-10-08 21:32:38

seth
Member
Registered: 2012-09-03
Posts: 58,713

Online

#15 2022-10-08 21:53:07

godpraisearch
Member
Registered: 2022-04-21
Posts: 49

Re: [SOLVED] GRUB doesn't boot after updating config

That way I’m able to unencrypt my laptops root partition. I tried to use cryptsetup on a arch live usb, though that didn’t work for me

Offline

#16 2022-10-08 21:59:58

Roken
Member
From: South Wales, UK
Registered: 2012-01-16
Posts: 1,281

Re: [SOLVED] GRUB doesn't boot after updating config

You are asking in the wrong place.

These forums are for Arch Linux x86_64 ONLY.

Not Artix, or Apricity, or Manjaro, or any of the "easy Arch installers", nor Arch-ARM; nothing other than vanilla 64-bit Arch Linux. Ask those communities for support.
If you have installed Arch, please read the rules before posting. README: Forum Rules.

Please note, that in signing up to these forums, you agree to the Arch Linux Privacy Policy, and any information you post to these boards will be considered "public information".

https://bbs.archlinux.org/misc.php?action=rules


Ryzen 5900X 12 core/24 thread - RTX 3090 FE 24 Gb, Asus Prime B450 Plus, 32Gb Corsair DDR4, Cooler Master N300 chassis, 5 HD (1 NvME PCI, 4SSD) + 1 x optical.
Linux user #545703

/ is the root of all problems.

Offline

#17 2022-10-08 22:10:52

seth
Member
Registered: 2012-09-03
Posts: 58,713

Re: [SOLVED] GRUB doesn't boot after updating config

https://bbs.archlinux.org/viewtopic.php?pid=2060799#p2060799 wrote:

I did use archinstall btw.

Afaiu he's trying to fix an arch installation from a ubuntu live distro?

I tried to use cryptsetup on a arch live usb, though that didn’t work for me

"How" did that not work?

Regardless,

Roken wrote:

Don't just chroot - use arch-chroot.

V1del wrote:

You technically could have access to it: https://packages.ubuntu.com/kinetic/arc … ll-scripts in any case chroot manually in that case: https://wiki.archlinux.org/title/Chroot#Using_chroot

Either use arch-chroot, or chroot properly.

Online

#18 2022-10-08 23:48:39

godpraisearch
Member
Registered: 2022-04-21
Posts: 49

Re: [SOLVED] GRUB doesn't boot after updating config

The point I'm trying to make it that I am already in chroot, not arch-chroot, because I am trying to fix an arch installation that I have, in which I accidentally wiped my boot directory. I ran

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

while in chroot, but its wrong and give me

/usr/bin/grub-probe: error: cannot find a device for / (is /dev mounted?)

. I just need to do this so I can run the command

grub-install /media/ubuntu/2c829835...(my root partition)

.

Last edited by godpraisearch (2022-10-11 07:29:57)

Offline

#19 2022-10-09 01:46:20

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

Re: [SOLVED] GRUB doesn't boot after updating config

godpraisearch wrote:

"/usr/bin/grub-probe: error: cannot find a device for / (is /dev mounted?)".

You get this error because you haven't followed the instructions in the link seth posted. Unlike arch-chroot, chroot doesn't set things up for you. You have to set them up first.


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

#20 2022-10-10 01:51:21

godpraisearch
Member
Registered: 2022-04-21
Posts: 49

Re: [SOLVED] GRUB doesn't boot after updating config

So I was able to install arch-chroot, I created the config file in grub directory, I just have to run the command grub-install... though I cant when using it like

grub install /dev/nvme0n1p1

it gives me

grub-install: error: cannot find EFI directory.

Below is the output of fdisk -l. My logic is /dev/nvme0n1p1 is the EFI device, or no?

Device            Start        End   Sectors   Size Type
/dev/nvme0n1p1    10240    1001471    991232   484M EFI System
/dev/nvme0n1p2  1011712   78125055  77113344  36.8G Linux filesystem
/dev/nvme0n1p3 78125056 1000214527 922089472 439.7G Linux filesystem

Last edited by godpraisearch (2022-10-11 07:30:47)

Offline

#21 2022-10-10 02:13:33

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

Re: [SOLVED] GRUB doesn't boot after updating config

Since you are using UEFI, you need to follow https://wiki.archlinux.org/title/GRUB#Installation. It looks as if you are trying to use a mixture of the BIOS and UEFI commands, though it is hard to tell.

Please edit your posts to use code tags.


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

#22 2022-10-10 05:54:38

godpraisearch
Member
Registered: 2022-04-21
Posts: 49

Re: [SOLVED] GRUB doesn't boot after updating config

I see that I still had to install grub and efibootmgr, but I still can't understand why the command

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

with also replacing esp with

/media/ubuntu/2c829835-ebbd-45d2-98c5-d21df1ce09cc

as well as my original encrypted partition

/dev/nvme0n1p1

as before. Sorry for making a big thing, I just have trying to solve this problem for over a couple of days, and this is the last command I need to get right.

Last edited by godpraisearch (2022-10-11 07:32:04)

Offline

#23 2022-10-10 06:15:30

seth
Member
Registered: 2012-09-03
Posts: 58,713

Re: [SOLVED] GRUB doesn't boot after updating config

I see that I still had to install grub and efibootmgr, but I still can't understand why the command "foo" with also replacing esp with "bar" as well as my original encrypted partition "foobar" as before.

You still can't understand *what*?

2c829835-ebbd-45d2-98c5-d21df1ce09cc is your root FS on nvme0n1p2, not an ESP.

Read https://wiki.archlinux.org/title/GRUB#Installation again.
What is the "esp"  in your case and how should it relate to --efi-directory ?

Online

#24 2022-10-11 04:45:04

godpraisearch
Member
Registered: 2022-04-21
Posts: 49

Re: [SOLVED] GRUB doesn't boot after updating config

I can't seem to understand why running the command

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

doesn't work when in fdisk it shows up as the efi partition. Neither does

/dev/nvme0n1

, which is my entire root drive.

Last edited by godpraisearch (2022-10-11 07:32:37)

Offline

#25 2022-10-11 04:55:49

Scimmia
Fellow
Registered: 2012-09-01
Posts: 12,084

Re: [SOLVED] GRUB doesn't boot after updating config

Because /dev/nvme0n1p1 is the block device, not the directory where it's mounted.

Offline

Board footer

Powered by FluxBB