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.

1 Answer 1


This is supported in recent kernels (4.0 and later) and, since late February 2015, in e2fsprogs (available since version 1.42.13).

With the appropriate kernel and tools, you can flag an ext4 filesystem read-only using tune2fs:

tune2fs -O read-only ext4test

and clear the flag as always with

tune2fs -O ^read-only ext4test
  • If a filesystem has the read-only flag, it should be possible to see it in the filesystem features with something like sudo tune2fs -l /dev/ext4test | grep '^Filesystem features'
    – mwfearnley
    Commented Jul 3, 2023 at 8:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .