BSD 4_2 development
[unix-history] / usr / man / man2 / mount.2
CommitLineData
2eb286a2
C
1.TH MOUNT 2 "27 July 1983"
2.UC 4
3.SH NAME
4mount, umount \- mount or remove file system
5.SH SYNOPSIS
6.nf
7.ft B
8mount(special, name, rwflag)
9char *special, *name;
10int rwflag;
11.PP
12.ft B
13umount(special)
14char *special;
15.fi
16.SH DESCRIPTION
17.I Mount
18announces to the system that a removable file system has
19been mounted on
20the block-structured special file
21.I special;
22from now on, references to file
23.I name
24will refer to
25the root file on the newly mounted file system.
26.I Special
27and
28.I name
29are pointers to null-terminated strings
30containing the appropriate path names.
31.PP
32.I Name
33must exist already.
34.I Name
35must be a directory.
36Its old contents
37are inaccessible while the file system
38is mounted.
39.PP
40The
41.I rwflag
42argument determines whether
43the file system can be written on; if it is 0 writing
44is allowed, if non-zero no writing is done.
45Physically write-protected and magnetic
46tape file systems must be mounted read-only or
47errors will occur when access times are updated,
48whether or not any
49explicit write is attempted.
50.PP
51.I Umount
52announces to the system that the
53.I special
54file is no longer to contain a removable file system.
55The associated file reverts to its ordinary interpretation.
56.SH "RETURN VALUE
57.I Mount
58returns 0 if the action occurred, \-1 if
59.I special
60is inaccessible or not an appropriate file, if
61.I name
62does not exist, if
63.I special
64is already mounted, if
65.I name
66is in use, or if
67there are already too many
68file systems mounted.
69.PP
70.I Umount
71returns 0 if the action occurred; \-1 if
72if the special file is inaccessible or
73does not have a mounted file system,
74or if there are active files in the mounted
75file system.
76.SH ERRORS
77.I Mount
78will fail when one of the following occurs:
79.TP 15
80[NODEV]
81The caller is not the super-user.
82.TP 15
83[NODEV]
84.I Special
85does not exist.
86.TP 15
87[ENOTBLK]
88.I Special
89is not a block device.
90.TP 15
91[ENXIO]
92The major device number of
93.I special
94is out of range (this indicates no device driver exists
95for the associated hardware).
96.TP 15
97[EPERM]
98The pathname contains a character with the high-order bit set.
99.TP 15
100[ENOTDIR]
101A component of the path prefix in
102.I name
103is not a directory.
104.TP 15
105[EROFS]
106.I Name
107resides on a read-only file system.
108.TP 15
109[EBUSY]
110.I Name
111is not a directory, or another process currently
112holds a reference to it.
113.TP 15
114[EBUSY]
115No space remains in the mount table.
116.TP 15
117[EBUSY]
118The super block for the file system had a bad magic
119number or an out of range block size.
120.TP 15
121[EBUSY]
122Not enough memory was available to read the cylinder
123group information for the file system.
124.TP 15
125[EBUSY]
126An i/o error occurred while reading the super block or
127cylinder group information.
128.PP
129.I Umount
130may fail with one of the following errors:
131.TP 15
132[NODEV]
133The caller is not the super-user.
134.TP 15
135[NODEV]
136.I Special
137does not exist.
138.TP 15
139[ENOTBLK]
140.I Special
141is not a block device.
142.TP 15
143[ENXIO]
144The major device number of
145.I special
146is out of range (this indicates no device driver exists
147for the associated hardware).
148.TP 15
149[EINVAL]
150The requested device is not in the mount table.
151.TP 15
152[EBUSY]
153A process is holding a reference to a file located
154on the file system.
155.SH "SEE ALSO"
156mount(8), umount(8)
157.SH BUGS
158The error codes are in a state of disarray; too many errors
159appear to the caller as one value.