You are not logged in.
For the past couple of times I have updated my system, I have been unable to boot afterward without fixing stuff in chroot. I get a
Failed to mount /booterror. This time, uname says the version is 6.1.8 and pacman says the version is 6.2.8 (when in chroot, after mounting /boot). When in emergency mode, uname gives version 6.1.9 (the version of root /boot)
Since this happened before, I ensured to mount /boot before updating, even though boot is automatically mounted when I start (well, when versions match, anyway).
I tried following this post, which seems to have similar issues (though it appears OP didn't have boot mounted in fstab). I didnt want to necropost so I am posting here. https://bbs.archlinux.org/viewtopic.php?id=275628
I want to have boot mounted, so in chroot I mounted /boot and ran the mkinitcpio command. This did not allow me to boot: versions still do not match. How do I fix this?
Thank you
Last edited by migillope (2023-03-29 18:44:47)
Offline
Please post your bootloader/bootmanager configs and your /etc/fstab. Output of `lsblk` may also be helpful.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Please post your bootloader/bootmanager configs and your /etc/fstab. Output of `lsblk` may also be helpful.
Sure. All of this is in the chroot environment. I suspected GRUB to be the offender and it does appear that the menuentries reference a UUID which is not the same as the UUID for the boot partition, so I probably need to regenerate those? I have also done this in one of my previous attempts to fix it, but I guess I did not do it correctly.
/etc/fstab
# Static information about the filesystems.
# See fstab(5) for details.
# <file system> <dir> <type> <options> <dump> <pass>
# /dev/nvme0n1p3
UUID=d7afcd7a-c08a-41f8-82a8-eae3f946bff2 / ext4 rw,relatime 0 1
# /dev/nvme0n1p4
UUID=93eae759-e36e-42d9-904e-1562a0076dbe /home ext4 rw,relatime 0 2
# /dev/nvme0n1p2
UUID=473c674f-8702-4b7b-9c94-96f96b097e41 none swap defaults 0 0
# /dev/nvme0n1p1
UUID=6096-1199 /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 2lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 710.1M 1 loop
sda 8:0 1 28.7G 0 disk
└─sda1 8:1 1 28.7G 0 part
nvme0n1 259:0 0 238.5G 0 disk
├─nvme0n1p1 259:1 0 512M 0 part /boot
├─nvme0n1p2 259:2 0 5.6G 0 part
├─nvme0n1p3 259:3 0 46.6G 0 part /
└─nvme0n1p4 259:4 0 185.8G 0 part /home/boot/EFI/GRUB/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="0"
fi
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root d7afcd7a-c08a-41f8-82a8-eae3f946bff2
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_US
insmod gettext
fi
terminal_input console
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=5
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-d7afcd7a-c08a-41f8-82a8-eae3f946bff2' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root d7afcd7a-c08a-41f8-82a8-eae3f946bff2
echo 'Loading Linux linux ...'
linux /boot/vmlinuz-linux root=UUID=d7afcd7a-c08a-41f8-82a8-eae3f946bff2 rw loglevel=3 quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initramfs-linux.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-d7afcd7a-c08a-41f8-82a8-eae3f946bff2' {
menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-d7afcd7a-c08a-41f8-82a8-eae3f946bff2' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root d7afcd7a-c08a-41f8-82a8-eae3f946bff2
echo 'Loading Linux linux ...'
linux /boot/vmlinuz-linux root=UUID=d7afcd7a-c08a-41f8-82a8-eae3f946bff2 rw loglevel=3 quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initramfs-linux.img
}
menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-d7afcd7a-c08a-41f8-82a8-eae3f946bff2' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root d7afcd7a-c08a-41f8-82a8-eae3f946bff2
echo 'Loading Linux linux ...'
linux /boot/vmlinuz-linux root=UUID=d7afcd7a-c08a-41f8-82a8-eae3f946bff2 rw loglevel=3 quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initramfs-linux-fallback.img
}
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/30_uefi-firmware ###
if [ "$grub_platform" = "efi" ]; then
fwsetup --is-supported
if [ "$?" = 0 ]; then
menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
fwsetup
}
fi
fi
### END /etc/grub.d/30_uefi-firmware ###
### BEGIN /etc/grub.d/35_fwupd ###
### END /etc/grub.d/35_fwupd ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg
fi
### END /etc/grub.d/41_custom ###Offline
You need to regenerate (... and the canonical place that grub will look at is going to be /boot/grub/grub.cfg if you did not pass a non-standard --boot-dir option during grub-install) those and rerun the grub-install command with the partitions properly mounted. You likely didn't during initial setup and now GRUB looks for it's config - and hence the kernels - in the /boot directory of your root partition. Which is basically the same as in the linked thread and explained in: https://bbs.archlinux.org/viewtopic.php … 2#p2031402
Offline
You need to regenerate (... and the canonical place that grub will look at is going to be /boot/grub/grub.cfg if you did not pass a non-standard --boot-dir option during grub-install) those and rerun the grub-install command with the partitions properly mounted. You likely didn't during initial setup and now GRUB looks for it's config - and hence the kernels - in the /boot directory of your root partition. Which is basically the same as in the linked thread and explained in: https://bbs.archlinux.org/viewtopic.php … 2#p2031402
Okay, I figured it out. Thanks to your advice I went ahead and ran grub config (again) while RTFM (more closely) and discovered my file structure in /boot was wonky. I had /boot/EFI/grub holding grub.cfg and efi, but everything else in /boot/grub. I'm not sure how I managed this during install, but I deleted /boot/EFI and put everything directly in /boot. Ran the mkinitcpio command and everything now works.
Thank you for the help.
Offline