dracutdevs / dracut

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

Live images: allow the live device to mount RW to also contain persistent overlays #920

Closed space88man closed 3 years ago

space88man commented 4 years ago

Describe the enhancement I would like to use a USB HDD to store /LiveOS/squashfs.img as well as /LiveOS/some-persistent-overlay.

Currently I observe that the root=live:xxx device is mounted RO at /run/initramfs/live and the persistent overlay device is wanted at /run/initramfs/overlayfs. It seems that you can't mount a block device twice: once with RO and once with RW. This prevents the same block device from holding the SquashFS live image and persistent overlays.

Obviously this doesn't make sense with ISO or livenet images, but it would be very useful for HDD-based images.

What I tried In dmsquash-live-root.sh I tried a hack to remount /run/initramfs/live RW just before trying to mount /run/initramfs/overlayfs. This worked and the block device is able to host both the Live image as well as persistent overlays.

FGrose commented 4 years ago

livecd-tools has an installer script https://github.com/livecd-tools/livecd-tools/blob/master/tools/livecd-iso-to-disk.sh that is built to make a persistent overlay on the target disk.