This question already has an answer here:
- How do I use OverlayFS? 4 answers
I'm running Ubuntu 14.04 with the 3.19 kernel which should have OpenFS supported (since kernel 3.18). I've been reading about OverlayFS but am confused as to how to actually implement using it. It looks like it could be a really useful alternative to LVM in enabling changes to be written somewhere else whilst taking a backup of the original filesystem that is being overlayed?
Can someone give me the example mount commands to use (if possible) for the following cases:
With a raw disk image (created using
dd if=/dev/zero of=$HOME/filestystem1.img bs=4096 count=1024000) to act as the overlaying filesystem, mount it over the top of my host's filesystem at
$HOME/mountwhich should already contain some random files such as
file2.txt. Once mounted I believe that I should still be able to see my already existing files and any files I now create will actually be stored inside the
filesystem1.imgfile that I could possibly move to another system?
Create another raw disk image and mount this one on top of the other one we just created. Do I do this as a second mount command that is executed after mount command we ran in the previous example, or can I possibly specify both mounts in one go?
I can't tell if OverlayFS is an actual filesystem I need to create on the disk images with
mkfs -t xxx /path/to/raw/disk/image, or is a special mounting method and the raw disk images are actually using something like ext4, but they are mounted in a special way with
mount -t OverlayFS? When I run:
cd /sbin ls mkfs*
I get the following which do not show an option to make an overlay filesystem.
mkfs mkfs.cramfs mkfs.ext3 mkfs.ext4dev mkfs.minix mkfs.ntfs mkfs.bfs mkfs.ext2 mkfs.ext4 mkfs.fat mkfs.msdos mkfs.vfat