Linux mounting HDD problem!!!!! Help!!!!
To every Big brother ! I need help for mounting the Hard Disk to read-only at initialization of Linux!
Looks like from man mount that the option you want is -r. You'll probably want to put this in your fstab... details of which are available by checking man fstab.
Originally Posted by lhseong
If you want to mount something other than your root partition (or whatever else holds /var /tmp /usr/man etc) -- ie a drive that holds music mounted in /mnt/music or something -- then that can be done by puting 'ro' in the options column of fstab
However, going for a 100% read-only mount setup (or even just mounting the root partition ro) and then having your OS actually work is NOT a trivial task. It's not as simple as just mounting everything read only. The OS init scripts and most other programs end up requiring rw access somewhere in order to function. In general, you have to provide ramdisk or tmpfs for /tmp, /var (not all subdirectories but a lot), and reconfigure EVERYTHING to do minimal logging and never try to write data except on your tmpfs or ramdisk partitions. It's a LOT of work. If you have booted knoppix, they have a similar challenge since they are running with a read-only medium.
There are mini-distros out there designed to with mounting drives read-only in mind. Most are based on Debian due to Debian's policy on "where files belong" being pretty strict. I'm sorry I don't know any off the top of my head but doing some googling should lead you to them..
MY CAR IS FOR SALE!
See My Project Page for Details
- 2003 BMW E46 ///M3
Custom Dash Monitor Housing - OEM Fitment
Custom Overhead DVD-ROM Housing in Headliner
BMW I-Bus Integration
My homepage with many other fun projects!