mount [ option ... ] source target [ spec ]
unmount [ source ] target
For bind, source is the name of an existing file or directory in the current name space. After a successful bind, the file name target is an alias for the object originally named by source; if the modification doesn't hide it, source will also still refer to its original file. The evaluation of source (see sys-intro(2)) happens at the time of the bind, not when the binding is later used.
Both source and target files must be of the same type: either both directories or both files.
For mount, source can be a shell command, a network address, or a file name. If source is surrounded by brace characters ({ and }), it is invoked as a sh(1) command and its standard input is mounted (no authentication takes place in this case). If source contains an exclamation mark (!), or there is no file of that name, it is assumed to be a network address for a machine acting as a file server. This argument should then conform to the conventions described in dial(2). Otherwise source should be the name of a file that when opened gives a connection to a file server, something serving the 9P protocol described in intro(5), formerly called `Styx'. The optional spec argument to mount is passed in the attach(5) message and selects amongst different file trees offered by the server.
The effects of bind and mount can be undone by unmount. If two arguments are given to unmount, the effect is to undo a bind or mount with the same arguments. If only one argument is given, everything bound to or mounted on target is unmounted.
By default, bind and mount replace the target file by the new one, source. Henceforth, an evaluation of the pathname target will be translated to the new file. If they are directories (for mount, this condition is true by definition), target becomes a union directory consisting of one directory (the source directory).
A union directory unites the contents of the source and target directories. If the same name appears in both directories, the name used is the one in the directory that is bound before the other. In particular, if the directories have subdirectories of the same name, only the contents of the subdirectory in the top directory will be seen. If the subdirectory contents are themselves to be united, that must be done first in a separate bind or mount.
Note that the # character in the name of a kernel device must be quoted when used in a bind or unmount command, or the shell will take it as the start of a comment.
Options control aspects of the modification to the name space:
BIND(1 ) | Rev: Tue Mar 31 02:42:38 GMT 2015 |