mount(ADM) 19 June 1992 mount(ADM) Name mount - mount and unmount a file structure Syntax /etc/mount [ -v ] [ -r ] [ -f fstyp ] special-device directory /etc/umount special-device Description mount announces to the system that a removable file structure is present on special-device. The file structure is mounted on directory. The directory must already exist; it becomes the name of the root of the newly mounted file structure. directory should be empty. If directory contains files, they will appear to have been removed while the special- device is mounted and reappear when the special-device is unmounted. The mount and umount commands maintain a table of mounted devices. If mount is invoked without any arguments, it displays the name of each mounted device, and the directory on which it is mounted, whether the file structure is read-only, and the date it was mounted. The -f fstyp option indicates that fstyp is the type of filesystem to be mounted. If this argument is omitted, it defaults to the same filesystem type as the root directory. The optional -r argument indicates that the file is to be mounted read- only. Physically write-protected filesystems, such as floppy disks with write-protect tabs, must be mounted in this way or errors occur when access times are updated, whether or not any explicit write is attempted. The optional -v argument displays mount information verbosely. umount removes the removable filesystem on device special-device. Any pending I/O for the filesystem is completed and the file structure is marked as clean. Files /etc/mnttab Mount table /etc/default/filesys Filesystem data See also default(F), mnt(C), mount(S), mnttab(F), setmnt(ADM), umount(ADM) Diagnostics mount issues a warning if directory does not match the ``s_fname'' field in the superblock of the filesystem to be mounted. The first six charac- ters in the last component of directory are compared with the name in ``s_fname''. (For example, mounting a filesystem named spool on /usr/spool won't cause a warning message, but mounting the same file- system on /mnt will.) Busy filesystems cannot be dismounted with umount. A filesystem is busy if it contains an open file or some user's working directory. Notes Only the super user can use the mount command. Some degree of validation is done on the filesystem, however it is gen- erally unwise to mount corrupt filesystems. If the mount command is invoked without a target directory, but with a valid filesystem as an argument, mount attempts to mount the system on the directory named in its entry in /etc/default/filesys. For further in- formation, refer to filesys(F). Note that when the system is in single-user mode, the commands that look in /etc/mnttab for default arguments (for example df(C), ncheck(ADM), quot(C), mount, and umount) give either incorrect results (due to a cor- rupt mnttab(F) left over from a non-shutdown stoppage) or no results (due to an empty /etc/mnttab from a shutdown stoppage). When in multi-user mode, this is not a problem; the /etc/rc2 scripts ini- tialize /etc/mnttab to contain only /dev/root and subsequent mounts update it appropriately. The mount and umount commands use a lock file to guarantee exclusive access to /etc/mnttab. The other commands which read it (those mentioned above) do not, so it is possible that if they are invoked while a file system is being mounted or unmounted they will return incorrect values. This is not a problem in practice since mount and umount are not frequent operations. When mounting a filesystem on a floppy disk you need not use the same directory each time. However, if you do, the full pathnames for the files are consistent with each use. Always unmount filesystems on floppy disks before removing them from the floppy drive. Failure to do so requires running fsck(ADM) the next time the disk is mounted. The directory /etc/fscmd.d/TYPE contains programs for each filesystem type; mount or umount invoke the appropriate binary. Standards conformance mount is conformant with: AT&T SVID Issue 2; and X/Open Portability Guide, Issue 3, 1989.