I want to create an ext4 filesystem, and add some files to it, then "freeze" it so it is henceforth read-only.
I know it's possible to use the ro
mount option. But is there some way to indicate in the filesystem itself that it is read-only?
I see that tune2fs
has an option -o
to set default mount options, but -o ro
is not a valid option.
I also see that tune2fs
has an option -E mount_opts
. I tried -E mount_opts=ro
on a loopback filesystem (Ubuntu 14.10):
dd if=/dev/zero of=ext4test bs=1M count=32
mkfs.ext4 -L test ext4test
tune2fs -E mount_opts=ro ext4test
mkdir ext4testmnt
sudo mount ext4test ext4testmnt
However, the file system is still mounted as read-write.