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