You are not logged in.
Hello everyone. I'm stuck.. any help would be appreciated.
I'm trying to use a bind mount to install systemd-boot to the following directory: esp/EFI/arch
The wiki states the following:
1. Instead of mounting the ESP itself to /boot, you can mount a directory of the ESP to /boot using a bind mount (see mount(8)). This allows pacman to update the kernel directly while keeping the ESP organized to your liking.
2. Just like in #Alternative mount points, copy all boot files to a directory on your ESP, but mount the ESP outside /boot. Then bind mount the directory:
# mount --bind esp/EFI/arch /boot
https://wiki.archlinux.org/index.php/EF … bind_mount
When doing a fresh install from a live USB, what would be the best way to accomplish this?
I tried the following, which is obviously not working.
mkdir -p /mnt/dev/sda1/EFI/Arch
mkdir /mnt/boot
mount --bind /mnt/dev/sda1/EFI/Arch /mnt/boot
bootctl --path=/boot install
Do I need to install using the normal recommendation of mounting the ESP to /boot?
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot
bootctl --path=/boot install
Then after the system is installed, go back and copy the files over to esp/EFI/Arch and create the bind mount?
Thanks in advance
Last edited by ssean (2019-09-24 13:51:48)
Offline
On installation, assuming root is mounted to /mnt and sda1 is your efi partition:
mkdir /mnt/efi /mnt/boot
mount /dev/sda1 /mnt/efi
mkdir -p /mnt/efi/EFI/arch
mount --bind /mnt/efi/EFI/arch /mnt/boot
bootctl --path /mnt/efi install
As a general advice do not create, touch or do anything with /mnt/dev (and /dev to some extend) except mounting from it, it will be used later for devices. There are exceptions most people never in their life worry about, but not here.
Last edited by Swiggles (2019-09-19 19:55:01)
Offline
Thanks for the help Swiggles. In regards to the code you provided above:
Instead of using
bootctl --path /mnt/efi install
Could I use
bootctl --path /mnt/boot install
to keep the kernels out of the base directory of my ESP?
Or will that cause issues?
Thanks again.
Last edited by ssean (2019-09-20 12:14:41)
Offline
bootctl has no relation to your kernel images. and you probably only want it once and not multiple times? Or do you intend to install systemd-boot for every distinct system ? And if so why? I'd understand wanting to keep kernel images separate but why systemd-boot?
Offline
Could I use
bootctl --path /mnt/boot install
to keep the kernels out of the base directory of my ESP?
Or will that cause issues?
It won't work, so I would call it an issue.
What V1del says is correct and the whole purpose of this exercise is to keep the efi root folder organized. There is no technical reason for this as stated in the wiki.
Offline
Understood. After installing and seeing the file hierarchy, it makes sense now.
I have one last issue to resolve and I think I'm good here.
systemd-boot installed successfully to /efi and also starts successfully upon reboot.
I'm now running into the issue of:
Error loading \vmlinuz-linux: Not found
Failed to execute Arch Linux (\vmlinuz-linux): Not found
This is what my bootloader entry looks like:
/efi/loader/entries/arch.conf
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options cryptdevice=UUID=ac5f8077-8e66-4f7e-bb0a-00c2b9dd2dba:vg0 resume=/dev/mapper/vg0-swap root=/dev/mapper/vg0-root quiet rw
What am I missing here?
Last edited by ssean (2019-09-20 17:10:13)
Offline
Please don't post pictures of text, post the actual text in code tags: https://wiki.archlinux.org/index.php/Co … s_and_code
What you are missing is that the linux and initrd paths are absolute paths starting from the ESP root, e.g. assuming you set up the mount as suggested in post #2, / from the POV of systemd-boot is /mnt/efi/ from your perspective.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Please don't post pictures of text, post the actual text in code tags: https://wiki.archlinux.org/index.php/Co … s_and_code
What you are missing is that the linux and initrd paths are absolute paths starting from the ESP root, e.g. assuming you set up the mount as suggested in post #2, / from the POV of systemd-boot is /mnt/efi/ from your perspective.
Sorry about the images, and thank you for the quick response.
This fixed it! Thanks!
title Arch Linux
linux /EFI/Arch/vmlinuz-linux
initrd /EFI/Arch/initramfs-linux.img
options cryptdevice=UUID=ac5f8077-8e66-4f7e-bb0a-00c2b9dd2dba:vg0 resume=/dev/mapper/vg0-swap root=/dev/mapper/vg0-root quiet rw
Last edited by ssean (2019-09-20 17:08:06)
Offline
To follow up on the above:
The system boots without issues, but I cannot seem to mount /boot.
lsblk
returns the following:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
nvme0n1 259:0 0 931.5G 0 disk
├─nvme0n1p1 259:1 0 499M 0 part
├─nvme0n1p2 259:2 0 100M 0 part /efi
├─nvme0n1p3 259:3 0 16M 0 part
├─nvme0n1p4 259:4 0 530.9G 0 part
└─nvme0n1p5 259:5 0 400G 0 part
└─arch 254:0 0 400G 0 crypt
├─arch-swap 254:1 0 8G 0 lvm [SWAP]
└─arch-root 254:2 0 392G 0 lvm /
Do I need to make changes to fstab?
# /dev/nvme0n1p2
UUID=BB20-1291 /efi vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 2
# /mnt/efi/EFI/Arch
/mnt/efi/EFI/Arch /boot none rw,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro,bind 0 0
Should I remove the /mnt?
For example:
# /dev/nvme0n1p2
UUID=BB20-1291 /efi vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 2
# /efi/EFI/Arch
/efi/EFI/Arch /boot none rw,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro,bind 0 0
Or reference the disk directly?
For example:
# /dev/nvme0n1p2
UUID=BB20-1291 /efi vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 2
# /dev/nvme0n1p2/efi/EFI/Arch
/dev/nvme0n1p2/efi/EFI/Arch /boot none rw,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro,bind 0 0
Last edited by ssean (2019-09-24 13:06:23)
Offline
Yes you need to remove the mnt that was only necessary while the root partition was mounted on your live disk. You need to reference your mount point, so /efi and you also don't need to relist your options. See
Bind mount operation
Remount part of the file hierarchy somewhere else. The call is:mount --bind olddir newdir
or by using this fstab entry:
/olddir /newdir none bind
so your entry should be
/efi/EFI/Arch /boot none bind 0 0
Last edited by V1del (2019-09-24 13:36:12)
Offline
Yes you need to remove the mnt that was only necessary while the root partition was mounted on your live disk. You need to reference your mount point, so /efi and you also don't need to relist your options. See
man mount wrote:Bind mount operation
Remount part of the file hierarchy somewhere else. The call is:mount --bind olddir newdir
or by using this fstab entry:
/olddir /newdir none bind
so your entry should be
/efi/EFI/Arch /boot none bind 0 0
That solved it! Thank you very much. I appreciate it.
Offline