# Read-only



## mlord (Feb 8, 2011)

How to mount the file system as read only?
Does it affect the programs?

thanx


----------



## ian-nai (Feb 8, 2011)

Pass the option "ro" to mount.  Programs will only complain if they try to write to the disk.  Otherwise, there should be no problem.

In a terminal:
[CMD=""]mount -o ro /mnt/cdrom[/CMD]

Would mount a cd at /mnt/cdrom as read-only.  Of course, you would need an entry like the following in /etc/fstab:


```
/dev/{cdrom device}  /mnt/cdrom  iso9660,noauto  ro   0   0
```


----------



## mlord (Feb 8, 2011)

thanx
does this apply for mounting the file system on the hard disk?
and how to do this in booting?

my point is to make crashes as minimum as possible and to prevent any program from damaging the system


----------



## Beastie (Feb 8, 2011)

mlord said:
			
		

> does this apply for mounting the file system on the hard disk?


Yes.



			
				mlord said:
			
		

> and how to do this in booting?


Same way as with any other media: by adding *ro* to the "options" column of the appropriate entry in /etc/fstab.



			
				mlord said:
			
		

> my point is to make crashes as minimum as possible


You are confusing the cause and the effect. Mounting partitions read-only will not affect the frequency of crashes. It will only prevent the partitions from being uncleanly unmounted. First solve the problem that causes the crashes.


----------



## mlord (Mar 12, 2011)

Beastie said:
			
		

> You are confusing the cause and the effect. Mounting partitions read-only will not affect the frequency of crashes. It will only prevent the partitions from being uncleanly unmounted. First solve the problem that causes the crashes.



Actually what I need to do is to minimize the crashes of the system and make it as low as possible, that's why I thought mounting the file system as a read-only may solve this problem.


----------

