LinuxQuestions.org
Visit Jeremy's Blog.
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 05-13-2005, 01:07 PM   #1
redsector
LQ Newbie
 
Registered: May 2005
Posts: 6

Rep: Reputation: 0
how to mount a readonly file system?


I have a near working installation on mandrake 10.1.
Once I get it in a perfect state, I wuold like to use the disk as a readonly, because I will leave the machine running without display/monitor/keyboard and probably someone will powerdown the machine frequenty.
in details I have the root partition, the swap partitions and the data partition.
i want to freeze the root partition and the data partition (i think that them woul be mounted as RW with a command when needed)
Is that a possible scenario?

the swap partition will suffer or will get damaged?

and also, how is possible to disable the autocheck of the filesystems in the startup sequence?

(i need this strange working method for my application)

thanks!
 
Old 05-13-2005, 05:48 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,568

Rep: Reputation: 164Reputation: 164
You can do it. Just add 'ro' in the mounting options - if you want it as default, edit /etc/fstab (4th column).

There are things you need to take into account, however. With data partition there should be no problem. It can be read-only. It's more complicated with system - it wants to write to logs, for example (in /var/logs). If you turn off all logging and all other processes that may use for example /tmp for temporary files (or move the directories to another partition) it should work OK.

Don't make swap read-only. It makes it completely unusable. There are no problems with swap when you reboot. It doesn't get corrupt, because it's initilalized at every boot.
 
Old 05-14-2005, 04:10 AM   #3
redsector
LQ Newbie
 
Registered: May 2005
Posts: 6

Original Poster
Rep: Reputation: 0
my fstab is like this:

/dev/hda1 / ext3 defaults,ro 1 1
/dev/hdc /mnt/cdrom auto umask=0,user,iocharset=iso8859-1,codepage=850,noauto,ro
,exec,users 0 0
none /proc proc defaults 0 0
/dev/hda6 /data ext3 defaults,ro 1 2
/dev/hda5 swap swap defaults 0 0

if I ask mounts the resul is

/dev/hda1 on / type ext3 (ro)
none on /proc type proc (rw)
none on /proc/bus/usb type usbfs (rw)
none on /sys type sysfs (rw)
/dev/hda6 on /data type ext3 (ro)

there are still some other questions..
what is the proc line in fstab and in mounts?
what is the the sys line in the mount?
how i set the ro for those filesystems if is it possible?
and why i s possible to write file in /?

I search the net maybe i faount the andwher myself


How i will create a ramdisk and get it mounted where logs and temp data are writte?
Or I get my system not to write to the disk things like logs?


too many questions..
 
Old 05-15-2005, 03:23 PM   #4
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,568

Rep: Reputation: 164Reputation: 164
Quote:
Originally posted by redsector
what is the proc line in fstab and in mounts?
what is the the sys line in the mount?
proc and sys are both special filesystems. They don't exist on disk. They're created dynamically.
Quote:
how i set the ro for those filesystems if is it possible?
It's not a good idea
Quote:
and why i s possible to write file in /?
Where and as which user?

Quote:
How i will create a ramdisk and get it mounted where logs and temp data are writte?
Use ramfs filesystem. having logs gone after one boot is not a ery good idea, maybe a script that will copy it to another machine from time to time?
Quote:
Or I get my system not to write to the disk things like logs?
Turn off daemons syslogd and klogd.
 
Old 05-16-2005, 02:48 AM   #5
redsector
LQ Newbie
 
Registered: May 2005
Posts: 6

Original Poster
Rep: Reputation: 0
I have modified the fstab adding in the 4th column after the "defaults" "ro", so that the results seemed like "defaults,ro" but when i logged in the machine as root, i was able to write in the disks.
The next step was tryiing to remove the "defaults" part and leaving only the "ro" parts of fstab, and that produced a really readonlysystem, but the system were no more working. I wan not more able to modify the fstab file so i had to reinstall everythings. I have tried the remount option of remount, but probably i was wrong.

the problem with ramdisk, is that i have to know where and how create it, and hoe to mount the ramdisks "ghosting" the root filesystem to have a readonly systems that continue to work.

for sure is not a good idea having a machine like that, but I keep in mind that this will be an application machine and if somthing will fail, i will reput a drive image on the disk to the initial status.

i will search on how to disable those daemons!

thanks!
 
  


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
How to read .chm file in fedora, can't mount ntfs file system ishti_du Linux - Newbie 12 03-06-2007 04:27 AM
Mounting file system in a file with mount Denes Programming 6 11-11-2005 01:04 PM
forrtl: severe (47): write to READONLY file, unit 5, file /dev/pts/1 terrence Programming 1 10-01-2005 11:22 PM
Cannot Mount File System slappycakes Linux - Hardware 18 10-13-2003 11:33 AM
mount the ntfs file system jdevanand Linux - General 3 01-22-2002 02:25 PM


All times are GMT -5. The time now is 07:49 PM.

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