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.

2 Answers 2

0

You cannot mount a filesystem "partially read-write," that makes no sense. You will have to move the directories you want to keep writable to...

  • Separate individual volumes, and mount them separately, or
  • One separate volume, mount it, and then mount --bind the directories where they belong.
4
  • You can do "partially write" with a union overlay of some sort
    – Flexo
    Jul 30, 2012 at 21:23
  • 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
    Jul 30, 2012 at 21:26
  • 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?
    – kittyhawk
    Jul 30, 2012 at 21:26
  • @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 can chattr -i at any time to remove the flag.
    – cdhowie
    Jul 30, 2012 at 21:28
0

take a look at Voyage Linux, it's a Debian distribution specially made to run on embedded devices. On /etc/default/voyage-util you can configure which directories are mounted rw (on RAM) and Voyage syncs them to CF on reboot

http://linux.voyage.hk/

You must log in to answer this question.

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