You are not logged in.
Pages: 1
I have an Arch install operational on my PC. It runs fine, but I can not seem to figure out how to use Arch to get it to boot into itself. It is currently an alternate OS on a different boot process, and every time I try to generate a boot record from arch, it fails spectacularly, often to the point of locking me out of bootloaders entirely for an hour or more (literally the PC boots to a black screen; I know it's outputting, because the monitors "not input" message disappears, with not even a little cursor in the corner, and no amount of f12 will get me into system setup until I leave it alone for an hour or so).
Here's my last attempt:
[root@Barad-Dur nazgul]# grub-install --target=x86_64-efi --bootloader-id=Arch --efi-directory=/boot/efi/
Installing for x86_64-efi platform.
Installation finished. No error reported.
[root@Barad-Dur nazgul]# ls -a /boot/efi/EFI/Arch/
grubx64.efi .. .
[root@Barad-Dur nazgul]# efibootmgr
BootCurrent: 0009
Timeout: 0 seconds
BootOrder: 0002,0009,0000,0001,0003
Boot0000 grub_uefi HD(1,GPT,b9cc7507-5ca6-422f-9c1a-5a1d354b5320,0x800,0x218801)/\EFI\grub_uefi\grubx64.efi
Boot0001* UEFI: FIKWOT FN950 1TB HD(1,GPT,b9cc7507-5ca6-422f-9c1a-5a1d354b5320,0x800,0x218801)/EFI\boot\bootx64.efi0000424f
Boot0002* Arch HD(1,GPT,b9cc7507-5ca6-422f-9c1a-5a1d354b5320,0x800,0x218801)/\EFI\Arch\grubx64.efi
Boot0003 GRUB HD(1,GPT,b9cc7507-5ca6-422f-9c1a-5a1d354b5320,0x800,0x218801)/\EFI\GRUB\grubx64.efi
Boot0009* Ubuntu HD(1,GPT,b9cc7507-5ca6-422f-9c1a-5a1d354b5320,0x800,0x218801)/\EFI\ubuntu\shimx64.efi
The "Arch" bootloader was generated by grub-install (it was not there previously), and as you can see the machine was booted via the "Ubuntu" record, which feeds into a classic linux boot menu wherein Arch is an auxiliary option. But the new record booted into a non-viable boot configuration as described above.
At this point I've gone through several guides, but have not figured out how to tie everything together. Do I need to run grub-mkconfig, and if so, how does it tie into grub-install or efibootmgr?
Offline
Yes you need to run grub-mkconfig, it's the basic building block that generates the config that makes GRUB configure and show a menu. https://wiki.archlinux.org/title/GRUB#G … ation_file -- this link is also linked under the installation section for GRUB: https://wiki.archlinux.org/title/GRUB#Installation (technically if you know grubs config format you could write it yourself as well, but the config, present in /boot/grub/grub.cfg unless configured otherwise is what makes GRUB load anything) though technically you should at least land in a rescue shell of GRUB if it doesn't find a config.
As for how it ties into grub-install, grub-install if ran without an alternate --boot-dir flag will hardcode the path to the config file it's going to read under /boot/grub/grub.cfg into the EFI image it generates under ${efi-directory}/EFI/${bootloader-id}/grubx64.efi. if the config file is not present under that path, you'll not have a menu.
Though seeing that Ubuntu installs a shim. Is it possible you are still booting with secure boot enabled? That complicates matters from an Arch perspective: https://wiki.archlinux.org/title/GRUB#S … ot_support
Last edited by V1del (2025-06-19 01:54:11)
Offline
the config, present in /boot/grub/grub.cfg unless configured otherwise
So, if I interpret the man correctly, that would be "--boot-directory=" and the file would still need to end in /grub/grub.cfg? I see why I had trouble with that one, given the filename has to be specified for grub-mkconfig...
Though seeing that Ubuntu installs a shim. Is it possible you are still booting with secure boot enabled?
I disabled that a few iterations ago. Still trying to decide if it's worth the trouble for a PC that sits in my house and isn't expected to have sensitive info.
Here's my next attempt
[root@Barad-Dur nazgul]# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
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.
Found Ubuntu 24.04.2 LTS (24.04) on /dev/mapper/vg--base-os1root
Adding boot menu entry for UEFI Firmware Settings ...
done
[root@Barad-Dur nazgul]# efibootmgr
BootCurrent: 0009
Timeout: 0 seconds
BootOrder: 0002,0009,0000,0001,0003
Boot0000 grub_uefi HD(1,GPT,b9cc7507-5ca6-422f-9c1a-5a1d354b5320,0x800,0x218801)/\EFI\grub_uefi\grubx64.efi
Boot0001* UEFI: FIKWOT FN950 1TB HD(1,GPT,b9cc7507-5ca6-422f-9c1a-5a1d354b5320,0x800,0x218801)/EFI\boot\bootx64.efi0000424f
Boot0002 Arch HD(1,GPT,b9cc7507-5ca6-422f-9c1a-5a1d354b5320,0x800,0x218801)/\EFI\Arch\grubx64.efi
Boot0003 GRUB HD(1,GPT,b9cc7507-5ca6-422f-9c1a-5a1d354b5320,0x800,0x218801)/\EFI\GRUB\grubx64.efi
Boot0009* Ubuntu HD(1,GPT,b9cc7507-5ca6-422f-9c1a-5a1d354b5320,0x800,0x218801)/\EFI\ubuntu\shimx64.efi
[root@Barad-Dur nazgul]# efibootmgr -b 0002 -B
BootCurrent: 0009
Timeout: 0 seconds
BootOrder: 0009,0000,0001,0003
Boot0000 grub_uefi HD(1,GPT,b9cc7507-5ca6-422f-9c1a-5a1d354b5320,0x800,0x218801)/\EFI\grub_uefi\grubx64.efi
Boot0001* UEFI: FIKWOT FN950 1TB HD(1,GPT,b9cc7507-5ca6-422f-9c1a-5a1d354b5320,0x800,0x218801)/EFI\boot\bootx64.efi0000424f
Boot0003 GRUB HD(1,GPT,b9cc7507-5ca6-422f-9c1a-5a1d354b5320,0x800,0x218801)/\EFI\GRUB\grubx64.efi
Boot0009* Ubuntu HD(1,GPT,b9cc7507-5ca6-422f-9c1a-5a1d354b5320,0x800,0x218801)/\EFI\ubuntu\shimx64.efi
[root@Barad-Dur nazgul]# rm -r /boot/efi/EFI/Arch
[root@Barad-Dur nazgul]# grub-install --target=x86_64-efi --bootloader-id=Arch --efi-directory=/boot/efi/
Installing for x86_64-efi platform.
Installation finished. No error reported.
[root@Barad-Dur nazgul]# efibootmgr
BootCurrent: 0009
Timeout: 0 seconds
BootOrder: 0002,0009,0000,0001,0003
Boot0000 grub_uefi HD(1,GPT,b9cc7507-5ca6-422f-9c1a-5a1d354b5320,0x800,0x218801)/\EFI\grub_uefi\grubx64.efi
Boot0001* UEFI: FIKWOT FN950 1TB HD(1,GPT,b9cc7507-5ca6-422f-9c1a-5a1d354b5320,0x800,0x218801)/EFI\boot\bootx64.efi0000424f
Boot0002* Arch HD(1,GPT,b9cc7507-5ca6-422f-9c1a-5a1d354b5320,0x800,0x218801)/\EFI\Arch\grubx64.efi
Boot0003 GRUB HD(1,GPT,b9cc7507-5ca6-422f-9c1a-5a1d354b5320,0x800,0x218801)/\EFI\GRUB\grubx64.efi
Boot0009* Ubuntu HD(1,GPT,b9cc7507-5ca6-422f-9c1a-5a1d354b5320,0x800,0x218801)/\EFI\ubuntu\shimx64.efi
[root@Barad-Dur nazgul]#
This generated boot menu, but only for the alternate OS and UEFI settings (still a lot less painful than a blank screen)
I would think /etc/grub.d/10_linux should be generating something during script creation, but I'm getting nothing between the header and os-prober.
Offline
So, if I interpret the man correctly, that would be "--boot-directory=" and the file would still need to end in /grub/grub.cfg? I see why I had trouble with that one, given the filename has to be specified for grub-mkconfig...
Precisely. There's surely an option to use a different path/filename entirely, but unless you deviate from that, this is what will get encoded into the binary that's generated.
As for the remaining issue, did you forget to install a kernel (e.g. the linux package)? or did you mount something over /boot which thus masks what would be present there? Outputs of
mount
pacman -Q linux
ls -l /boot/vmlinuz* /boot/linux-initramfs*
Last edited by V1del (2025-06-19 10:54:31)
Offline
[root@Barad-Dur nazgul]# mount
/dev/mapper/vg--base-os2root on / type ext4 (rw,relatime)
devtmpfs on /dev type devtmpfs (rw,nosuid,size=4096k,nr_inodes=4091663,mode=755,inode64)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,inode64)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run type tmpfs (rw,nosuid,nodev,size=6557004k,nr_inodes=819200,mode=755,inode64)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=36,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=5266)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,nosuid,nodev,relatime,pagesize=2M)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/credentials/systemd-journald.service type tmpfs (ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,inode64,noswap)
tmpfs on /run/credentials/systemd-resolved.service type tmpfs (ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,inode64,noswap)
tmpfs on /run/credentials/systemd-networkd.service type tmpfs (ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,inode64,noswap)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
/dev/mapper/vg--base-home on /home type ext4 (rw,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,size=16392504k,nr_inodes=1048576,inode64)
/dev/mapper/vg--base-os2log on /var/log type ext4 (rw,relatime)
/dev/nvme0n1p1 on /boot/efi type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=3278500k,nr_inodes=819625,mode=700,uid=1000,gid=1000,inode64)
portal on /run/user/1000/doc type fuse.portal (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
[root@Barad-Dur nazgul]# pacman -Q linux
linux 6.14.10.arch1-1
[root@Barad-Dur nazgul]# ls -l /boot/vmlinuz* /boot/linux-initramfs*
ls: cannot access '/boot/vmlinuz*': No such file or directory
ls: cannot access '/boot/linux-initramfs*': No such file or directory
So I need to run "mkinitcpio -P"? So I need that for local boot record OS generation, but not remote? I suppose it's possible I got it manually generated via a boot restore USB a couple weeks ago, but it was long enoguh ago I don't remember.
Offline
Looks like it. What "remote" or "local" do you mean exactly? Aah with regards to the different GRUBs? You most likely mounted "something" over /boot when installing originally... Did you mount the ESP directly to /boot at some point? Does
ls -l /boot/efi/vmlinuz-linux /boot/efi/initramfs-linux*
work instead? seeing as your root is on a LVM, is that encrypted? Depending on what you used chances are GRUB can't read that directly and you need to mount your ESP (or some other sufficiently sized unencrypted partition drive) to /boot directly so GRUB can properly read the kernel image anyway.
Last edited by V1del (2025-06-19 12:13:25)
Offline
This is starting to make sense...
[root@Barad-Dur nazgul]# ls -l /boot/efi/vmlinuz-linux /boot/efi/initramfs-linux*
-rwxr-xr-x 1 root root 125445472 Jun 7 16:30 /boot/efi/initramfs-linux-fallback.img
-rwxr-xr-x 1 root root 45002243 Jun 7 16:30 /boot/efi/initramfs-linux.img
-rwxr-xr-x 1 root root 15467008 Jun 7 16:23 /boot/efi/vmlinuz-linux
[root@Barad-Dur nazgul]# tail -n 3 /etc/fstab
UUID=E328-BADB /boot/efi vfat defaults 0 1
#UUID=E328-BADB /boot vfat defaults 0 2
#UUID=2C76-060B /boot/efi vfat defaults 0 1
[root@Barad-Dur nazgul]# blkid | grep E328-BADB
/dev/nvme0n1p1: UUID="E328-BADB" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="b9cc7507-5ca6-422f-9c1a-5a1d354b5320"
[root@Barad-Dur nazgul]# blkid | grep 2C76-060B
[root@Barad-Dur nazgul]#
You can see in the fstab that there has been some mobility of the boot mount. I believe 2C76-060B was the boot partition on the primary hard drive at the time of initial install. My current understanding of /boot/ vs /boot/efi/ mount points is you can make either work if you're consistent, but /boot/efi/ keeps all of your non-critical OS specific info in the root partition for the specific OS rather than cluttering the shared boot partition?
The LVMs are not encrypted; primarily I thought that would be handy for dynamic reallocation if I horribly misjudged my partition sizes or later decided I needed a new partition for a third concurrent OS or something.
mkinitcpio did not go as smoothly as hoped:
[root@Barad-Dur nazgul]# mkinitcpio -P
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
==> Using default configuration file: '/etc/mkinitcpio.conf'
-> -k /boot/vmlinuz-linux -g /boot/initramfs-linux.img
==> ERROR: specified kernel image does not exist: '/boot/vmlinuz-linux'
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'fallback'
==> Using default configuration file: '/etc/mkinitcpio.conf'
-> -k /boot/vmlinuz-linux -g /boot/initramfs-linux-fallback.img -S autodetect
==> ERROR: specified kernel image does not exist: '/boot/vmlinuz-linux'
But in the interest of blindly charging forward I manually copied over the files from /boot/efi to /boot, and that seems to work fine (will have to circle back to understand what else I should have done).
I think this has gotten me about 80% there, because now the device reboots directly into arch. The remaining problem (and I think I figured out a bit about my black screen) is that no menu appears to select my OS, or UEFI settings. More precisely, I believe the menu occurs, but does not display. If I hold F12 I end up with a perpetual black screen, but if I have the presence of mind to hit "Enter" at some point it then boots into Arch.
I don't think I changed anything but os-prober in /etc/default/grub:
[root@Barad-Dur nazgul]# cat /etc/default/grub
# GRUB boot loader configuration
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet"
GRUB_CMDLINE_LINUX=""
# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"
# Uncomment to enable booting from LUKS encrypted devices
#GRUB_ENABLE_CRYPTODISK=y
# Set to 'countdown' or 'hidden' to change timeout behavior,
# press ESC key to display menu.
GRUB_TIMEOUT_STYLE=menu
# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console
# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `videoinfo'
GRUB_GFXMODE=auto
# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep
# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY=true
# Uncomment and set to the desired menu colors. Used by normal and wallpaper
# modes only. Entries specified as foreground/background.
#GRUB_COLOR_NORMAL="light-blue/black"
#GRUB_COLOR_HIGHLIGHT="light-cyan/blue"
# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/path/to/wallpaper"
#GRUB_THEME="/path/to/gfxtheme"
# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"
# Uncomment to make GRUB remember the last selection. This requires
# setting 'GRUB_DEFAULT=saved' above.
#GRUB_SAVEDEFAULT=true
# Uncomment to disable submenus in boot menu
#GRUB_DISABLE_SUBMENU=y
# Probing for other operating systems is disabled for security reasons. Read
# documentation on GRUB_DISABLE_OS_PROBER, if still want to enable this
# functionality install os-prober and uncomment to detect and include other
# operating systems.
GRUB_DISABLE_OS_PROBER=false
But it's weird that when I didn't have a bootable Arch entry I was getting a visible menu.
If I'm actually getting to a menu and ti's not displaying that might be another issue. But, progress...
Oh, local/remote was from an assumption that my working Arch boot must have been created via os-prober on my other OS, but I'm guessing at this point that entry was made while Arch fstab was mounting the boot partition at /boot.
Offline
Pages: 1