nullfs(5)
can be used to duplicate a subtree of a filesystem name space under another part of the filesystem name space.
To use nullfs
in FreeBSD use the corresponding option with the mount
command:
mount -t nullfs <source_folder> <destination_folder>
Use nullfs
with fstab
To create nullfs
mounts with fstab
directly during boot the following line can be added to /etc/fstab
:
# Device Mountpoint FStype Options Dump Pass#
<source_folder> <destination_folder> nullfs rw,late 0 0
The option late
is mandatory here to mount the nullfs
filesystem after all upstream mounts are finished.
Important option
late
The option
late
infstab
is important and in most cases mandatory when mounting anullfs
filesystem, since it will mount folders that are relying on other filesystem mounts defined viafstab
. The dependentnullfs
mounts therefore need to be mounted late. Otherwise they will not be available and throw an error.