Become superuser.
Create the directory where you want to mount the LOFS file system and give it the appropriate permissions and ownership.
Create a LOFS file system.
To set up the system to automatically create a TMPFS file system when it boots, see "Example--Creating a LOFS File System at Boot Time".
# mount -F lofs loopback-directory mount-point |
loopback-directory |
Specifies the file system to be mounted on the loopback mount point. |
mount-point |
Specifies the directory on which to mount the LOFS file system. |
Look at the output from the mount command to verify that the LOFS file system has been created.
# mount -v |
The following example shows how to use a new LOFS file system with the chroot(1M) command to provide a complete virtual file system view of a process or family of processes.
# mkdir /tmp/newroot # mount -F lofs / /tmp/newroot # chroot /tmp/newroot command |
You can set up the system to automatically create a LOFS file system when it boots by adding an entry to the end of the /etc/vfstab file. The following example shows an entry in the /etc/vfstab file that will create a LOFS file system for the root (/) file system on /tmp/newroot.
/ - /tmp/newroot lofs - yes - |
Make sure the loopback entry is the last entry in the /etc/vfstab file. Otherwise, if the /etc/vfstab entry for the loopback file system precedes the file systems to be included in it, the loopback file system cannot be created.
For more information the /etc/vfstab file, see "/etc/vfstab Field Descriptions".