Results 1 to 10 of 14
Hi all,
I'm interested in installing RHEL server on a solid state drive.
I would like to make this OS read-only as to prolong the longevity of the drive (these ...
- 06-10-2010 #1Just Joined!
- Join Date
- Jun 2010
- Posts
- 14
How to make a read-only OS?
Hi all,
I'm interested in installing RHEL server on a solid state drive.
I would like to make this OS read-only as to prolong the longevity of the drive (these SSDs have a limited number of write-cycles before they start to fail).
Any recommendations on how I can do this?
Jon
- 06-10-2010 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
By solid state drive do you mean one with a hard drive form factor and controller electronics? Or do you mean something like flash memory (SD card or USB drive)?
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 06-10-2010 #3Just Joined!
- Join Date
- Jun 2010
- Posts
- 14
I mean one that uses a hard drive form factor with a controller.By solid state drive do you mean one with a hard drive form factor and controller electronics? Or do you mean something like flash memory (SD card or USB drive)?
For example, the Intel X25-M, 160GB drive with a SATA interface.
Basically, you can consider the drive as a regular hard disk from a functional point of view, except I need to minimize the number of writes done to it.
- 06-10-2010 #4
The system files are pretty static. Most writes happen in /tmp, /var/ and /home.
Can't tell an OS by it's GUI
- 06-10-2010 #5Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
You can mount or remount most any file system as read-only, though as Freston mentioned some such as /var and /tmp as well as the swap partition/file must be writeable. Those you could put on rotating media if you like - they don't have to be on the same physical device as the rest of the OS. Then, when you need to update/upgrade/patch the OS or change configurations you can temporarily remount the needed volume as read-write.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 06-10-2010 #6Just Joined!
- Join Date
- Jun 2010
- Posts
- 14
Thanks for your help so far guys. That's basically what I want to do but i'm having some trouble with the implementation.
I've tried changing fstab to make the directories / and /home as read only, but this cause my system to hang at boot and I had to reinstall Red Hat.
Any other ways of doing this?
- 06-10-2010 #7Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
1. You cannot make / read-only. It can be in a ram disc if necessary, but it has to be writable. Ditto /tmp and /var.
2. /home is for user directories and should probably be on rotating media since it is likely to need to be read-write anyway.
Look at how live CD/DVD/USB system images are configured for more information on how you might do this. In any case, it is likely you will need a custom system installation and not just some simple configuration tweaks to do what you want. Also, you don't need to do a reinstall to fix things like the fstab issue. You can boot from a live CD/DVD/USB drive and manually mount and fix the file in question, then simply reboot to get back to operation.
One (or two) final bit(s) of advice. Start the system normally, configured as you want it, but without the read-only bits enabled. Then, look at what files are opened for write by the OS and normal applications, servers, daemons. That will tell you which bits need to be on read-write media and you can take measures to ensure that they are. Finally, plan this out and learn as much as you can about the system operation and understand the nuances of what you want to accomplish first, then plan the changes to be done in stages. You will save time, have a more stable system, and be happier with the results.Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 06-10-2010 #8You give excellent advice Rubberman! But as to the above, I have the thought that jon_p doesn't so much want a read-only filesystem as that he wants to preserve his disk (due to limited write capability).
Originally Posted by Rubberman
I think he's not so much at risk because the system files are pretty static.
But do you know, now we're on the subject
, if for example an update or an edit of a file causes an overwrite, or is a new file created ( a newwrite so to speak) and the old one 'forgotten' (but the bits are still in place).
For example, I edit /etc/profile a thousand times. Does that wear out that portion of the disk, or do I have a thousand profiles somewhere on the disk, but only one is actively represented in the filesystem?Can't tell an OS by it's GUI
- 06-10-2010 #9Just Joined!
- Join Date
- Jun 2010
- Posts
- 14
Depends entirely on the drive and it's controller. With the more modern SSDs that use wear-leveling algorithms, the short answer is no; new data is placed in physically different locations but to the OS this remains under a layer of abstraction.
How would I do this? Sorry, I know my hardware but Linux is new to me.Then, look at what files are opened for write by the OS and normal applications, servers, daemons.
- 06-10-2010 #10Just Joined!
- Join Date
- Jun 2010
- Posts
- 14
Alternatively, turning my existing system image into an .iso and booting from that would be great. This way, after I boot everything would be running off RAM and (ideally) nothing would get written to the disk.
Again, I'm not sure how to do any of this. Could someone point me to the right place?


Reply With Quote
