dracut
dracut copied to clipboard
Boot Existing, Usual Linux Installation from Hard Disk in Live Mode / read-only mode with dracut
Feature request. What I would like to do:
- Install Debian to HDD with encrypted lvm using the usual installer.
- Make any persistent changes normally.
- Add dracut parameters to boot into non-persistent live mode. (add an additional grub boot menu entry for ease of use to have a choice to boot into persistent mode or live (read-only) mode)
Similar to this (alternative way to phrase this question).
Is this already possible with dracut?
By comparison, this is possible with initramfs-tools and grub.
-
Essentially just only 1 grub configuration drop-in file. +
sudo update-grub
- Screenshots here.
Figured it out thanks to dracut-grub-live @friedrich12.
/etc/dracut.conf.d/30-grub-live.conf
filesystems+=overlay
And kernel boot parameter rootovl
.
grub-live
is now compatible with dracut
.
And kernel boot parameter rootovl.
rootovl is only available on the Debian fork of dracut.
Here upstream there is an overlayfs drcaut module that works similarly to rootovl and it is now also available in Debian as well.
Perhaps you can help testing this solution so that it works with all distro
Figured it out thanks to dracut-grub-live @friedrich12.
/etc/dracut.conf.d/30-grub-live.conf
filesystems+=overlay
- This was required for Debian
bullseye
. - This breaks Debian
bookworm
, but- This is no longer required for Debian
bookworm
. - Use of
rootovl
got therefore even easier. Thank you!
- This is no longer required for Debian
And kernel boot parameter rootovl.
rootovl is only available on the Debian fork of dracut.
Here upstream there is an overlayfs drcaut module that works similarly to rootovl and it is now also available in Debian as well.
Perhaps you can help testing this solution so that it works with all distro
Happy to test this. Since I couldn't find any documentation (this is why I created this ticket), it took me a while to figure this out.
grub-live
's /etc/grub.d/11_linux_live
now has an added comment:
#GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX rd.live.overlay.overlayfs=1 rd.live.overlay.readonly=1"
(I commented out rootovl
, commented above in and run sudo update-grub
.)
And indeed, adding the kernel parameter rd.live.overlay.overlayfs=1 rd.live.overlay.readonly=1
seems to have the same effect as rootovl
.
Are these the correct kernel parameters?
Are these the correct kernel parameters?
Well, there is an open bugfix that I hope to land soon - https://github.com/dracutdevs/dracut/pull/2269 . Ideally you should test with this patch applied.
This bugfix also uploaded for debian - https://salsa.debian.org/debian/dracut/-/merge_requests/20
You might need some of these changes even for a non-nfs use case.
FYI Fedora live images also using rd.live.overlay.overlayfs -
see https://github.com/livecd-tools/livecd-tools/blob/main/imgcreate/live.py#L127
CC @Mrfai