4 comments

[ 2.5 ms ] story [ 17.4 ms ] thread
This is a pretty interesting thread about how filesystems aren't necessarily read-only, even when you want them to be.

Make sure to also see this insightful comment here: https://twitter.com/mgeb/status/1384262575961960456

> For xfs we had corner cases where even with all necessary read-only flags it would still modify the FS on mount. I wouldn't count on all the corner cases being clean, eg. does the FS code really honor the R/O flag when hitting a checksum error, or does it try to repair it?

If your filesystem is on top of lvm you can force it to be truly read-only. There are other flags required if /etc is on a read-only fs.

  lvchange -pr vg00/www
  mount -o remount,ro /var/www
Hmm, I think it would be better to remount ro and only then do the lvchange.
Yes, even better mount it ro from fstab.