Page MenuHomeFreeBSD

Add -media autofs map.

Authored by trasz on Nov 22 2014, 5:13 PM.


Group Reviewers
Doc Committers

This adds -media autofs map. It's supposed to be used with removable
media. Note that there is a known deficiency in that it never removes
obsolete nodes; it will be addressed later.

Diff Detail

rS FreeBSD src repository
No Linters Available
No Unit Test Coverage

Event Timeline

trasz updated this revision to Diff 2511.Nov 22 2014, 5:13 PM
trasz retitled this revision from to Add -media autofs map..
trasz updated this object.
trasz edited the test plan for this revision. (Show Details)
wblock added a subscriber: wblock.Nov 24 2014, 1:10 AM
wblock added inline comments.

This and the next two notes reword the entries in this list to avoid the passive and repeated "This map" and nonspecific "It".

Query the remote NFS server and map exported volumes, which are traditionally mounted on
.Pa /net .
Files on a remote NFS server are typically accessed through the
.Pa /net/nfs-server-ip/share-name/
directory without needing any additional configuration.


.It Li -media
Query devices that are not yet mounted, but contain valid filesystems.
Generally used for access to files on removable media.


.Xr automountd 8
from mounting anything on the mountpoint.

trasz added inline comments.Nov 30 2014, 11:26 AM

Hm, but it's not the volumes that are mounted on /net, it's the map - volumes are somewhere underneath it. What do you think about the updated patch?

trasz updated this revision to Diff 2578.Nov 30 2014, 11:26 AM


trasz updated this revision to Diff 2579.Nov 30 2014, 11:27 AM

Update; arc is stupid.

wblock added inline comments.Dec 1 2014, 4:33 PM

Phabricator might not be showing the actual diff, so bear with me. I see

This map is traditionally mounted on
.Pa /net ,

Does "traditionally" mean "by default", or "what most people do"? I suspect it is the first, so this can be split out of the too-long following sentence:

By default, this map is mounted on
.Pa /net .
Access to files on a remote NFS server is provided through the
.Pa /net/nfs-server-ip/share-name/
directory without any additional configuration.

nfs-server-ip and share-name need markup to show they are not literal, although I have not yet found out what to use.

emaste added inline comments.Dec 1 2014, 4:44 PM

It's not commented in the version in this review though?


Ugh. I'd make the comment a bit stronger with an XXX as you did below - e.g.

XXX this should use kern.geom.conftxt, but it lacks access counts.

Looking for hexagon in the dot output makes me feel really icky.

That said, you could simplify slightly with

sysctl ... | sed -n 's/^.*hexagon,label=/../p'

i.e. -n and /p modifier


can you expand on the comment

trasz added inline comments.Dec 6 2014, 9:24 AM

"Traditionally" here means "what our ancestors used to do". It's not mounted anywhere by default - it's commented out - but by removing a single "#" you can mount it where it used to be on Solaris and most other UNIX systems. And OS X.

trasz updated this revision to Diff 2658.Dec 6 2014, 9:25 AM

Rewrite to use fstyp(8).

wblock added inline comments.Dec 6 2014, 2:13 PM

Double "the".

trasz updated this revision to Diff 2663.Dec 6 2014, 5:01 PM

Fix double "the".

wblock added a comment.Dec 7 2014, 3:54 PM

The doc changes look good to me. I still would prefer that nfs-server-ip and share-name are shown as non-literal values. The only way I know to do that would be rewriting that section to split up the path as shown below. Is it worth that? I'm not sure.

Access to files on a remote NFS server is provided through the
.Pa /net
Inside that directory are subdirectories for each NFS server IP address (WB: or host name?)
and the exported directories.
For example, files in the
.Pa artwork
directory on the NFS server at will appear in the
.Pa /net/
directory without any additional configuration.

wblock added inline comments.Dec 17 2014, 3:31 AM

Courtesy of Ingo Schwarze:

.Pf /net/ Ar nfs-server-ip Ns / Ns Ar share-name Ns /

That shows the full path, but makes it more obvious that nfs-server-ip and share-name are not literal values.

remko added a subscriber: remko.Jan 3 2015, 7:25 AM

Next to Warren's comments this looks OK to me..

trasz added a comment.Jan 6 2015, 6:02 PM

This was committed some time ago; the last missing nit from wblock@ is included in a new review at; how do I close this one?

bcr added a subscriber: bcr.Jan 6 2015, 9:17 PM

Quoting :

Do this by scrolling down to the bottom of the review page, select the Close option from the Action dropdown menu just above the Comment field, and click Submit. The Close option will not be visible unless the review is in the Approved state.

You can close a revision (in any state) from the command line with the following:

arc close-revision DXXX

trasz abandoned this revision.Jan 13 2015, 10:22 AM

Committed some time ago; can't close because it's not quite approved.