HPlogo HP-UX Reference Volume 2 of 5 > m

mount_nfs(1M)

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

NAME

mount(nfs), umount(nfs) — mount and unmount an NFS file systems

SYNOPSIS

/usr/sbin/mount [-l] [-p|-v]

/usr/sbin/mount -a [-F nfs] [-eQ]

/usr/sbin/mount [-F nfs] [-eQrV] [-o specific_options] {host:path|directory}

/usr/sbin/mount [-F nfs] [-eQrV] [-o specific_options] host:path directory

/usr/sbin/umount -a [-F nfs] [-h host] [-v]

/usr/sbin/umount [-v] [-V] {host:path|directory}

DESCRIPTION

The mount command mounts file systems. Only a superuser can mount file systems. Other users can use mount to list mounted file systems.

The mount command attaches host:path to directory. host is a remote system, path is a directory on this remote system and directory is a directory on the local file tree. directory must already exist, be given as an absolute path name and will become the name of the root of the newly mounted file system. If either host:path or directory is omitted, mount attempts to determine the missing value from an entry in the /etc/fstab file. mount can be invoked on any removable file system, except /.

If mount is invoked without any arguments, it lists all of the mounted file systems from the file system mount table, /etc/mnttab. The umount command unmounts mounted file systems. Only a superuser can unmount file systems.

OPTIONS

-r

Mount the specified file system read-only.

-o specific_options

Set file system specific options according to a comma-separated list chosen from words below.

rw|ro

resource is mounted read-write or read-only. The default is rw.

suid|nosuid

Setuid execution allowed or disallowed. The default is suid.

remount

If a file system is mounted read-only, remounts the file system read-write.

bg|fg

If the first attempt fails, retry in the background, or, in the foreground. The default is fg.

quota

Enables quota(1M) to check whether the user is over quota on this file system; if the file system has quotas enabled on the server, quotas will still be checked for operations on this file system. The default is quota.

noquota

Prevent quota(1M) from checking whether the user exceeded the quota on this file system; if the file system has quotas enabled on the server, quotas will still be checked for operations on this file system.

retry=n

The number of times to retry the mount operation. The default is 1.

vers=<NFS version number>

By default, the version of NFS protocol used between the client and the server is the highest one available on both systems. If the NFS server does not support NFS Version 3, then the NFS mount will use NFS Version 2 .

port=n

Set server UDP port number to n (the default is the port customarily used for NFS servers).

grpid

By default, the GID associated with a newly created file will obey the System V semantics; that is, the GID is set to the effective GID of the calling process. This behavior may be overridden on a per-directory basis by setting the set-GID bit of the parent directory; in this case, the GID of a newly created file is set to the GID of the parent directory (see open(2) and mkdir(2)). Files created on file systems that are mounted with the grpid option will obey BSD semantics independent of whether the set-GID bit of the parent directory is set; that is, the GID is unconditionally inherited from that of the parent directory.

rsize=n

Set the read buffer size to n bytes. The default value is set by kernel.

wsize=n

Set the write buffer size to n bytes. The default value is set by kernel.

timeo=n

Set the NFS timeout to n tenths of a second. The default value is set by kernel.

retrans=n

Set the number of NFS retransmissions to n. The default value is 5.

soft|hard

Return an error if the server does not respond, or continue the retry request until the server responds. The default value is hard.

intr|nointr

Allow (do not allow) keyboard interrupts to kill a process that is hung while waiting for a response on a hard-mounted file system. The default is intr.

noac

Suppress attribute caching.

nocto

Suppress fresh attributes when opening a file.

devs|nodevs

Allow (do not allow) access to local devices. The default is devs.

acdirmax=n

Hold cached attributes for no more than n seconds after directory update. The default value is 60.

acdirmin=n

Hold cached attributes for at least n seconds after directory update. The default value is 30.

acregmax=n

Hold cached attributes for no more than n seconds after file modification. The default value is 60.

acregmin=n

Hold cached attributes for at least n seconds after file modification. The default value is 3.

actimeo=n

Set min and max times for regular files and directories to n seconds. actimeo has no default; it sets acregmin, acregmax, acdirmin, and acdirmax to the value specified.

-O

Overlay mount. Allow the file system to be mounted over an existing mount point, making the underlying file system inaccessible. If a mount is attempted on a pre-existing mount point without setting this flag, the mount will fail, producing the error devicebusy.

Options (umount)

umount recognizes the following options:

-a

Attempt to unmount all file systems described in /etc/mnttab. All optional fields in /etc/mnttab must be included and supported. If -F nfs option is specified, all NFS file systems in /etc/mnttab are unmounted. File systems are not necessarily unmounted in the order listed in /etc/mnttab.

-F nfs

Specify the NFS file system type (see fstyp(1M)).

-h host

Unmount only those file systems listed in /etc/mnttab that are remote-mounted from host.

-v

Verbose mode. Write a message to standard output indicating which file system is being unmounted.

-V

Echo the completed command line, but performs no other action. The command line is generated by incorporating the user-specified options and other information derived from /etc/fstab. This option allows the user to verify the command line.

NFS File Systems

Background vs. Foreground

File systems mounted with the bg option indicate that mount is to retry in the background if the server's mount daemon (mountd(1M)) does not respond. mount retries the request up to the count specified in the retry=n option. Once the file system is mounted, each NFS request made in the kernel waits timeo=n tenths of a second for a response. If no response arrives, the time-out is multiplied by 2 and the request is retransmitted. When the number of retransmissions has reached the number specified in the retrans=n option, a file system mounted with the soft option returns an error on the request; one mounted with the hard option prints a warning message and continues to retry the request.

Hard vs. Soft

File systems that are mounted read-write or that contain executable files should always be mounted with the hard option. Applications using soft mounted file systems may incur unexpected I/O errors.

To improve NFS read performance, files and file attributes are cached. File modification times get updated whenever a write occurs. However, file access times may be temporarily out-of-date until the cache gets refreshed. The attribute cache retains file attributes on the client. Attributes for a file are assigned a time to be flushed. If the file is modified before the flush time, then the flush time is extended by the time since the last modification (under the assumption that files that changed recently are likely to change soon). There is a minimum and maximum flush time extension for regular files and for directories. Setting actimeo=n sets flush time to n seconds for both regular files and directories.

EXAMPLES

To mount an NFS file system:

example# mount serv:/usr/src /usr/src

To mount an NFS file system readonly with no suid privileges:

example# mount -r -o nosuid serv:/usr/src /usr/src

To mount an NFS file system over Version 3:

example# mount -o vers=3 serv:/usr/src /usr/src

FILES

/etc/mnttab

table of mounted file systems.

/etc/fstab

list of default parameters for each file system.

STANDARDS COMPLIANCE

mount: SVID3

umount: SVID3

© Hewlett-Packard Development Company, L.P.