0
I have an embedded system booting Debian off from a CF card. To minimize the potential for unrecoverable corruption when non-graceful shutdowns occur, I can boot the filesystem readonly by configuring it in fstab. However, there are a handful of directories that I would like to keep read/ write. How do I keep most of my filesystem readonly with a few exceptions?
For example /dev/hda1 mounted at / is my CF card which is readonly. I have a directory, /root (within /) in which I want to be read/write.
You can do "partially write" with a union overlay of some sort – Flexo – 2012-07-30T21:23:44.487
Yes, but I have yet to find a decent, stable, and widely-supported union filesystem (which is a real shame) and therefore I don't feel comfortable recommending one. – cdhowie – 2012-07-30T21:26:00.043
That's fine for directories where I want everything to be read-write. However, the issue is that I might want to let the user make edits to /etc/network/interfaces but nothing else in /etc. How do I pull this off? – None – 2012-07-30T21:26:44.830
@kittyhawk By setting an appropriate permissions mask, presumably. You can also use
chattr +i
on individual files to make them read-only, even to root. Of course, root canchattr -i
at any time to remove the flag. – cdhowie – 2012-07-30T21:28:02.820