VFSTAB(4) | File Formats | VFSTAB(4) |
The fields in the table are space-separated and show the resource name ( device to mount), the raw device to fsck (device to fsck), the default mount directory ( mount point), the name of the file system type ( FS type), the number used by fsck to decide whether to check the file system automatically ( fsck pass), whether the file system should be mounted automatically by mountall (mount at boot), and the file system mount options ( mount options). (See respective mount file system man page below in SEE ALSO for mount options.) A '-' is used to indicate no entry in a field. This may be used when a field does not apply to the resource being mounted.
The getvfsent(3C) family of routines is used to read and write to /etc/vfstab.
/etc/vfstab can be used to specify swap areas. An entry so specified, (which can be a file or a device), will automatically be added as a swap area by the /sbin/swapadd script when the system boots. To specify a swap area, the device-to-mount field contains the name of the swap file or device, the FS-type is "swap", mount-at-boot is "no" and all other fields have no entry.
Example 1 NFS and UFS Mounts
The following entry invokes NFS to automatically mount the directory /usr/local of the server example1 on the client's /usr/local directory with read-only permission:
The following example assumes a small departmental mail setup, in which clients mount /var/mail from a server mailsvr. The following entry would be listed in each client's vfstab:
The following is an example for a UFS file system in which logging is enabled:
See mount_nfs(1M) for a description of NFS mount options and mount_ufs(1M) for a description of UFS options.
Example 2 pcfs Mounts
The following example mounts a pcfs file system on a fixed hard disk on an x86 machine:
The example below mounts a Jaz drive on a SPARC machine. Normally, the volume management software handles mounting of removable media, obviating a vfstab entry. Specifying a device that supports removable media in vfstab with set the mount-at-boot field to no (as shown below) disables the automatic handling of that device. Such an entry presumes you are not running volume management software.
For removable media on a SPARC machine, the convention for the slice portion of the disk identifier is to specify s2, which stands for the entire medium.
For pcfs file systems on x86 machines, note that the disk identifier uses a p (p0) and a logical drive (c, in the /win98 example above) for a pcfs logical drive. See mount_pcfs(1M) for syntax for pcfs logical drives and for pcfs-specific mount options.
Example 3 Loopback File System Mount
The following is an example of mounting a loopback (lofs) file system:
See lofs(7FS) for an overview of the loopback file system.
System Administration Guide: Basic Administration
September 8, 2015 |