Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
adrelanos opened this issue Jul 19, 2021 · 5 comments
Labels
enhancement Issue adding new functionality overlayfs

Comments

@adrelanos
Copy link

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 adrelanos added the enhancement Issue adding new functionality label Jul 19, 2021
@adrelanos
Copy link
Author

adrelanos commented Sep 3, 2021

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
Copy link
Collaborator

LaszloGombos commented Feb 28, 2023

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
Copy link
Author

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!

@adrelanos
Copy link
Author

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
Copy link
Collaborator

LaszloGombos commented Jul 9, 2023

Are these the correct kernel parameters?

Well, there is an open bugfix that I hope to land soon - #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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issue adding new functionality overlayfs
Projects
None yet
Development

No branches or pull requests

2 participants