MOUNT(8,C) AIX Commands Reference MOUNT(8,C) ------------------------------------------------------------------------------- mount PURPOSE Makes a file system available for use. SYNTAX +--------+ mount ---| +----+ |---| +-| -L |-+ ^| -v || |+----+| +------+ +----------------+ +------- directory --------+ +-| +------------+ |---| |-+ | +-| -r |-+ +--- device --- directory -+ | +--------+ | ^| -s || | +----+ | mount ---| +----+ |---| || -o options || +- host:NFSdir -+ |---| +-| -v |-+ | |+------------+| | ^| -f || | +--------------+ | |+----+| | +---------+ | +------+ | | -a | | +-| all |---------------------------------------+ | -t type | +---------+ DESCRIPTION The mount command instructs the operating system to make a file system available for use. In addition, you can use mount to build other file trees made up of directory and file mounts. The mount command mounts the specified device on the specified directory and records its availability in /etc/mtab. After mount has finished, directory becomes the root of the newly mounted file system. You can also use host:NFSdir to mount a NFSdir from the indicated host using the network fileserver. Members of the system group can do any mount described in the /etc/filesystems file (mount directory). Users operating as superuser can issue any mount command. If you enter the mount command without arguments, it writes to standard output all the mounted file systems (except those mounted with the -s flag), and whether they are read-only. Processed April 9, 1992 MOUNT(8,C) 1 MOUNT(8,C) AIX Commands Reference MOUNT(8,C) The environment variables LANG and LC_TIME control the appearance of the modification date and time when the -v option is specified with the first form of the command. If the Transparent Computing Facility is installed, the use of the mount command lists the file systems mounted on any site in the cluster. Use the -L flag to see only the file systems mounted on the local site. If you specify only a directory name, mount takes it to be the name of the directory on which a file system is usually mounted (as defined in the /etc/filesystems file). mount looks up the associated device and mounts it. This is the most convenient way of using the mount command, as it does not require you to remember what is normally mounted on a directory. The /etc/filesystems file should include a stanza for each mountable file system. This stanza should specify at least the name of the file system and the device on which it resides. If the stanza includes a mount attribute, the mount command uses the associated values. It recognizes three values in the mount attribute: true, false, and read/only (see the filesystems file in AIX Operating System Technical Reference for a description of these mount attributes). The command mount all causes all file systems with the attribute mount=true to be mounted in their normal places. This command is typically used during system initialization. If you are operating with superuser authority, you can mount a file system arbitrarily by naming both a device and a directory on the command line. mount takes device to be the name of the block device special file and directory to be the directory on which it should mount the file system. The mount and umount programs maintain the mount table in /etc/mtab as accurately as possible. However, some events can invalidate this mount table. (The system itself has an internal mount table that it maintains independently.) Several programs and library routines use /etc/mtab to determine the fully qualified name of the current directory. If /etc/mtab does not properly reflect the state of all mounted file systems, these programs may stop working. Using the -s flag, deleting /etc/mtab, or truncating it after file systems have been mounted will almost surely invalidate its contents. If TCF is installed, only devices on the local site may be mounted. Once mounted, a file system appears to be mounted to all processes on each site within the cluster. Similarly, a file system mounted from a network file server (NFS), appears to be mounted through the cluster. If a file system has been designated as a replicated file system, multiple copies of the file system may be mounted at the same time. Each mounted copy must be mounted from a different site within the cluster and must be mounted over the same directory. As long as one copy of a file system is mounted, files in that file system may be accessed. If the file system copy which has been designated as the primary is one of the mounted file system copies, files within the file system may be modified. Processed April 9, 1992 MOUNT(8,C) 2 MOUNT(8,C) AIX Commands Reference MOUNT(8,C) FLAGS -r Mounts a file system as a read-only file system, regardless of the specification in /etc/filesystems. This is similar to: mount -o ro directory or mount -o ro device directory -s Does not record the availability of the new file system in /etc/mtab. This allows a file systems to be mounted on a read-only root where /etc/mtab would not be writable. As several programs and library routines depend on /etc/mtab, use this flag with caution. -t type Mounts all stanzas in /etc/filesystems that contain type = type and are not mounted. (type is a string value, such as "remote.") -a Mounts all file systems in /etc/filesystems. Has the same effect as mount all. -f Add all entries to /mtab and do no actual mounts. -L Displays information for the local site only. -v Verbose; mount displays a message indicating the file system being mounted. May be used when listing mount table to include the date the file system was mounted. In addition, the -v flag forces large fields to be displayed in their entirety. Without the -v flag, fields that would not otherwise fit in the columns of the tabular output are shortened to fit. -o options Used to specify options, a list of comma-separated words from the list below. Some options are valid for all file system types, while others apply to a specific type only. Options valid on all file systems (the default is rw,suid): rw Read-write ro Read-only suid Set-uid execution allowed nosuid Set-uid execution not allowed Options specific to AIX file systems (the default is noquota): quota Usage limits enforced noquota Usage limits not enforced The options specific to nfs (NFS) file systems (the defaults are: fg,retry=1,timeo=7,retrans=3,port=NFS_PORT,hard Processed April 9, 1992 MOUNT(8,C) 3 MOUNT(8,C) AIX Commands Reference MOUNT(8,C) with defaults for rsize and wsize set by the kernel): bg if the first mount attempt fails, retry in the background. fg retry in foreground. retry=n set number times to retry mount to n. rsize=n set read buffer size to n bytes. wsize=n set write buffer size to n bytes. timeo=n set NFS timeout to n tenths of a second. retrans=n set number of NFS retransmissions to n. port=n set server IP port number to n. soft return error if server doesn't respond. hard retry request until server responds. intr allow keyboard interrupts on hard mounts. syncw allow synchronous write operations. The bg option causes mount to run in the background if the server's mountd(8) does not respond. mount attempts each request retry=n times before giving up. Once the filesystem 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 retrans=n retransmissions have been sent with no reply a soft mounted filesystem returns an error on the request and a hard mounted filesystem prints a message and retries the request. Filesystems that are mounted read-write should use the hard option. The intr option allows keyboard interrupts to kill a process that is hung waiting for a response on a hard mounted filesystem. The number of bytes in a read or write request can be set with the rsize and wsize options. The syncw option allows all the write operations from the client to be synchronous. EXAMPLES 1. To list the file systems that are mounted: mount sitename mounted mounted over options Gfs# pck tuna /dev/chd0035 / rw 1 1 PRI tuna /dev/chd0034 /tuna rw 3 1 tuna /dev/chd00033 /ul rw 2 1 tuna snap:/source /source intr,bg 100 1 NFS cod /dev/fhd00035 / rw 1 3 BAC cod /dev/fhd00034 /cod rw 4 1 pogy /dev/hd3 / rw 1 4 SEC pogy /dev/hd2 /pogy rw 7 1 pogy /dev/hd1 /pogy/tmp rw 6 1 For each file system, mount lists the site name, device name, directory which is mounted over, options, global file system number, and file system pack number. For replicated file systems, the last column indicates PRI Processed April 9, 1992 MOUNT(8,C) 4 MOUNT(8,C) AIX Commands Reference MOUNT(8,C) (primary copy), BAC (backbone copy), or SEC (secondary copy). The last column also indicates NFS file systems. 2. To list the file systems that are mounted including the date mounted: mount -v sitename mounted mounted over options date Gfs# pck tuna /dev/chd0035 / rw Jan 20 16:53 1 1 PRI tuna /dev/chd0034 /tuna rw Jan 20 16:53 3 1 tuna /dev/chd00033 /ul rw Jan 20 16:55 2 1 tuna snap:/source /source intr,bg Jan 20 16:58 100 1 NFS cod /dev/fhd00035 / rw Jan 20 19:27 1 3 BAC cod /dev/fhd00034 /cod rw Jan 20 19:27 4 1 pogy /dev/hd3 / rw Jan 22 11:15 1 4 SEC pogy /dev/hd2 /pogy rw Jan 22 11:15 7 1 pogy /dev/hd1 /pogy/tmp rw Jan 22 11:15 6 1 3. To list the file systems mounted on the local site: mount -L mounted mounted over options Gfs# pck /dev/chd0035 / rw 1 1 PRI /dev/chd0034 /tuna rw 3 1 /dev/chd00033 /ul rw 2 1 snap:/source /source intr,bg 100 1 NFS 4. To list the file systems mounted on the local site including date mounted: mount -Lv mounted mounted over options date Gfs# pck /dev/chd0035 / rw Jan 20 16:53 1 1 PRI /dev/chd0034 /tuna rw Jan 20 16:53 3 1 /dev/chd00033 /ul rw Jan 20 16:55 2 1 snap:/source /source intr,bg Jan 20 16:58 100 1 NFS 5. To mount a diskette: mount /dev/fd0 /diskette0 This mounts a diskette ("/dev/fd0") onto the directory "/diskette0". A file system must already exist on the diskette, and the directory "/diskette0" must already exist. To access a file on the diskette, use a path name that begins with "/diskette0". For example, to access "prog.c" use "/diskette0/prog.c". Warning: Be sure that the diskette is unmounted before you remove it from the drive, or you may lose some of your data. 6. To mount a write-protected diskette: Processed April 9, 1992 MOUNT(8,C) 5 MOUNT(8,C) AIX Commands Reference MOUNT(8,C) mount -r /dev/fd0 /diskette0 This mounts the diskette on /diskette0 as a read-only, file system. This tells the operating system not to update file access times, which would cause errors with a write-protected diskette. 7. To mount a default file system: mount /diskette0 This mounts the device that is usually mounted on /diskette0, which is determined by information in the file /etc/filesystems. 8. To mount all default file systems: mount all This mounts all standard file systems in /etc/filesystems marked "mount = true". 9. To mount a file or directory from the /etc/filesystems file with a specific type: mount -t temp This mounts all files or directories in the /etc/filesystems file that have a stanza that contains the attribute "type = temp". FILES /etc/filesystems Descriptions of mountable file systems. /etc/mtab Record of mounted file systems. (Symbolic link to /mtab.) RELATED INFORMATION See the following command: "umount, unmount." See the mount and umount system calls and the filesystems and mtab files in AIX Operating System Technical Reference. See the "Introduction to International Character Support" in Managing the AIX Operating System. For NFS mount details, see "Managing the IBM AIX Network File System" in Managing the AIX Operating System. See Chapter 18 of the AIX Programming Tools and Interfaces for general information on using commands in an MBCS environment. Processed April 9, 1992 MOUNT(8,C) 6