Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
    
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. –  Gilles Dec 19 '11 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 Dec 20 '11 at 15:11
add comment

1 Answer 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.

share|improve this answer
    
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 Dec 20 '11 at 15:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.