|
|
1.1 root 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: .\"
5: .\" @(#)mount.2 6.3 (Berkeley) 8/26/85
6: .\"
7: .TH MOUNT 2 "August 26, 1985"
8: .UC 4
9: .SH NAME
10: mount, umount \- mount or remove file system
11: .SH SYNOPSIS
12: .nf
13: .ft B
14: mount(special, name, rwflag)
15: char *special, *name;
16: int rwflag;
17: .PP
18: .ft B
19: umount(special)
20: char *special;
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
41: must be a directory.
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.
62: .SH "RETURN VALUE
63: .I Mount
64: returns 0 if the action occurred, \-1 if
65: .I special
66: is inaccessible or not an appropriate file, if
67: .I name
68: does not exist, if
69: .I special
70: is already mounted, if
71: .I name
72: is in use, or if
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.
82: .SH ERRORS
83: .I Mount
84: will fail when one of the following occurs:
85: .TP 15
86: [ENAMETOOLONG]
87: A component of either pathname exceeded 255 characters,
88: or the entire length of either path name exceeded 1023 characters.
89: .TP 15
90: [ELOOP]
91: Too many symbolic links were encountered in translating either pathname.
92: .TP 15
93: [EPERM]
94: The caller is not the super-user.
95: .TP 15
96: [ENOENT]
97: A component of \fIname\fP does not exist.
98: .TP 15
99: [ENODEV]
100: A component of \fIspecial\fP does not exist.
101: .TP 15
102: [ENOTBLK]
103: .I Special
104: is not a block device.
105: .TP 15
106: [ENXIO]
107: The major device number of
108: .I special
109: is out of range (this indicates no device driver exists
110: for the associated hardware).
111: .TP 15
112: [ENOTDIR]
113: A component of \fIname\fP is not a directory,
114: or a path prefix of \fIspecial\fP is not a directory.
115: .TP 15
116: [EINVAL]
117: Either pathname contains a character with the high-order bit set.
118: .TP 15
119: [EINVAL]
120: The super block for the file system had a bad magic
121: number or an out of range block size.
122: .TP 15
123: [EBUSY]
124: Another process currently holds a reference to
125: .IR name ,
126: or \fIspecial\fP is already mounted.
127: .TP 15
128: [EMFILE]
129: No space remains in the mount table.
130: .TP 15
131: [ENOMEM]
132: Not enough memory was available to read the cylinder
133: group information for the file system.
134: .TP 15
135: [EIO]
136: An I/O error occurred while reading the super block or
137: cylinder group information.
138: .TP 15
139: [EFAULT]
140: \fISpecial\fP or \fIname\fP points outside the
141: process's allocated address space.
142: .PP
143: .I Umount
144: may fail with one of the following errors:
145: .TP 15
146: [ENOTDIR]
147: A component of the path prefix is not a directory.
148: .TP 15
149: [EINVAL]
150: The pathname contains a character with the high-order bit set.
151: .TP 15
152: [ENAMETOOLONG]
153: A component of a pathname exceeded 255 characters,
154: or an entire path name exceeded 1023 characters.
155: .TP 15
156: [ELOOP]
157: Too many symbolic links were encountered in translating the pathname.
158: .TP 15
159: [EPERM]
160: The caller is not the super-user.
161: .TP 15
162: [ENODEV]
163: .I Special
164: does not exist.
165: .TP 15
166: [ENOTBLK]
167: .I Special
168: is not a block device.
169: .TP 15
170: [ENXIO]
171: The major device number of
172: .I special
173: is out of range (this indicates no device driver exists
174: for the associated hardware).
175: .TP 15
176: [EINVAL]
177: The requested device is not in the mount table.
178: .TP 15
179: [EBUSY]
180: A process is holding a reference to a file located
181: on the file system.
182: .TP 15
183: [EIO]
184: An I/O error occurred while writing the super block or
185: other cached file system information.
186: .TP 15
187: [EFAULT]
188: \fISpecial\fP points outside the process's allocated address space.
189: .SH "SEE ALSO"
190: mount(8), umount(8)
191: .SH BUGS
192: Some of the error codes need translation to more obvious messages.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.