1mnttab(4) File Formats mnttab(4)
2
3
4
6 mnttab - mounted file system table
7
9 The file /etc/mnttab is really a file system that provides read-only
10 access to the table of mounted file systems for the current host.
11 /etc/mnttab is read by programs using the routines described in getmn‐
12 tent(3C). Mounting a file system adds an entry to this table. Unmount‐
13 ing removes an entry from this table. Remounting a file system causes
14 the information in the mounted file system table to be updated to
15 reflect any changes caused by the remount. The list is maintained by
16 the kernel in order of mount time. That is, the first mounted file sys‐
17 tem is first in the list and the most recently mounted file system is
18 last. When mounted on a mount point the file system appears as a regu‐
19 lar file containing the current mnttab information.
20
21
22 Each entry is a line of fields separated by TABs in the form:
23
24 special mount_point fstype options time
25
26
27
28 where:
29
30 special The name of the resource that has been mounted.
31
32
33 mount_point The pathname of the directory on which the filesystem is
34 mounted.
35
36
37 fstype The file system type of the mounted file system.
38
39
40 options The mount options. See respective mount file system man
41 page in the See Also section below.
42
43
44 time The time at which the file system was mounted.
45
46
47
48 Examples of entries for the special field include the pathname of a
49 block-special device, the name of a remote file system in the form of
50 host:pathname, or the name of a swap file, for example, a file made
51 with mkfile(1M).
52
54 The following ioctl(2) calls are supported:
55
56 MNTIOC_NMNTS Returns the count of mounted resources in the cur‐
57 rent snapshot in the uint32_t pointed to by arg.
58
59
60 MNTIOC_GETDEVLIST Returns an array of uint32_t's that is twice as
61 long as the length returned by MNTIOC_NMNTS. Each
62 pair of numbers is the major and minor device num‐
63 ber for the file system at the corresponding line
64 in the current /etc/mnttab snapshot. arg points to
65 the memory buffer to receive the device number
66 information.
67
68
69 MNTIOC_SETTAG Sets a tag word into the options list for a
70 mounted file system. A tag is a notation that will
71 appear in the options string of a mounted file
72 system but it is not recognized or interpreted by
73 the file system code. arg points to a filled in
74 mnttagdesc structure, as shown in the following
75 example:
76
77 uint_t mtd_major; /* major number for mounted fs */
78 uint_t mtd_minor; /* minor number for mounted fs */
79 char *mtd_mntpt; /* mount point of file system */
80 char *mtd_tag; /* tag to set/clear */
81
82 If the tag already exists then it is marked as set
83 but not re-added. Tags can be at most
84 MAX_MNTOPT_TAG long.
85
86 Use of this ioctl is restricted to processes with
87 the {PRIV_SYS_MOUNT} privilege.
88
89
90 MNTIOC_CLRTAG Marks a tag in the options list for a mounted file
91 system as not set. arg points to the same struc‐
92 ture as MNTIOC_SETTAG, which identifies the file
93 system and tag to be cleared.
94
95 Use of this ioctl is restricted to processes with
96 the {PRIV_SYS_MOUNT} privilege.
97
98
100 EFAULT The arg pointer in an MNTIOC_ ioctl call pointed to an
101 inaccessible memory location or a character pointer in
102 a mnttagdesc structure pointed to an inaccessible mem‐
103 ory location.
104
105
106 EINVAL The tag specified in a MNTIOC_SETTAG call already
107 exists as a file system option, or the tag specified in
108 a MNTIOC_CLRTAG call does not exist.
109
110
111 ENAMETOOLONG The tag specified in a MNTIOC_SETTAG call is too long
112 or the tag would make the total length of the option
113 string for the mounted file system too long.
114
115
116 EPERM The calling process does not have {PRIV_SYS_MOUNT}
117 privilege and either a MNTIOC_SETTAG or MNTIOC_CLRTAG
118 call was made.
119
120
122 /etc/mnttab Usual mount point for mnttab file system
123
124
125 /usr/include/sys/mntio.h Header file that contains IOCTL definitions
126
127
129 mkfile(1M), mount_cachefs(1M), mount_hsfs(1M), mount_nfs(1M),
130 mount_pcfs(1M), mount_ufs(1M), mount(1M), ioctl(2), read(2), poll(2),
131 stat(2), getmntent(3C)
132
134 The mnttab file system provides the previously undocumented dev=xxx
135 option in the option string for each mounted file system. This is pro‐
136 vided for legacy applications that might have been using the dev=infor‐
137 mation option.
138
139
140 Using dev=option in applications is strongly discouraged. The device
141 number string represents a 32-bit quantity and might not contain cor‐
142 rect information in 64-bit environments.
143
144
145 Applications requiring device number information for mounted file sys‐
146 tems should use the getextmntent(3C) interface, which functions prop‐
147 erly in either 32- or 64-bit environments.
148
150 The snapshot of the mnttab information is taken any time a read(2) is
151 performed at offset 0 (the beginning) of the mnttab file. The file mod‐
152 ification time returned by stat(2) for the mnttab file is the time of
153 the last change to mounted file system information. A poll(2) system
154 call requesting a POLLRDBAND event can be used to block and wait for
155 the system's mounted file system information to be different from the
156 most recent snapshot since the mnttab file was opened.
157
158
159
160SunOS 5.11 20 Dec 2003 mnttab(4)