Where to put img files for systemd-boot?

Yup, that is the reason:

$ ls -l /boot
total 98728
drwxr-xr-x 5 root root     4096 10. Okt  21:27 grub
-rw-r--r-- 1 root root 28884832 10. Okt  21:26 initramfs-4.19-x86_64-fallback.img
-rw-r--r-- 1 root root 14267236 10. Okt  21:25 initramfs-4.19-x86_64.img
-rw-r--r-- 1 root root 29022228 10. Okt  21:26 initramfs-5.2-x86_64-fallback.img
-rw-r--r-- 1 root root 14078508 10. Okt  21:26 initramfs-5.2-x86_64.img
-rw-r--r-- 1 root root  2577920 18. Sep  20:11 intel-ucode.img
-rw-r--r-- 1 root root       22  7. Okt  22:23 linux419-x86_64.kver
-rw-r--r-- 1 root root       21  7. Okt  22:57 linux52-x86_64.kver
drwxr-xr-x 2 root root     4096 19. Feb  2019  memtest86+
-rw-r--r-- 1 root root  5953408  7. Okt  22:23 vmlinuz-4.19-x86_64
-rw-r--r-- 1 root root  6277504  7. Okt  22:57 vmlinuz-5.2-x86_64

1 Like

Correct. That's because Arch reuses/renames its kernels 'vmlinuz' and 'initramfs-linux.img'
So all new kernels will take on this name. So the entries.conf can remain the same as it refers to the new kernels after new kernels are installed.

Oh.. @freggel.doe said the same thing. And you edited to say the same. Okay then. We're all clear.

2 Likes

I don't know if you understood correctly. The files required to build the img file (vmlinuz, kver, and intel-ucode) are installed into /boot by pacman. Then, mkinitcpio creates the initramfs files and puts them also into /boot. And there is the problem because as far as I know and understand, systemd-boot requires them in /boot/EFI.
So, I have to manually copy them and edit the loader entries.

The /boot partition is 512MB, so as big as the recommendation. But when a new kernel arrives, mkinitcpio can't build the img because the partition is already full with the imgs because they are there twice.

So, I understood that systemd-bootis not "supported" by Manjaro (meaning in a way that it requires manual overhead that the default boot manager doesn't have), right?

If you have a partition /boot/efi, you can safely it. But I haven't see above output.
If you have a /boot/efi directory in /boot partition, you should not remove it.
I don't know what you have without the above. So print it out.
I cannot help you to proceed if you don't provide the output.

......
I have systemd-boot in one of my manjaro. I don't have to do this [1]
I also have a non-manjaro in systemd-boot. I don't have to do this.
I also have a manjaro in refind (no grub). I don't have to do this.

[1] copying over kernels nor then doing mkinitcpio

I do have one single /boot partition, formatted as FAT32, size 512MB with the flags boot and esp. You can see the folder structure in the original post. There is no additional ESP or EFI partition, only /boot (and of course /home and /)

The /etc/fstab line for this partition is in the first post. There is also /, /home, swap, and a tmpfs line for a ram disk, mounted at /ram.

If you don't have to copy the files with systemd-boot and Manjaro, could you show me your folder structure, systemd-boot config, and the entries.conf file where systemd-boot expects the files?

Do you have any pacman-hook? I remember there existed something like this for Arch in AUR but it might not be applicable here.

You have one single entry in fstab and that is only /boot?
And you want me to take your tree as a list of your partitions?
You want me to keep guessing and provide a solution for things I am not sure of?
What is your problem in not providing the information we asked for?

Good bye. Looks like you do not wish to get help. Good luck.

Can you share the source of this info?
Archwiki does not agree.
I am sure the manual (man <command>) also.

Would you improve our knowledge, please?

Okay, I'm sorry for adding confusion, this is the output of the commands:

parted -l

Error: /dev/sda: unrecognised disk label
Model: ATA Samsung SSD 860 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

Model: Unknown (unknown)
Disk /dev/nvme0n1: 512GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End    Size   File system  Name  Flags
 1      1049kB  538MB  537MB  fat32              boot, esp
 2      538MB   512GB  512GB

efibootmgr -v

BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000,0001,2001,2002,2003
Boot0000* Linux Boot Manager    HD(1,GPT,2858972f-5d05-49b4-9c89-9f87c1315936,0x800,0x100000)/File(\EFI\systemd\systemd-bootx64.efi)
Boot0001* EFI Hard Drive (Samsung SSD 970 PRO 512GB)    PciRoot(0x0)/Pci(0x1d,0x4)/Pci(0x0,0x0)/NVMe(0x1,00-25-38-59-81-B2-E5-3E)/HD(1,GPT,2858972f-5d05-49b4-9c89-9f87c1315936,0x800,0x100000)RC
Boot2001* EFI USB Device        RC
Boot2002* EFI DVD/CDROM RC
Boot2003* EFI Network   RC

blkid

/dev/nvme0n1p1: UUID="F67E-E175" TYPE="vfat" PARTUUID="2858972f-5d05-49b4-9c89-9f87c1315936"
/dev/nvme0n1p2: UUID="f25b462c-3066-4ac2-b169-26c59f39ecdf" TYPE="crypto_LUKS" PARTUUID="2bf5b904-8a31-4f9b-884d-1a7ed99cde90"
/dev/sda: UUID="77216a8f-a934-4e0e-a489-a00ad34c685f" TYPE="crypto_LUKS"
/dev/mapper/cryptroot: UUID="eyXN2K-B6rh-5say-zxww-nVoU-3X2e-INWH1e" TYPE="LVM2_member"
/dev/mapper/volgroup0-swap: UUID="587865cb-5d62-45bf-a6fc-85a0c4bf4618" TYPE="swap"
/dev/mapper/volgroup0-rootvol: UUID="820eeb04-e930-491c-9751-b39b8c1b13aa" TYPE="ext4"
/dev/loop0: TYPE="squashfs"
/dev/loop1: TYPE="squashfs"
/dev/loop2: TYPE="squashfs"
/dev/loop3: TYPE="squashfs"
/dev/loop4: TYPE="squashfs"
/dev/loop5: TYPE="squashfs"
/dev/loop6: TYPE="squashfs"
/dev/loop7: TYPE="squashfs"
/dev/loop8: TYPE="squashfs"
/dev/loop9: TYPE="squashfs"
/dev/loop10: TYPE="squashfs"
/dev/loop11: TYPE="squashfs"
/dev/loop12: TYPE="squashfs"
/dev/loop13: TYPE="squashfs"
/dev/loop14: TYPE="squashfs"
/dev/loop15: TYPE="squashfs"
/dev/loop16: TYPE="squashfs"
/dev/mapper/crypthome: LABEL="LuksPartition" UUID="c86b2b83-908c-4dd1-ae41-84f8f427c7d1" TYPE="ext4"

cat /etc/fstab

# /dev/nvme0n1p1 => Boot Partition
UUID=F67E-E175                                  /boot   vfat    rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro      0 2

# /dev/mapper/volgroup0-rootvol => Root
UUID=820eeb04-e930-491c-9751-b39b8c1b13aa       /       ext4    rw,noatime      0       1

# /dev/mapper/volgroup0-swap => Swap
UUID=587865cb-5d62-45bf-a6fc-85a0c4bf4618       none    swap    defaults,pri=-2 0       0

# HOME
#/dev/mapper/crypthome                          /home   ext4    defaults        0       2
UUID=c86b2b83-908c-4dd1-ae41-84f8f427c7d1       /home   ext4    defaults        0       2

# RAMDISK
tmpfs                                           /ram    tmpfs   rw,size=8G,mode=0770,uid=0,gid=1001     0       0

And again the folder structure of /boot:
tree /boot

/boot
├── EFI
│   ├── BOOT
│   │   └── BOOTX64.EFI
│   ├── initramfs-5.3-x86_64-fallback.img
│   ├── initramfs-5.3-x86_64.img
│   ├── intel-ucode.img
│   ├── systemd
│   │   └── systemd-bootx64.efi
│   └── vmlinuz-5.3-x86_64
├── initramfs-5.3-x86_64-fallback.img
├── initramfs-5.3-x86_64.img
├── intel-ucode.img
├── linux53-x86_64.kver
├── loader
│   ├── entries
│   │   ├── manjarolinux5.3.conf
│   │   ├── manjarolinux5.3-fallback.conf
│   │   └── manjarolinux5.3-silent.conf
│   └── loader.conf
└── vmlinuz-5.3-x86_64

5 directories, 15 files

Yes, the output looks fine. But what's your entries conf?
PRINT that out from /loader/entries/xxxxx.conf

cat /boot/loader/loader.conf

default manjarolinux5.3-silent
timeout	5
#editor	no

cat /boot/loader/entries/manjarolinux5.3.conf

title	Manjaro Linux - Loud
linux	/vmlinuz-5.3-x86_64
initrd	/intel-ucode.img
initrd	/initramfs-5.3-x86_64.img
options	root=UUID=820eeb04-e930-491c-9751-b39b8c1b13aa rw

cat /boot/loader/entries/manjarolinux5.3-silent.conf

title	Manjaro Linux
linux	/vmlinuz-5.3-x86_64
initrd	/intel-ucode.img
initrd	/initramfs-5.3-x86_64.img
options	root=UUID=820eeb04-e930-491c-9751-b39b8c1b13aa rw quiet systemd.show_status=0

/boot/loader/entries/manjarolinux5.3-fallback.conf

title	Manjaro Linux - Fallback
linux	/vmlinuz-5.3-x86_64
initrd	/intel-ucode.img
initrd	/initramfs-5.3-x86_64-fallback.img
options	root=UUID=820eeb04-e930-491c-9751-b39b8c1b13aa rw

(You can see, the -silent.conf just disables the systemd output; This is the default)

I don't use encryption. So I'm not entirely sure.
You used UUID=820eeb04-e930-491c-9751-b39b8c1b13aa

That is the decrypted UUID.
What if you use the raw UUID instead?
UUID=f25b462c-3066-4ac2-b169-26c59f39ecdf

title	Manjaro Linux - Fallback
linux	/vmlinuz-5.3-x86_64
initrd	/intel-ucode.img
initrd	/initramfs-5.3-x86_64-fallback.img
options	root=UUID=f25b462c-3066-4ac2-b169-26c59f39ecdf rw

You can use PARTUUID as well, like this.

title	Manjaro Linux - Fallback
linux	/vmlinuz-5.3-x86_64
initrd	/intel-ucode.img
initrd	/initramfs-5.3-x86_64-fallback.img
options	root=PARTUUID=2bf5b904-8a31-4f9b-884d-1a7ed99cde90 rw

Can you try out on one of your 3 entries?
If that works fine, you can change all 3.
If it does not you still have 2 entries to boot to.
And you will need to enter 'passphrase' .
Do you need to enter passphrase at this systemd-bootentry right now? Just wondering.

ps: fallback should not have intel-ucode but that is a different issue.
I let it remain to keep consistency for this issue.

I have to put in the unencrypted UUID because that is the UUID for the root partition. If I change that to the wrapping UUID (the LVM container), it doesn't work because the LVM volume that contains / and swap must be encrypted prior to booting from /.
It asks me for the passphrase during booting.

I don't fully understand the difference between UUID and PARTUUID but how can it solve the question where to put the img files?

If I remove them from /boot/EFI, systemd-boot does not find the img because that EFI folder is somehow the root folder of /boot during booting. But if I delete the files from /boot, mkinitcpio will recreate them after an update and leaves a state where the image in /boot is different than the one in /boot/EFI.

Have you tried this yet?
A confirmation is required to move to next phase.
Ignore the other things first. Not germane to the issue.

One more thing.. Separate item, please, but relevant
Your HOOKS line in /etc/mkinitcpio.conf
You have 'lvm2', 'encrypt' and in sequence?

As I said I don't use encryption, the use of UUID is in question.
You said it is correct to use decrypted UUID and I am not sure and ask you to try out the raw UUID.

If you are correct and needed to use the decrypted UUID, shouldn't then the option be defined not as 'root' but as 'cryptdevice' ? Like this?

title Manjaro Linux - Fallback
linux /vmlinuz-5.3-x86_64
initrd /intel-ucode.img
initrd /initramfs-5.3-x86_64-fallback.img
options cryptdevice=UUID=820eeb04-e930-491c-9751-b39b8c1b13aa rw

ps: hope you can see this copy and paste thing problem on this forum.
Hope I did not type any typo error due to this automatic tabling on this forum.

.
.
.

.
Okay..here

ps: we can talk about other things later like PARTUUID...
But HOOKS line in mkinitcpio is important. Must have 'lvm2' and 'encrypt'.

The encryption setup is split into the two files /etc/crypttab and /etc/crypttab.initramfs. The hook sd-encrypt needs this to encrypt multiple devices. It seems cleaner to me than multiple kernel parameters. Also, I have to set a keyfile for the other encrypted volume on /home.

The /etc/crypttab.initramfs has the following line:

# <name>        <device>                                   <password>                   <options>
cryptroot       UUID=f25b462c-3066-4ac2-b169-26c59f39ecdf

Password is empty, I'm asked for it during booting, and there are no options.

You can see that the UUID (f25b...) here is the GPT partition, which contains the LVM UUID "eyXN2K..." which then expands into the LVM partitions "587865cb..." (swap) and "820eeb04", where the latter is the one in the /boot/loader/entries/*.conf files given as root volume.

The /etc/crypttab is for after booting, so it should not matter here (it only contains /home)

mkinitcpio has the following hooks:

HOOKS=(base systemd autodetect keyboard sd-vconsole modconf block sd-encrypt sd-lvm2 resume filesystems fsck)

Apart from that, I changed the modules:

MODULES=(intel_agp i915)

All of this already works and is running for months. What is annoying is, that I have to manually copy the files created my mkinitcio from /boot to /boot/EFI in order for systemd-boot to find the files. A pacman-hook could be done listening for the /usr/lib/initcpio* files and then copy them automatically.
However, this leads me to the first issue, that when there is new kernel (e.g. update from 5.2 to 5.3), there are now the two initramfs-5.2.imgs and two initramfs-5.3.imgs and the /boot partition does have enough space for four images.

Yes. I understand that. What we wonder is why it is necessary for you.
I have systemd-boot, but I don't have to do this copy and do mkinitcpio.
But unlike you, I do not have encryption.

The parameters for grub in encrypted system is very complicated and may also be required in systemd-boot.

In this post here this option using grub needs the following.
So if we to apply the same parameters to your case, we would get...

options root=UUID=$pqr rw cryptdevice=UUID=$abc:luks-$abc root=/dev/mapper/luks-$abc

where your $abc is 820eeb04-e930-491c-9751-b39b8c1b13aa
and your $pqr is f25b462c-3066-4ac2-b169-26c59f39ecdf

If you like to try what works for grub, you can try substituting $abc and $pqr for your UUID's.

No. I don't know how you created this setup (M-A, or manually) but it seems a franken setup.
I regret you couldn't give an answer, that might clear things up a little

systemd-boot checks in more than one place for the images.
Since there are images in a proper place (/boot/) and cannot be seen, there should be some mis-configuration.
An experienced user on encryption and LVM is needed to assist you with this. Probably a proper Tag on your topic could draw one...

BTW, the LVM-LUKS setup you chose is one of the most complicated IMHO. I would start from that.

Good luck!

Why do you think it's the most complicated setup?
I have encrypted root and swap, and additionally home on a different volume because it's on a second hard drive. What would be your recommendation?
I know that grub2 can encrypt /boot as well, and at some time I'll look at that, but not at the moment.

Just to be clear, I did not ask you to try grub.
I just ask you to use these parameters in your systemd-boot option line.
Just substitute the $pqr and $abc with your actual values.

But if you want to try grub without installing grub, you can use the grub prompt at the install media boot menu and from the link enter each line. Just be careful your kernels is in /boot,
so not 'linux /boot/vmlinux-xxxxx .....' and 'initrd /boot/initramfs-xxxxx.img'
but 'linux /vmlinuz-xxxxx.......' and 'initrd /initramfs-xxxxx.img'

This topic was automatically closed after 180 days. New replies are no longer allowed.

Forum kindly sponsored by