You are not logged in.
Hi all,
I’m trying to set up my Arch Linux system with systemd.volatile=overlay because I need to make temporary changes that don’t persist across reboots. I’m using UKI and have run into some issues getting it to work.
Here’s what I’ve tried so far:
Linux preset (linux.preset):
#/etc/mkinitcpio.d/linux.preset
ALL_kver="/boot/vmlinuz-linux"
PRESETS=('default' 'fallback')
default_uki="/efi/EFI/Linux/arch-linux.efi"
default_options="--splash /usr/share/systemd/bootctl/splash-arch.bmp"
fallback_uki="/efi/EFI/Linux/arch-linux-fallback.efi"
fallback_options="-S autodetect"
mkinitcpio config (/etc/mkinitcpio.conf):
#/etc/mkinitcpio.conf
.
.
MODULES=()
.
.
HOOKS=(base systemd autodetect microcode modconf kms keyboard sd-vconsole block sd-encrypt filesystems fsck)
.
.
Initial attempt:
Added
systemd.volatile=overlay
to the kernel cmdline.
Stuck at:
[OK] Mounted /sysroot
Observed that overlay module was missing in UKI:
lsinitrd /efi/EFI/Linux/arch-linux.efi | grep overlay
objcopy: /dev/null: file truncated
Next attempt:
Added overlay to MODULES=() in mkinitcpio.conf and rebuilt UKI.
Verified module exists:
lsinitrd /efi/EFI/Linux/arch-linux.efi | grep overlay
objcopy: /dev/null: file truncated
drwxr-xr-x root root Jan 1 1970 usr/lib/modules/6.16.3-arch1-1/kernel/fs/overlayfs/
-rw-r--r-- root root Jan 1 1978 usr/lib/modules/6.16.3-arch1-1/kernel/fs/overlayfs/overlay.ko.zst
Kernel cmdline tried:
rd.luks.name=f47ac10b-58cc-4372-a567-0e02b2c3d479=root root=/dev/mapper/root rootfstype=ext4 systemd.volatile=overlay
I want a read-only root with an overlay for temporary changes, similar to live system behavior, so I can test things without affecting the installed system.
I also tried with
systemd.volatile=state
, then /var gets mounted as a tmpfs, but root is still rw.
Thanks in advance!
Last edited by x254lb (2025-09-16 18:38:27)
Offline
Jin, Jîyan, Azadî
Offline
Can I ask why there still is no fix being formulated?
Offline
The devs are probably too busy.
Have you tried dracut instead? That seems to work for Fedora.
Jin, Jîyan, Azadî
Offline
The devs are probably too busy.
Have you tried dracut instead? That seems to work for Fedora.
You mean, try with dracut on arch?
Offline
EDIT: there is a patch available for mkinitcpio: https://bugs.archlinux.org/task/55648.html
Last edited by Head_on_a_Stick (2025-09-16 07:05:57)
Jin, Jîyan, Azadî
Offline
EDIT: there is a patch available for mkinitcpio: https://bugs.archlinux.org/task/55648.html
Thank you for your help so far.
I was trying to use dracut,and got met with an error.
Can you help me with it?
Offline
Please don't do that. I check the boards every day and reply to every thread to which I can make a useful contribution (and sometimes just shitpost for fun if it's TGN).
Did you try the patch? It might be useful for others to know if it works.
Jin, Jîyan, Azadî
Offline
Head_on_a_Stick wrote:EDIT: there is a patch available for mkinitcpio: https://bugs.archlinux.org/task/55648.html
Thank you for your help so far.
I was trying to use dracut,and got met with an error.
Can you help me with it?
I only just saw your edit. I'll try the patch out.
Offline
EDIT: there is a patch available for mkinitcpio: https://bugs.archlinux.org/task/55648.html
I tried the patch and it worked.
Not the one provided by Tobias Hunger (hunger) , but the hook provided by Nils (nlswrnr)
sd-volatile hook:
#!/bin/bash
build() {
add_module "overlay"
add_systemd_unit "systemd-volatile-root.service"
}
help() {
cat <<HELPEOF
This hook installs the necessary infrastructure for systemd.volatile to work.
HELPEOF
}
# vim: set ft=sh ts=4 sw=4 et:
I copied it to
/usr/lib/initcpio/install/sd-vconsole
And in mkinitcpio.conf, I added sd-volatile to HOOKS:
HOOKS=(base systemd sd-volatile autodetect microcode modconf kms keyboard sd-vconsole block sd-encrypt filesystems fsck)
Now, upon boot if i add the following kernel parameter, and it works perfectly.
.... systemd.volatile=overlay
root / is mounted as overlayfs
❯ findmnt
TARGET SOURCE FSTYPE OPTIONS
/ overlay overlay rw,relatime,lowerdir=/sysroot,upperdir=/run/systemd/overlay-sysr
Thank you very much for you help. In the end, it was a very simple fix.
Offline
You're welcome, glad I could help. Please edit the first post in the thread and prepend [SOLVED] to help others who may encounter this issue. Thanks,
Jin, Jîyan, Azadî
Offline