LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-23-2007, 12:33 PM   #1
infinition
LQ Newbie
 
Registered: Nov 2006
Posts: 7

Rep: Reputation: 0
Read-Only file system


Hi

I want my system to be read only. That mean absolutely no writing on any files. No logs no nothing! I have already stopped syslog, but there is still some logs happening ( wtmp, dmesg, ...).

I have only 1 user on the system and the only thing I want him to do is to execute a program I have made. The system will not be connected to the internet.

Thanks

Eric
 
Old 11-23-2007, 01:00 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Read "man mount" and "man fstab".
Edit /etc/fstab



Cheers,
Tink
 
Old 11-23-2007, 02:01 PM   #3
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Fire up a LiveCD then and don't mount any partitions or filesystems as rw, only ro.
 
Old 11-23-2007, 03:43 PM   #4
infinition
LQ Newbie
 
Registered: Nov 2006
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by trickykid View Post
Fire up a LiveCD then and don't mount any partitions or filesystems as rw, only ro.
That is not an option since my system wont have a CD reader. I have no screen nor mouse either. After the booting process, the user will automatically get logged in and my program will be launched.

Eric
 
Old 11-23-2007, 04:30 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Out of curiosity ... what will the thing be doing?
 
Old 11-23-2007, 05:30 PM   #6
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
No input, no output, no storage. To paraphrase Tinkster, "Inquiring minds want to know: What's the point?"

Edit: Consider the "Live CD" answer, above. (Yes, I do remember that you have no CD on the system.) There are two points to think on:

1) The newer GRUBs include a "boot from ISO9660" option (which I've never used) and
2) A "Live CD" sets up its working file system in RAM with the CD/DVD as ro parts thereof.

From point 2 it's clear that you could mount your hard drive "read only" and then use ramfs to put the parts to which Linux needs to be able to write into RAM. Fore example, mount LABEL=/ / -o ro and mount -t ramfs /dev/ram15 /var/log might put the logs into RAM. (Note the "might" -- again, I've never used ramfs, and I find the documentation in man mount unclear about what to use as the device name for ramfs.)

From point 1, it might be possible to boot from a "Live CD" iso image and not have to figure out how ramfs works.

If you go the "Live CD" route, note that Fedora 8 (and other distributions, I think) includes the tools you can use to create your own "Live CD" containing your applications and boot scripts.

Last edited by PTrenholme; 11-24-2007 at 07:14 AM. Reason: Oops!~ I failed to read the passage I quoted! Sorry. New body here now.
 
Old 11-26-2007, 07:45 AM   #7
infinition
LQ Newbie
 
Registered: Nov 2006
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Tinkster View Post
Out of curiosity ... what will the thing be doing?
Controlling a radar



Well I think I'm gonna read mount and fstab afterall.

Eric

Last edited by infinition; 11-26-2007 at 07:56 AM.
 
Old 11-26-2007, 08:07 AM   #8
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Quote:
Originally Posted by infinition View Post
Controlling a radar



Well I think I'm gonna read mount and fstab afterall.

Eric
That's a great idea, something you should have already done. It's usually also a good idea to provide as many details as possible so people like me are sure to not give suggestions to only find out you won't have a cdrom or anything.. it would have saved me some time in my response.
 
Old 11-26-2007, 12:10 PM   #9
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
And...
Did you try as read only?
 
Old 11-27-2007, 10:31 AM   #10
infinition
LQ Newbie
 
Registered: Nov 2006
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by nx5000 View Post
And...
Did you try as read only?
Well I did some change in my /etc/fstab file.

I've changed the mount option from default to: ro,suid,dev,exec,auto,nouser,async.

Then I reboot and guess what... nothing happened.. Everything is like before. So I undo my changes and put back the default mount option. I rebbot and guess what... everything is now read-only. I check my /etc/fstab file and the default option is still there...

So, seems like it is working, but I really don't know why.


Also, how can I be sure nothing has been written on my disk since the last reboot? I saw on a page someone using the command find with the -newer option .
 
Old 11-27-2007, 11:19 AM   #11
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Or find with -cmin


find / -cmin -(minutes since reboot)


Cheers,
Tink
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
web server (fedora core 5) became read-only file system after i upload a file nggs8411 Linux - Server 1 03-26-2007 09:23 AM
How to read .chm file in fedora, can't mount ntfs file system ishti_du Linux - Newbie 12 03-06-2007 03:27 AM
'Read-only file system' when untar a tar.bz2 file yinglcs Linux - General 1 02-18-2006 09:12 PM
read-only file system znake Linux - General 3 05-24-2004 09:05 AM
Change from Read only to Read Write File System? justiceisblind Linux - Newbie 3 03-03-2002 07:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:21 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
Open Source Consulting | Domain Registration