1MOUNT(2)                      System Calls Manual                     MOUNT(2)
2
3
4

NAME

6       mount, umount - mount or remove file system
7

SYNOPSIS

9       mount(special, name, flags)
10       char *special, *name;
11       int flags;
12
13       umount(special)
14       char *special;
15

DESCRIPTION

17       Mount  announces  to  the  system that a removable file system has been
18       mounted on the block-structured special file special; from now on, ref‐
19       erences  to  file name will refer to the root file on the newly mounted
20       file system.  Special and name are pointers to null-terminated  strings
21       containing the appropriate path names.
22
23       Name  must  exist already.  Name must be a directory.  Its old contents
24       are inaccessible while the file system is mounted.
25
26       The following flags may be  specified  to  suppress  default  semantics
27       which affect filesystem access.
28
29       MNT_RDONLY          The filesystem should be treated as read-only; Even
30                           the super-user may not write on it.
31
32       MNT_NOEXEC          Do not allow files to be executed from the filesys‐
33                           tem.
34
35       MNT_NOSUID          Do  not  honor  setuid or setgid bits on files when
36                           executing them.
37
38       MNT_NODEV           Do not interpret special files on the filesystem.
39
40       MNT_SYNCHRONOUS     All I/O to  the  filesystem  should  be  done  syn‐
41                           chronously.
42
43       Umount  announces  to  the system that the special file is no longer to
44       contain a removable file system.  The associated file  reverts  to  its
45       ordinary interpretation.
46

RETURN VALUE

48       Mount  returns  0 if the action occurred, -1 if special is inaccessible
49       or not an appropriate file, if name  does  not  exist,  if  special  is
50       already  mounted,  if  name is in use, or if there are already too many
51       file systems mounted.
52
53       Umount returns 0 if the action occurred; -1 if if the special  file  is
54       inaccessible  or  does  not have a mounted file system, or if there are
55       active files in the mounted file system.
56

ERRORS

58       Mount will fail when one of the following occurs:
59
60       [ENAMETOOLONG] A component of either pathname exceeded 255  characters,
61                      or  the  entire length of either path name exceeded 1023
62                      characters.
63
64       [ELOOP]        Too many symbolic links were encountered in  translating
65                      either pathname.
66
67       [EPERM]        The caller is not the super-user.
68
69       [ENOENT]       A component of name does not exist.
70
71       [ENODEV]       A component of special does not exist.
72
73       [ENOTBLK]      Special is not a block device.
74
75       [ENXIO]        The major device number of special is out of range (this
76                      indicates no device driver  exists  for  the  associated
77                      hardware).
78
79       [ENOTDIR]      A component of name is not a directory, or a path prefix
80                      of special is not a directory.
81
82       [EINVAL]       Either pathname contains a character with the high-order
83                      bit set.
84
85       [EINVAL]       The super block for the file system had a bad magic num‐
86                      ber or an out of range block size.
87
88       [EBUSY]        Another process currently holds a reference to name,  or
89                      special is already mounted.
90
91       [EMFILE]       No space remains in the mount table.
92
93       [ENOMEM]       Not  enough  memory  was  available to read the cylinder
94                      group information for the file system.
95
96       [EIO]          An I/O error occurred while reading the super  block  or
97                      cylinder group information.
98
99       [EFAULT]       Special  or  name points outside the process's allocated
100                      address space.
101
102       Umount may fail with one of the following errors:
103
104       [ENOTDIR]      A component of the path prefix is not a directory.
105
106       [EINVAL]       The pathname contains a character  with  the  high-order
107                      bit set.
108
109       [ENAMETOOLONG] A component of a pathname exceeded 255 characters, or an
110                      entire path name exceeded 1023 characters.
111
112       [ELOOP]        Too many symbolic links were encountered in  translating
113                      the pathname.
114
115       [EPERM]        The caller is not the super-user.
116
117       [ENODEV]       Special does not exist.
118
119       [ENOTBLK]      Special is not a block device.
120
121       [ENXIO]        The major device number of special is out of range (this
122                      indicates no device driver  exists  for  the  associated
123                      hardware).
124
125       [EINVAL]       The requested device is not in the mount table.
126
127       [EBUSY]        A  process  is  holding a reference to a file located on
128                      the file system.
129
130       [EIO]          An I/O error occurred while writing the super  block  or
131                      other cached file system information.
132
133       [EFAULT]       Special  points  outside the process's allocated address
134                      space.
135

SEE ALSO

137       mount(8), umount(8)
138

BUGS

140       Some of the error codes need translation to more obvious messages.
141
142       Physically write-protected and  magnetic  tape  file  systems  must  be
143       mounted  read-only  or errors will occur when access times are updated,
144       whether or not any explicit write is attempted.
145
146       MNT_SYNCHRONOUS is not currently implemented in the kernel but  may  be
147       specified because the kernel ignores it.
148
149
150
1514th Berkeley Distribution      January 25, 1996                       MOUNT(2)
Impressum