dracutdevs / dracut

dracut the event driven initramfs infrastructure
https://github.com/dracutdevs/dracut/wiki
GNU General Public License v2.0
598 stars 397 forks source link

Boot Existing, Usual Linux Installation from Hard Disk in Live Mode / read-only mode with dracut #1565

Open adrelanos opened 3 years ago

adrelanos commented 3 years ago

Feature request. What I would like to do:

  1. Install Debian to HDD with encrypted lvm using the usual installer.
  2. Make any persistent changes normally.
  3. 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.

adrelanos commented 3 years ago

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.

LaszloGombos commented 1 year ago

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

adrelanos commented 1 year ago

Figured it out thanks to dracut-grub-live @friedrich12.

/etc/dracut.conf.d/30-grub-live.conf

filesystems+=overlay
adrelanos commented 1 year ago

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?

LaszloGombos commented 1 year ago

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