LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-26-2009, 10:43 PM   #1
coffeecoffee
Member
 
Registered: Feb 2009
Posts: 58

Rep: Reputation: 16
Can rootfs and /proc be readonly?


Hi

I'm trying to get my Debian system readonly (few reasons for this, but mainly it runs on compact flash and suits the system purpose).

In /etc/fstab I have all the necessary things either readonly or mounted as TMPFS. And / certainly behaves readonly in that I cannot write to it (obviously), and as you can see when I run the mount command:

Code:
/dev/hda2 on / type ext3 (ro,errors=remount-ro,data=ordered)
However when I run the mount command, I get three extra lines that concern me:

Code:
rootfs on / type rootfs (rw)
none on /sys type sysfs (rw,nosuid,nodev,noexec)
none on /proc type proc (rw,nosuid,nodev,noexec)
How can I get these to be read-only as well without breaking the system?

Any help appreciated, thanks.
 
Old 09-26-2009, 11:00 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,842

Rep: Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823
/proc and /sys are pseudo filesystems. They don't exist outside the kernel structures that describe them - whether "files" within them are "writeable" is determined by the (kernel/module) code that creates them.
For rootfs, see ../Documentation/filesystems/ramfs-rootfs-initramfs.txt in your source tree.

Short answer, none is a concern re your goals.
 
Old 09-27-2009, 01:30 AM   #3
coffeecoffee
Member
 
Registered: Feb 2009
Posts: 58

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by syg00 View Post
/proc and /sys are pseudo filesystems. They don't exist outside the kernel structures that describe them - whether "files" within them are "writeable" is determined by the (kernel/module) code that creates them.
For rootfs, see ../Documentation/filesystems/ramfs-rootfs-initramfs.txt in your source tree.

Short answer, none is a concern re your goals.
Thanks for the link. Just so I am 100% sure I am correct here, you are saying that since my / is readonly, /proc and /sys are readonly too?

And rootfs is essentially a RAM disk, therefore no disk writes occur when accessing it?
 
Old 09-27-2009, 05:11 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,842

Rep: Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823
Quote:
Originally Posted by coffeecoffee View Post
... you are saying that since my / is readonly, /proc and /sys are readonly too?
I didn't say anything of the sort. For the purposes of this discussion, /proc and /sys don't exist. Period.
And if you have anything mounted at / (as you almost certainly will), the same applies to rootfs.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between Readonly Filesystem and Mounting filesystem as readonly bluepenguine Linux - Newbie 1 06-19-2009 02:26 AM
Boot hang after 'proc on /proc type proc (rw)' Hagoromo Slackware 13 10-05-2007 06:03 PM
rootfs and etab ashlesha Linux - Newbie 0 09-20-2006 08:54 PM
rootfs is mounted twice! elconde Linux - General 3 11-04-2003 09:37 PM
lilo.conf rootfs DavidPhillips Linux - General 6 03-25-2003 08:24 PM


All times are GMT -5. The time now is 08:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration