The
mount_null command creates a null layer, duplicating a sub-tree of the file system name space under another part of the global file system namespace. This allows existing files and directories to be accessed using a different pathname.
The primary differences between a virtual copy of the filesystem and a symbolic link are that
getcwd(3) functions correctly in the virtual copy, and that other filesystems may be mounted on the virtual copy without affecting the original. A different device number for the virtual copy is returned by
stat(2), but in other respects it is indistinguishable from the original.
The
mount_null filesystem differs from a traditional loopback file system in two respects: it is implemented using a stackable layers technique, and its “null-nodes” stack above all lower-layer vnodes (not just above directory vnodes).
Both
target and
mount-point are converted to absolute paths before use.
The options are as follows:
-o
Options are specified with a
-o flag followed by a comma separated string of options. See the
mount(8) man page for possible options and their meanings.
The null layer has two purposes. First, it serves as a demonstration of layering by providing a layer which does nothing. Second, the null layer can serve as a prototype layer. Since it provides all necessary layer framework, new file system layers can be created very easily by starting with a null layer.
The remainder of this man page examines the null layer as a basis for constructing new layers.