I've been testing booting my installed Fedora 16 system from a squashfs'ed image (hosting all fs except my $HOME files). That seems to be a good option for many reasons and has good potentials of use, but for now it is just testing. I'll post more about it in another thread once finished...
I'm using AUFS
to mount a writeable overlay, to which I then mount --bind my rw home. To be able to do that I installed a zen-kernel as Fedora includes no support for union filesystems.
Then, analyzing Fedora dracut boot modules I found, that it deals with this problem by using dmsetup like this:
dd if=/dev/null of=$OVERLAY_LOOPDEV bs=1024 count=1 seek=$((512*1024))
losetup $OVERLAY_LOOPDEV /overlay #this to create overlay image and mount it on loop device
echo 0 `blockdev --getsz $BASE_LOOPDEV` snapshot $BASE_LOOPDEV $OVERLAY_LOOPDEV p 8 | dmsetup create live-rw #this unites them together, a ro image and rw overlay into the "live-rw" snapshot
While I'm using aufs like this:
mount -t aufs -o br:$overlay=rw:$squash_img_mnt=ro none $root_mount
mount --bind $HOME(rw) $root_mount/home
(the 200M $overlay is for the system writes and HOME is for me, didn't want to mix these together)
Now the question is: which is better and why?
doesn't include any union fs into kernel, but keeps using dmsetup for live images, and I prefer to use as much as possible the distro-provided tools to deal with an issue. Fedora is fine, but quite often prefers experimental features over those known for stability, as I have noticed (though it's been my distro of choice these last 3 years). This thread
seems to touch upon some existing issues with dmsetup approach to live-img rw overlay, for example.
-derived distros do include unionfs into kernel. And overall I couldn't find that much information about it all, except by hacking the initrd creating software in these distros...
Does anyone of you have any such experience? Maybe there are some general considerations as to why the one approach could be preferred over the other? Device-mapper approach over union filesystem mount and vice versa?
I'll keep studying it myself, meantime every thought will be greatly appreciated
Thanks in advance,