Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to mount my root filesystem as read-only on boot, and use separate writable partition for logs. Is it necessary to create a ramfs image for such task?

How can I do this?

share|improve this question
2  
In addition to logs, you may need writable /tmp, maybe /home, some folders in /var. – Olli Mar 12 '11 at 14:08
Read only root filesystem may not work, why would you want to do this? – Jamess Mar 22 '11 at 6:23
why not when live cd's work? knoppix is a good example for what i want to do. unionfs with knoppix do the work great. i just want to do such a work with ubuntu. – amin Mar 27 '11 at 7:40

2 Answers

Yes, typically you would not want to mount / as read-only. I would recommend putting /usr in it's own partition and then mounting that read-only since it contains the majority of your executable files, which you would want to protect against manipulation of binaries. You could also run lsof to determine what processes are writing to the directories under /.

http://www.ibm.com/developerworks/aix/library/au-unmount_partitions/index.html

share|improve this answer
up vote 0 down vote accepted

i tried creating separate partitions for /var, /tmp, /home,/proc and mount them as rw and mount / as ro.

system boots normal and i can login and run commands but i type mount command it shows every thing mount as rw! when i try to modify some thing it tell me that ro flag is set! so i beleive this is because /etc/mtab is read-only can't be modified.

what problems may be caused with such case? what else can happen? what programs need to modify /etc ?

thanks.

share|improve this answer

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.