I'm trying to create a fresh ISO image for use on a USB stick. I've partitioned my USB stick into 2 partitions, one vfat
and one ext4
. The vfat
partition has the ISO and GRUB2
installed to it, such that GRUB2
boots the ISO.
The ext4
partition has the volume label casper-rw
and is used as the persistent data store for the Live USB. I've modified the grub.cfg
such that I get two options at boot, one to boot the ISO in persistent mode and one to boot normally.
However, when booting in "normal" mode, the casper-rw
partition is mounted as a normal drive and changes made in persistent mode don't stay.
What I would like is the casper-rw partition to be mounted overlaid on the /
filesystem, but when I ask Ubuntu to boot normally (i.e., without the persistent
option in GRUB2
), I'd like that partition to be mounted read-only so that changes made in the persistent mode persist.
What is the best way to achieve this?
What i did is I modify casper script inside initrd.lz.
The script will mount casper-rw as read-only and then on overlay it on top of /. It will then mount tmpfs on top of the overlay.
I use mint btw, not sure about ubuntu, hope it works for you.
Here are more details:
Edit scripts/casper, modify the
setup_unionfs()
function. You find the modified function here.Replace initrd.lz, or in my case, I just created a new one.
Add more boot option to
syslinux.cfg
Note: I use Mint 16 (x86) and unetbootin.