• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

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

max21

Well-Known Member

Thanks: 19
Messages: 412

#1
Inside fstab.jail this will allow read-only permission
Code:
/usr/src       /myjails/Database1/usr/src   nullfs  ro  0   0
At the command-line this works for read/write permission . . .
Code:
mount_nullfs -o /dev/ada0s1f /usr/src /myjails/Database1/usr/src
but it don’t work for read-only permission …
Code:
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

Aspiring Daemon

Thanks: 326
Messages: 794

#2
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
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 6,127
Messages: 27,000

#4
The option is either -r or -o ro.

Code:
     -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.
Code:
             ro      The same as -r; mount the file system read-only (even the
                     super-user may not write it).
See mount(8).
 
Top