# How to mount-umount nullfs [-ro] at the command-line?



## max21 (Jan 11, 2018)

Inside fstab.jail this will allow read-only permission

```
/usr/src       /myjails/Database1/usr/src   nullfs  ro  0   0
```
At the command-line this works for read/write permission . . .

```
mount_nullfs -o /dev/ada0s1f /usr/src /myjails/Database1/usr/src
```
but it don’t work for read-only permission …

```
mount_nullfs -ro /dev/ada0s1f /usr/src /myjails/Database1/usr/src
```
What is the sequence that can be used to mount and umount a directory with read-only permission at the command-line, or is it even possible?
.


----------



## Snurg (Jan 11, 2018)

Hi Max, I haven't checked it myself, but -o is for options.
I guess there is insufficient argument checking for illegal options, else it would complain at your second example.
So I believe the correct way would be to write it like

`mount -t nullfs -o ro /usr/src /myjails/Database1/usr/src`
or
`mount_nullfs -o ro /usr/src /myjails/Database1/usr/src`


----------



## max21 (Jan 11, 2018)

They both work 

Thanks Snurg


----------



## SirDice (Jan 11, 2018)

The option is either -r or -o ro. 


```
-r      The file system is to be mounted read-only.  Mount the file sys-
             tem read-only (even the super-user may not write it).  The same
             as the ro argument to the -o option.
```


```
ro      The same as -r; mount the file system read-only (even the
                     super-user may not write it).
```
See mount(8).


----------

