1

I was creating a read-only root filesystem for use in an embedded system. I successfully got the system to boot after setting it to read-only initially, but then I needed write access to another file (/etc/hostname). I tried creating a symbolic link, like I did with /etc/fstab and /etc/resolv.conf, but the system fails to boot all the way - I have to boot into recovery mode and undo the change. Does anyone know an alternative to a symbolic link or why the link causes these problems?

Edit: When I boot into recovery mode, I can see two errors right at the end before it allows me to use the command-line:

startpar: service(s) returned failure: hostname.sh udev-mtab ... failed!
sulogin: root account is locked, starting shell

I tried editing /etc/init.d/hostname.sh to read hostname from /var/network/hostname (new location of the actual file), and now it boots to a login screen. This is running CrunchBang Linux, if that makes a difference. Does this help at all?

2
  • We can't answer that without knowing how the boot failed. It is possible to have a read-only root filesystem, but takes some work. It's uncommon on hosted systems but fairly common on embedded systems. Commented Dec 19, 2011 at 22:42
  • I'm not sure how the boot failed. Normally, the computer boots into a greyish screen, which is the application it is supposed to run. I can then Alt+F4 out and open terminal. When it fails to boot, it gets to the OS splash screen and then goes to black and nothing happens and no keystrokes do anything. Edited answer with a few more details.
    – SSumner
    Commented Dec 20, 2011 at 15:11

1 Answer 1

1

Why would the system need to write to any of those files to boot?
It sounds like what your looking for is a COW (copy-on-write) filesystem. You would basically overlay another directory transparently on top of root. Any files which are modified are copied into the directory and modified there. The original remains untouched.

UnionFS and AuFS are the 2 main filesystems that do this.

1
  • I probably wasn't clear enough - problem not so much the boot as it is it doesn't work properly after boot. See my comment on the question.
    – SSumner
    Commented Dec 20, 2011 at 15:12

You must log in to answer this question.

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