Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > F

fstab(4)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

fstab — static information about the file systems

SYNOPSIS

#include <fstab.h>

DESCRIPTION

fstab is an ASCII file that resides in directory /etc.

/etc/fstab contains a list of mountable file-system entries. Each file-system entry appears on a separate line, and consists of fields separated by one or more blanks or tabs.

The order of entries in /etc/fstab is important only for entries without a pass number field. Entries without a pass number are sequentially checked by fsck (see fsck(1M)) after the entries with a pass number have been checked.

Each file-system entry must contain a device special file and may additionally contain all of the following fields, in the following order:

  • directory

  • type

  • options

  • backup frequency

  • pass number (on parallel fsck)

  • comment

If any field after the name of the device special file is present, all fields must be present in the order indicated, to ensure correct place-holding.

Entries from this file are accessed using getmntent() (see getmntent(3X)).

The fields are separated by white space, and a # as the first non-whitespace character in an entry or field indicates a comment.

device special file

A block device special file name. This field is used by fsck, mount, swapon, crashconf, and other commands to identify the location of the storage device on which the file system resides.

directory

Name of the root of the mounted file system that corresponds to the device special file. If type is swapfs, directory can be the name of any directory within a file system. Only one directory should be specified per file system. directory must already exist and must be given as an absolute path name.

type

Can be swap, swapfs, dump, ignore, or a file system type (for example, hfs, vxfs, cdfs, nfs, or lofs).

If type is swap, the device special file is made available as an area of swap space by the swapon command (see swapon(1M)). The options field is valid. The fields directory, pass number, and backup frequency are ignored for swap entries.

If type is swapfs, the file system in which directory resides is made available as swap space by swapon. The options field is valid. The fields device special file, pass number, and backup frequency are ignored for swapfs entries.

If type is dump, the device special file is made available as an area into which a system crash dump may occur, by the crashconf command (see crashconf(1M)). The fields options, directory, pass number, and backup frequency are ignored for dump entries.

Entries marked by the type ignore are ignored by all commands and can be used to mark unused sections. If type is specified as either ignore, dump, swap, or swapfs, the entry is ignored by the mount and fsck commands (see mount(1M) and fsck(1M)). fsck also ignores entries with type specified as cdfs, nfs, or lofs.

options

A comma-separated list of option keywords, as found in mount or swapon (see mount(1M) and swapon(1M)). The keywords used depend on the parameter specified in type.

backup frequency

Reserved for possible use by future backup utilities.

pass number

Used by the fsck command to determine the order in which file system checks are done. The root file system should be specified with a pass number of 1, to be checked first, and other file systems should have larger numbers. (A file system with a pass number of zero is ignored by the fsck command.)

File systems within a drive should be assigned different pass numbers, but file systems on different drives can be checked on the same pass, to utilize possible parallelism available in the hardware. If pass number is not present, fsck checks each such file system sequentially after all eligible file systems with pass numbers have been checked.

comment

An optional field that begins with a # character and ends with a new-line character. Space from the pass number to the comment field (if present) or to the new-line is reserved for future use.

There is no limit to the number of device special file fields in /etc/fstab.

NETWORKING FEATURES

NFS

If the field type is nfs, a remote NFS file system is implied. For NFS file systems, the device special file should be the serving machine name followed by ":" followed by the path on the serving machine of the directory being served. The pass number and backup frequency fields are ignored for NFS entries.

EXAMPLES

Examples of typical /etc/fstab entries:

  • Add an HFS file system at /home using default mount options; (backup frequency 0) fsck pass 2:

    /dev/dsk/c0t6d0 /home hfs defaults 0 2 # /home disk

  • Add a swap device to a system managed using LVM, with default options (Note, the directory field (/) cannot be empty, even though it is ignored):

    /dev/vg01/lv10 / swap defaults 0 0 # swap device

  • Add a swap device on a system implementing whole-disk layout to use the space after the end of the file system (options =end):

    /dev/dsk/c0t5d0 / swap end 0 0 # swap at end of device

  • Add file system swap space on the file system containing directory /swap. type is swapfs; set options to min=10, lim=4500, res=100, and pri=0 (see swapon(1M)) for explanation of options). device field is ignored but must not be empty:

    default /swap swapfs min=10,lim=4500,res=100,pri=0 0 0

  • (Note that both a file system entry and a swap entry are required for devices providing both services.)

  • Use a device for dump space if the system crashes. directory field is ignored but must not be empty:

    /dev/dsk/c0t5d0 / dump defaults 0 0

  • (Note that both a swap entry and a dump entry are required for devices providing both services.)

WARNINGS

HP-UX system administration tools that provide file system mount management interfaces may read and/or write /etc/fstab. System administrators should be careful not to simultaneously modify this file with one of these tools.

DEPENDENCIES

NFS

Here is an example for mounting an NFS file system on systems that support NFS file systems:

server:/mnt /mnt nfs rw,hard 0 0 #mount from server.

AUTHOR

fstab was developed by HP, AT&T, Sun Microsystems, Inc., and the University of California, Berkeley.

FILES

/etc/fstab /usr/include/fstab.h

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.