xref: /openbsd-src/sbin/mount_msdos/mount_msdos.8 (revision a28daedfc357b214be5c701aa8ba8adb29a7f1c2)
1.\"	$OpenBSD: mount_msdos.8,v 1.23 2007/05/31 19:19:45 jmc Exp $
2.\"	$NetBSD: mount_msdos.8,v 1.10 1996/01/19 21:14:43 leo Exp $
3.\"
4.\" Copyright (c) 1993,1994 Christopher G. Demetriou
5.\" All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\" 3. All advertising materials mentioning features or use of this software
16.\"    must display the following acknowledgement:
17.\"      This product includes software developed by Christopher G. Demetriou.
18.\" 4. The name of the author may not be used to endorse or promote products
19.\"    derived from this software without specific prior written permission
20.\"
21.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31.\"
32.Dd $Mdocdate: May 31 2007 $
33.Dt MOUNT_MSDOS 8
34.Os
35.Sh NAME
36.Nm mount_msdos
37.Nd mount an MS-DOS file system
38.Sh SYNOPSIS
39.Nm mount_msdos
40.Op Fl 9lsx
41.Op Fl g Ar gid
42.Op Fl m Ar mask
43.Op Fl o Ar options
44.Op Fl u Ar uid
45.Ar special
46.Ar node
47.Sh DESCRIPTION
48The
49.Nm
50command attaches the MS-DOS filesystem residing on
51the device
52.Ar special
53to the global filesystem namespace at the location
54indicated by
55.Ar node .
56This command is invoked by
57.Xr mount 8
58when using the syntax
59.Bd -ragged -offset 4n
60.Nm mount Op options
61-t msdos
62.Ar special Ar node
63.Ed
64.Pp
65The
66.Ar special
67device must correspond to a partition registered in the
68.Xr disklabel 5 .
69.Pp
70This command is normally executed by
71.Xr mount 8
72at boot time, but can be used by any user to mount an
73MS-DOS file system on any directory that they own (provided,
74of course, that they have appropriate access to the device that
75contains the file system).
76.Pp
77The options are as follows:
78.Bl -tag -width Ds
79.It Fl 9
80Ignore the special Windows 95/98 directory entries even
81if deleting or renaming a file.
82This forces
83.Fl s .
84.It Fl g Ar gid
85Set the group of the files in the file system to
86.Ar gid .
87The default group is the group of the directory
88on which the file system is being mounted.
89.It Fl l
90Force listing and generation of
91Windows 95/98 long filenames
92and separate creation/modification/access dates.
93.Pp
94If neither
95.Fl s
96nor
97.Fl l
98are given,
99.Nm
100searches the root directory of the filesystem to
101be mounted for any existing Windows 95/98 long filenames.
102If no such entries are found,
103.Fl s
104is the default.
105Otherwise
106.Fl l
107is assumed.
108.It Fl m Ar mask
109Specify the maximum file permissions for files
110in the file system.
111(For example, a mask of
112.Li 755
113specifies that, by default, the owner should have
114read, write, and execute permissions for files, but
115others should only have read and execute permissions.
116See
117.Xr chmod 1
118for more information about octal file modes.)
119Only the nine low-order bits of
120.Ar mask
121are used.
122The default mask is taken from the
123directory on which the file system is being mounted.
124.It Fl o Ar options
125Use the specified mount
126.Ar options ,
127as described in
128.Xr mount 8 .
129.It Fl s
130Force behaviour to
131ignore and not generate Windows 95/98 long filenames.
132.Pp
133If neither
134.Fl s
135nor
136.Fl l
137are given,
138.Nm
139searches the root directory of the filesystem to
140be mounted for any existing Windows 95/98 long filenames.
141If no such entries are found,
142.Fl s
143is the default.
144Otherwise
145.Fl l
146is assumed.
147.It Fl u Ar uid
148Set the owner of the files in the file system to
149.Ar uid .
150The default owner is the owner of the directory
151on which the file system is being mounted.
152.It Fl x
153If a directory is readable, it inherits the x attribute as well.
154.El
155.Sh SEE ALSO
156.Xr mount 2 ,
157.Xr disklabel 5 ,
158.Xr fstab 5 ,
159.Xr disklabel 8 ,
160.Xr mount 8 ,
161.Xr umount 8
162.Sh HISTORY
163The
164.Nm
165utility first appeared in
166.Nx 0.9 .
167Its predecessor, the
168.Nm mount_pcfs
169utility, appeared in
170.Nx 0.8 ,
171and was abandoned in favor
172of the more aptly named
173.Nm mount_msdos .
174.Sh CAVEATS
175The maximum file size supported by the MS-DOS filesystem is
176one byte less than 4GB.
177This is a FAT filesystem limitation, documented by Microsoft
178in Knowledge Base article 314463.
179.Pp
180The MS-DOS filesystem (even with long filenames) does not support
181filenames with trailing dots or spaces.
182Any such characters will be silently removed before the directory entry
183is written.
184This too is a FAT filesystem limitation.
185.Pp
186The use of the
187.Fl 9
188flag could result in damaged filesystems,
189albeit the damage is in part taken care of by
190procedures similar to the ones used in Windows 95/98.
191.Pp
192The default handling for
193.Fl s
194and
195.Fl l
196will result in empty filesystems being populated
197with short filenames only.
198To generate long filenames on empty DOS file systems use
199.Fl l .
200.Pp
201Note that Windows 95/98 handles only access dates,
202but not access times.
203