Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ umount(2) — OSF/1 SILVER Baselevel 4 rev36

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

mount(8)

mount(2)  —  System Calls

OSF  —  Environment_Note_Added

NAME

mount, umount − Mounts or unmounts a file system

SYNOPSIS

#include <sys/mount.h> mount(
int type,
char ∗dir,
int mnt_flag,
caddr_t data ); umount(
char ∗dir,
int umnt_flag );

PARAMETERS

typeDefines the type of the file system.  The types of file systems defined in the sys/mount.h header file are MOUNT_NONE, MOUNT_UFS, MOUNT_NFS, MOUNT_MFS, and MOUNT_S5FS. 

dirPoints to a null-terminated string containing the appropriate pathname. 

mnt_flagSpecifies whether certain semantics should be suppressed when accessing the file system.  Valid flags are:

M_RDONLY
The file system should be treated as read-only; no writing is allowed (even by a process with appropriate privilege). Physically write-protected and magnetic tape file systems must be mounted read-only or errors will occur when access times are updated, whether or not any explicit write is attempted.

M_NOEXEC
Do not allow files to be executed from the file system.

M_NOSUIDDo not honor setuid or setgid bits on files when executing them. 

M_NODEVDo not interpret special files on the file system. 

M_SYNCHRONOUS
All I/O to the file system should be done synchronously.

M_FMOUNT
Forcibly mount, even if the file system is unclean.

M_UPDATEThe mount command is being applied to an already mounted file system.  This allows the mount flags to be changed without requiring that the file system be umounted and remounted. 

Some file systems may not allow all flags to be changed. For example, most file systems do not allow a change from read-write to read-only.

dataPoints to a structure that contains the type-specific parameters to mount. 

umnt_flagSpecifies one of the following values:

MNT_NOFORCE or MNT_WAIT
The umount should fail if any files are active on the file system. 

MNT_FORCE or MNT_NOWAIT
The file system should be forcibly umounted even if files are still active. Active special devices continue to work, but any further accesses to any other active files result in errors even if the file system is later remounted. Support for forcible unmount is filesystem dependent.

DESCRIPTION

The mount() function mounts a file system on the directory pointed to by the dir parameter.  Following the mount, references to dir refer to the root directory on the newly mounted file system. 

The dir parameter must point to a directory that already exists.  Its old contents are inaccessible while the file system is mounted. 

The umount() function unmounts a file system mounted at the directory pointed to by the dir parameter.  The associated directory reverts to its ordinary interpretation. 

To call either the mount() or umount() function, the calling process must have superuser privilege. 

NOTES

Two mount() functions are supported by OSF/1: the BSD mount() and the System V mount().  The default mount() function is the BSD mount() documented on this reference page.  To use the System V version of mount(), you must link with the libsys5 library before you link with libc. 

RETURN VALUE

The mount() function returns 0 (zero) if the file system was successfully mounted.  Otherwise, −1 is returned.  The mount can fail if the dir parameter does not exist or is not a directory.  For a UFS or S5FS file system, the mount can fail if the special device specified in the ufs_args structure is inaccessible, is not an appropriate file, or is already mounted.  A UFS, MFS, or S5FS mount can also fail if there are already too many file systems mounted. 

The umount() function returns 0 (zero) if the file system was successfully unmounted.  Otherwise, −1 is returned.  The unmount will fail if there are active files in the mounted file system. 

ERRORS

If the mount() function fails, errno may be set to one of the following values:

[EPERM]The caller does not have appropriate privilege. 

[ENAMETOOLONG]
A component of a pathname exceeded NAME_MAX characters, or an entire pathname exceeded PATH_MAX characters.

[ELOOP]Too many symbolic links were encountered in translating a pathname. 

[ENOENT]A component of the dir parameter does not exist. 

[ENOTDIR]A component of the name parameter is not a directory, or a path prefix of the special parameter is not a directory. 

[EINVAL]A pathname contains a character with the high-order bit set. 

[EBUSY]Another process currently holds a reference to the dir parameter. 

[EDIRTY]The file system is not clean and M_FORCE is not set. 

[EFAULT]The dir parameter points outside the process’ allocated address space. 

The following errors can occur for a UFS or S5FS file system mount:

[ENODEV]A component of ufs_args fspec does not exist. 

[ENOTBLK]The fspec field is not a block device. 

[ENXIO]The major device number of fspec is out of range (this indicates no device driver exists for the associated hardware). 

[EBUSY]The device pointed to by the fspec field is already mounted. 

[EMFILE]No space remains in the mount table. 

[EINVAL]The super block for the file system had a bad magic number or an out of range block size. 

[ENOMEM]Not enough memory was available to read the cylinder group information for the file system. 

[EIO]An I/O error occurred while reading the super block or cylinder group information. 

[EFAULT]The fspec field points outside the process’ allocated address space. 

The following errors can occur for a NFS compatible file system mount:

[ETIMEDOUT]
NFS timed out trying to contact the server.

[EFAULT]Some part of the information described by nfs_args points outside the process’ allocated address space. 

The following errors can occur for a MFS file system mount:

[EMFILE]No space remains in the mount table. 

[EINVAL]The super block for the file system had a bad magic number or an out of range block size. 

[ENOMEM]Not enough memory was available to read the cylinder group information for the file system. 

[EIO]A paging error occurred while reading the super block or cylinder group information. 

[EFAULT]The name field points outside the process’ allocated address space. 

If the umount() function fails, errno may be set to one of the following values:

[EPERM]The caller does not have appropriate privilege. 

[ENOTDIR]A component of the path is not a directory. 

[EINVAL]The pathname contains a character with the high-order bit set. 

[ENAMETOOLONG]
A component of a pathname exceeded NAME_MAX characters, or an entire pathname exceeded PATH_MAX characters.

[ELOOP]Too many symbolic links were encountered in translating the pathname. 

[EINVAL]The requested directory is not in the mount table. 

[EBUSY]A process is holding a reference to a file located on the file system. 

[EIO]An I/O error occurred while writing cached file system information. 

[EFAULT]The dir parameter points outside the process’ allocated address space. 

FILES

/usr/include/sys/mount.h

ENVIRONMENT NOTES

This section describes system features that are not generic to OSF/1 but that are provided in this OSF/1 implementation. 

ULTRIX Compatibility

Parameters

typeDefines the type of file system. The additional type of file system defined in the sys/mount.h header file is MOUNT_CDFS. 
 

RELATED INFORMATION

Commands: mount(8)
 
 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026