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 10-06-2004, 10:06 AM   #1
newguy21
LQ Newbie
 
Registered: Jul 2004
Posts: 8

Rep: Reputation: 0
linux read only install - how hard is this to do????


Hello everyone, if there is another post somewhere about this please just point it out to me. I couldnt find one. I want to se up my linux filesystem partition read-only. my fstab looks like this:

# <file system> <mount point> <type> <options> <dump> <pass>
/dev/hdc1 / ext2 noauto,ro 0 1
/dev/hdc2 /mnt/temp ext3 defaults 0 0
proc /proc proc defaults 0 0
none /dev/pts devpts defaults 0 0

and i have a symbolic link in var, so that the logs get written in mnt/temp, which i want to be read write.

ln -s /mnt/temp/log /var/log

it seems that the only time i can get the system to see that i want it read only is when i take out the rc.sysinit file. is there a way to boot up properly then change the filesystem to read only after the boot up process does all of its writing?? should i change rc.sysinit to mount the filesystem read only, if so, what should alter there? thanks

Last edited by newguy21; 10-06-2004 at 10:11 AM.
 
Old 10-06-2004, 10:17 AM   #2
ridesideways
LQ Newbie
 
Registered: Mar 2004
Location: NH
Distribution: Debian 3.0
Posts: 13

Rep: Reputation: 0
tinker away

yes you can do it, but it will take some tinkering. the tinkering depends on your linux distro. i've done it with debian. its probably harder with redhat.

you need a writeable area for /var and other writeable files. you can either use a ramdisk or another partition on your drive. in a perfect world, all the writeable files would be in /var, but legacy dies hard and there is stuff in /etc that must be writeable. here's a list to get you going:

symbolic link the following files to a writeable area:
/var
/tmp
/etc/mtab
/etc/network/ifstate (this is the location for debian, there's probably something similar for other distros)
/etc/adjtime
/etc/resolv.conf
/dev/log
/lib/modules/*/modules.dep (depmod wants to run at boot time which writes out the module dependency tree)

you'll also find that you have to tinker with the /etc/rc.d boot scripts. they tend to do weird things like set permissions on the /dev/tty* files, etc.

be prepared to spend a couple hours to a couple days tinkering depending on your linux skill level, but in general it can be made to work.
 
Old 10-06-2004, 10:41 AM   #3
newguy21
LQ Newbie
 
Registered: Jul 2004
Posts: 8

Original Poster
Rep: Reputation: 0
ok, THANKS ill continue working with it, im using fedora. I can get it to boot up and mount the other drive and get the symbolic links to work just not read only. in my rc.local i use a remount command to mount it read only, there still seems to be something mounting it read write. im guessing its the rc.sysinit. thanks again.
 
Old 10-06-2004, 10:46 AM   #4
ridesideways
LQ Newbie
 
Registered: Mar 2004
Location: NH
Distribution: Debian 3.0
Posts: 13

Rep: Reputation: 0
there is also a required option to lilo to make the root fileshstem read-only.

in /etc/lilo.conf:
image=..../vmlinuz
root=/dev/hdc1
label=linux
read-only

if you use grub there is probably something similar, but i'm not sure.
 
  


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
make windows xp read linux install cd hernan Linux - Newbie 1 01-11-2005 03:13 PM
Please Read Many Question Total Linux Noob CAn't install progrram thats me!!!!!!!!!!! ddrfreak Linux - Newbie 8 12-10-2004 12:01 AM
Mandrake 10 install, can't read hard drives? Watch Mandriva 1 07-05-2004 05:40 PM
Copying a windows or linux install to a new hard disk using linux.... some_cs_student Linux - Software 7 05-24-2004 07:17 PM
Install WinXP after installing Linux Mdk9.1 please read don' t be mad at me yayitze Mandriva 3 04-13-2004 06:28 PM

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

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