An old trick for space constrained systems is to compress /usr into a sqaushfs image and to mount it as read only somewhere, then mount it and a read write directory together in /usr using unionfs, aufs, etc.
In my installation, the usr image is mounted at /mnt/squashfs/ro and is then mounted together with /mnt/squashfs/rw at /usr, like so:
Code:
$ cat /etc/fstab | tail -n2
/mnt/squashfs/usr.img /mnt/squashfs/ro squashfs loop,ro 0 0
usr /usr unionfs dirs=/mnt/squashfs/ro:/mnt/squashfs/rw 0 0
But whenever I try to create a file anywhere in /usr I'm told I can't because it is a read only file system. The read write dir contains exactly the same directories as the read only dir.
Is there a way to make unionfs write to the read write directory properly?
e, Apparently unoinfs prioritizes its directories according to their order in the dirs option. Thus fstab should be:
Code:
$ cat /etc/fstab | tail -n1
usr /usr unionfs dirs=/mnt/squashfs/rw:/mnt/squashfs/ro 0 0
Disregard this.