You are not logged in.

#1 2025-02-28 22:19:23

tester2080
Member
Registered: 2021-08-08
Posts: 13

[SOLVED] Failed to mount /boot

I apologise, as this may be a commonly asked question, however, after following the instructions from other threads the issue still does not seem to be resolved.

When I start my system, I get the error `Failed to mount /boot` and get dropped into an emergency shell. My usual boot partition (and the one in my fstab) is `/dev/nvme0n1p1` and is not mounted. There also seems to be some boot files in `/boot/`, but no EFI stuff. I believe these can probably be removed, but I'm wary to in case it makes my problem worse. Whilst I am in the emergency shell and run `uname -r` I get `6.5.2-arch1-1`, however, `pacman -Q linux` returns `linux 6.13.4.arch1-1`. Booting with the fallback initramfs gives me the same issue.

I have an arch live usb that I am trying to use to resolve this. I have connected it to the internet and dns is resolving, and I am logged in as root obviously.  I am running the following commands on the live usb:

# mount /dev/nvme1n1p6 /mnt  # This is my regular root partition
# mount /dev/nvme1n1p1 /mnt/boot  # This is my regular boot partition
# mount -t proc /proc /mnt/proc
# mount -t sysfs /sys /mnt/sys
# mount --rbind /dev /mnt/dev
# mount --rbind /run /mnt/run
# mount --rbind /sys/firmware/efi/efivars /mnt/sys/firmware/efi/efivars
# cp /etc/resolv.conf /mnt/etc/resolv.conf
# chroot /mnt /bin/bash

It is my understanding that I should now be in the shell of my regular root partition, with the boot partition connected as normal (lsblk shows everything seems to be connected correctly). From here, if I do `uname -r` I get `6.12.10-arch1-1` and if I do `pacman -Q linux` I get `linux 6.13.4.arch1-1`, so the kernel is still out of date, but less so than before. From here I do

# pacman -Syu
# mkinitcpio -P
# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
[...] Installation finished. No error reported.
# grub-mkconfig -o /boot/grub/grub.cfg
[...] Found linux image: /vmlinuz-linux
Found initrd image: //initramfs-linux.img
Found fallback initrd image(s) in /: initramfs-linux-fallback.img
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/amd-ucode.img /boot/initramfs-linux-img
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.
/usr/lib/os-probes/50mounted-tests: line 72: 6952 Segmentation fault (core dumped) grub-mount "$partition" "$tmpmnt" 2> /dev/null
[Repeated again with different pid]
grub-probe: error: cannot find a GRUB drive for /dev/sda1. Check your device.map.
Found Windows Boot Manager on [...]
Adding boot menu entry for UEFI Firmware Settings ...
done

I now exit the chroot environment and reboot, however, I run into the exact same issue as I did at the start.  The correct boot partition is not mounted and `uname -r` gives the same result it initially does. I have tried removing the line for my boot partition from my fstab, rebooting, logging in as root and updating linux, and then restarting, but that didn't help either. I placed the line for my boot partition back into the fstab and rebooted again, but the error remained. Any help would be greatly appreciated, as at this stage I have no clue what is still incorrect.

Last edited by tester2080 (2025-03-01 21:51:12)

Offline

#2 2025-02-28 22:36:18

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,725

Re: [SOLVED] Failed to mount /boot

You forgot to reinstall the kernel while chrooted.

Offline

#3 2025-02-28 23:24:56

tester2080
Member
Registered: 2021-08-08
Posts: 13

Re: [SOLVED] Failed to mount /boot

@Scimmia Thanks for the reply. Can you clarify how I'm supposed to do that? I've now re-chrooted in and after running `pacman -Syu` I've ran `pacman -S linux linux-headers`. I then did `kernel-install add 6.13.5-arch1-1 /usr/lib/modules/6.13.5-arch1-1/vmlinuz` (seems an update has just been released) and then re-did the rest of the commands from mkinitcpio onwards, but I am still running into the same error after restarting.

Offline

#4 2025-03-01 08:41:19

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,422

Re: [SOLVED] Failed to mount /boot

If you're mounting a boot partition and install ther kernel there but end up booting a different kernel, you're probably not booting from that partition.

There also seems to be some boot files in `/boot/`

Ie. there are files in /mnt/boot before mounting /dev/nvme1n1p1 there?

file /mnt/boot/vmlinuz-linux*

will tell what kernel that is.
You can also inspect older journals of the installed system, if the kernel image is referenced as "=/boot/vmlinuz…" you're booting from the root partition.

Also

Its output will be used to detect bootable binaries on them and create new boot entries.
/usr/lib/os-probes/50mounted-tests: line 72: 6952 Segmentation fault (core dumped) grub-mount "$partition" "$tmpmnt" 2> /dev/null
[Repeated again with different pid]
grub-probe: error: cannot find a GRUB drive for /dev/sda1. Check your device.map.

looks mildly concerning wrt

My usual boot partition

Offline

#5 2025-03-01 11:09:38

tester2080
Member
Registered: 2021-08-08
Posts: 13

Re: [SOLVED] Failed to mount /boot

seth wrote:

Ie. there are files in /mnt/boot before mounting /dev/nvme1n1p1 there?

Yes, there are `amd-ucode.img, grub/, initramfs-linux.img, intiramfs-linux-fallback.img, vmlinuz-linux` in that directory before I mount nvme1n1p1, with the `file` of `/mnt/boot/vmlinuz-linux` containing `version 6.13.4-arch1-1`. This seems odd, it was my understanding that the kernel was being upgraded in my boot partition, with this remaining un-upgraded, and when the boot partition was remain unmounted,  `arch 6.5.2-arch1-1` was coming from here. However, now that it's clear this contains an actually upgraded version, I have no idea where it is finding that older kernel.

If I mount nvme1n1p1 to `/mnt/boot`, I can see `BOOT/, EFI/, 'System Volume Information'/, amd-ucode.img, grub/, initramfs-linux.img, vmlinuz-linux, '$RECYCLE.BIN'/`, and `file /mnt/boot/vmlinuz-linux` gives `version 6.13.5-arch1-1`, but I'm not certain what the consequences to mounting to a directory with existing files are. Notice however, that this version of linux is the slightly updated version (`6.13.5` vs `6.13.4`), indicating that this would be the one that was updated when I last updated the system.
However, when I chroot into this environment, `uname -r` still returns `6.12.10-arch1-1` where once again I'm not entirely sure where it's getting that. Running `cat /proc/cmdline` gives `initrd=\arch\boot\x86_64\initrafs-linux.img archisobasedir=arch archisosearchuuid=2025 archisosearchuuid=...`, so maybe `6.12.10` is coming from the arch live usb stick I have, and even in the chrooted environment, `uname -r` is referring to that? I get the same output when I exit chroot and run `uname -r` again so this seems to make sense.

You can also inspect older journals of the installed system, if the kernel image is referenced as "=/boot/vmlinuz…" you're booting from the root partition.

This is really strange, doing that for a boots a few days ago when the system was working shows `Kernel command line: BOOT_IMAGE=/vmlinuz-linux root=UUID=[UUID 1] ...`. I have no idea why I have a kernel file here, and if I do `file /vmlinuz-linux` it does show `version 6.5.2-arch1-1`, which is what I am getting when I am put into the emergency shell. This is likely the problem then right? Any ideas how to safely fix all this?

looks mildly concerning wrt

My usual boot partition

I believe /dev/sda1 may be my live usb, so assuming the grub probe error was referring to this, I don't think it's an issue.

Offline

#6 2025-03-01 15:10:41

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,422

Re: [SOLVED] Failed to mount /boot

1. clean the mountpoint (unmounted /mnt/boot path) - it gets completely replaced by the mount (you're not seeing files from the mountpoint in the mounted partition) but this helps to reduce (future) confusion
2. w/ chrooting

lsblk -f

3. "$RECYCLE.BIN'" means there's probably a windows installation
4. uname prints the kernel you're booting - in doubt the one from the install iso. The problem is if you're currently still booting some 6.5 kernel on the installed system.

Offline

#7 2025-03-01 17:06:05

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Failed to mount /boot

tester2080 wrote:

I then did `kernel-install add 6.13.5-arch1-1 /usr/lib/modules/6.13.5-arch1-1/vmlinuz`

Arch doesn't use kernel-install, that's a Fedora thing.

Please share the content of /boot/grub/grub.cfg and also check for grub.cfg files on both the root and /boot/ partitions. What does the plain `set` command say from the GRUB command line? It should list where it is looking for $configfile (grub.cfg).

seth wrote:

looks mildly concerning

https://bbs.archlinux.org/viewtopic.php?id=303725


Jin, Jîyan, Azadî

Offline

#8 2025-03-01 20:34:33

tester2080
Member
Registered: 2021-08-08
Posts: 13

Re: [SOLVED] Failed to mount /boot

1. Ok the /boot is now empty before the boot partition is mounted.

2. Here, if I have /dev/nvme1n1p1 mounted whilst chrooted, then that's correctly showing as being at /boot, and the nvme1n1p6 partition is showing as being at / as I would expect. If I don't have the other partition mounted, it just shows the ..p6 partition at /, with nothing else mounted.

3. Yeah, one of the partitions is a windows partition.

4. Ah, that makes sense then. Yeah the version that's 6.5 is the vmlinuz that is stored in my root directory (it is directly in / ), rather than from the /boot directory.

Head_on_a_Stick wrote:

Please share the content of /boot/grub/grub.cfg and also check for grub.cfg files on both the root and /boot/ partitions

/boot/grub/grub.cfg (the mounted /boot) contains the lines `linux /vmlinuz-linux root=UUID=...` and `initrd /initramfs-linux.img`, so it seems like it's pointing to the stuff in / rather than in /boot, which is weird given I'm specifically giving the efi directory as /boot in the grub-install command. The grub directory from the unmounted /boot/ was empty. How do I change grub to point at the /boot directory instead? Is it safe to just remove the /vmlinuz-linux file and hope grub points to /boot instead?

`set` seems to be showing

cmdpath='(hd1,gpt1)/EFI/GRUB'
...
prefix='(hd1,gpt1)/grub'
...
root='hd1,gpt6'

Last edited by tester2080 (2025-03-01 20:35:03)

Offline

#9 2025-03-01 20:41:49

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Failed to mount /boot

tester2080 wrote:

it seems like it's pointing to the stuff in / rather than in /boot

No, the given paths must be relative to the /boot/ partition because the path would include /boot/ if the kernel & initramfs images were on the root partition.

Please share the full grub.cfg file along with the output of

blkid

What actually happens when you start the machine? Please describe what you see on the screen in more detail. Thanks.


Jin, Jîyan, Azadî

Offline

#10 2025-03-01 21:17:10

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,422

Re: [SOLVED] Failed to mount /boot

Yeah the version that's 6.5 is the vmlinuz that is stored in my root directory (it is directly in / ), rather than from the /boot directory.

You're not supposed to have sth. like /vmlinuz-linux (in your root partition) and this suggests you're actually booting from the root partition but have at some point mounted it to /boot as well (ie. you had a setup w/ /boot/usr, /boot/etc/…)
The best course of action would be to fix that (your bootloader config) and turn what you decided to be the boot partition into the actual device you're booting from.
next to blkid or lsblk -f, also post the bootloader (any grub.cfg you can find)

Offline

#11 2025-03-01 21:30:33

tester2080
Member
Registered: 2021-08-08
Posts: 13

Re: [SOLVED] Failed to mount /boot

Head_on_a_Stick wrote:

the path would include /boot/ if the kernel & initramfs images were on the root partition.

The root partition (..p6) has a file /vmlinuz (so in the root directory, rather than the /boot directory), which has linux 6.5 installed, which matches what I get in the emergency shell. I don't know for sure whether grub is pointing at that or the mounted boot partition though, as as you say, both would have the same path in the partition itself.

My full grub.cfg is available at http://termbin.com/xgt4.

When I start the machine I can see my normal grub, which shows arch linux as an option, then says booting arch linux and loading linux linuz, and then says

[FAILED] Failed to mount /boot.
[DEPEND] Dependency failed for Local File Systems.
Your are in emergency mode
...
seth wrote:

next to blkid or lsblk -f

My full lsblk -f output from when I am chrooted in is with the `nvme1n1p1` mounted at /boot is available at http://termbin.com/1u7l and in case it is of any use, my fstab is available at http://termbin.com/07g4.

Last edited by tester2080 (2025-03-01 21:31:27)

Offline

#12 2025-03-01 21:37:41

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Failed to mount /boot

tester2080 wrote:

grub.cfg

That shows GRUB is trying to boot from vmlinuz-linux on the root partition so remove any kernel & initramfs images from the root partition and regenerate grub.cfg with the /boot/ partition correctly mounted.

Pro tip: use arch-chroot(8) instead of 6 lines followed by the standard chroot command. It's very convenient.


Jin, Jîyan, Azadî

Offline

#13 2025-03-01 21:50:26

tester2080
Member
Registered: 2021-08-08
Posts: 13

Re: [SOLVED] Failed to mount /boot

Head_on_a_Stick wrote:

remove any kernel & initramfs images from the root partition and regenerate grub.cfg

That works, thank you both so much for your help! I'll mark this thread as solved.

use arch-chroot(8)

Oh nice, that is very handy. Hopefully I won't be having to use it again for a while though haha.

Offline

Board footer

Powered by FluxBB