Hello all!
I am using kvm with slackware64 14.2, with overlay: / is read-only and all data is write in another disk.
Everything works! And I am quite happy. I can clone the empty disk (small qcow2) for each VM and the bigger read-only disk is shared among all VMs!
My setup is: I've added 2 Virtio SCSI disks, each with only 1 partition.
sda1 is the rw one and I have 3 dirs: boot, upper and work.
sdb1 is the ro and I have a fresh new install of Slackware64 14.2 .
After start, lilo loads my custom initrd, then I mount sda1 in /mntrw and sdb1 in /mntro .
I've commented out default /mnt mount command. Instead, I am mounting overlay in /mnt: lowerdir=/mntro,upperdir=/mntrw/upper,workdir=/mntrw/work
I also move the /mntrw and /mntro to /mnt/mnt/mntrw and /mnt/mnt/mntro, so my disks will be accessible after next command.
Finally I do default "exec switch_root /mnt $INIT $RUNLEVEL"
--
This line is commented out in init and instead I execute others below, everything else remains the same:
Quote:
#mount -o ro -t $ROOTFS $ROOTDEV /mnt
mkdir /mntrw
mkdir /mntro
mount -t ext4 /dev/sda1 /mntrw -o rw,discard
mount -t ext4 /dev/sdb1 /mntro -o ro
mount -t overlay -o lowerdir=/mntro,upperdir=/mntrw/upper,workdir=/mntrw/work overlayroot /mnt
mount -o move /mntrw /mnt/mnt/mntrw
mount -o move /mntro /mnt/mnt/mntro
|
--
But when I execute "mount" to see the mounts... I can't see who is mounted on /, since its a overlay started in /mnt in init filesystem. But the mounts are visible on /proc/mounts.
So my question is... Since / is overlay, what is supposed to be in mtab after all this?
There are some kind of mark to say / is a virtual filesystem, and to mark /dev/sda1 and /dev/sdb1 as already mounted in this system?
Thank you!