1.\" $OpenBSD: mount_msdos.8,v 1.25 2009/08/09 06:45:49 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: August 9 2009 $ 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 file system residing on 51the device 52.Ar special 53to the global file system 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 file system 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 permissions for files and directories 110in the file system. 111Only the nine low-order bits of 112.Ar mask 113are used. 114.It Fl o Ar options 115Use the specified mount 116.Ar options , 117as described in 118.Xr mount 8 . 119.It Fl s 120Force behaviour to 121ignore and not generate Windows 95/98 long filenames. 122.Pp 123If neither 124.Fl s 125nor 126.Fl l 127are given, 128.Nm 129searches the root directory of the file system to 130be mounted for any existing Windows 95/98 long filenames. 131If no such entries are found, 132.Fl s 133is the default. 134Otherwise 135.Fl l 136is assumed. 137.It Fl u Ar uid 138Set the owner of the files in the file system to 139.Ar uid . 140The default owner is the owner of the directory 141on which the file system is being mounted. 142.It Fl x 143If a directory is readable, it inherits the x attribute as well. 144.El 145.Pp 146File permissions for FAT file systems are imitated, 147since the file system has no real concept of permissions. 148The default mask is taken from the 149directory on which the file system is being mounted, 150except when the 151.Fl m 152option is used. 153FAT does have a 154.Dq read only 155mode, 156in which the writable bit is unset. 157If such files are found, 158they are marked non-writable; 159it can be set using 160.Li chmod -w 161or unset using 162.Li chmod +w . 163.Pp 164File modes work the same way for directories. 165However if a directory is mounted with 166.Fl x , 167it will inherit the executable bit if it is readable. 168This can be useful for making files non-executable 169and directories executable: 170using 171.Li -x -m 644 172will in most cases give permissions of 755 for directories 173and 644 for files. 174See 175.Xr chmod 1 176for more information about octal file modes. 177.Sh SEE ALSO 178.Xr chmod 1 , 179.Xr mount 2 , 180.Xr disklabel 5 , 181.Xr fstab 5 , 182.Xr disklabel 8 , 183.Xr mount 8 , 184.Xr umount 8 185.Sh HISTORY 186The 187.Nm 188utility first appeared in 189.Nx 0.9 . 190Its predecessor, the 191.Nm mount_pcfs 192utility, appeared in 193.Nx 0.8 , 194and was abandoned in favor 195of the more aptly named 196.Nm mount_msdos . 197.Sh CAVEATS 198The maximum file size supported by the MS-DOS file system is 199one byte less than 4GB. 200This is a FAT file system limitation, documented by Microsoft 201in Knowledge Base article 314463. 202.Pp 203The MS-DOS file system (even with long filenames) does not support 204filenames with trailing dots or spaces. 205Any such characters will be silently removed before the directory entry 206is written. 207This too is a FAT file system limitation. 208.Pp 209The use of the 210.Fl 9 211flag could result in damaged file systems, 212albeit the damage is in part taken care of by 213procedures similar to the ones used in Windows 95/98. 214.Pp 215The default handling for 216.Fl s 217and 218.Fl l 219will result in empty file systems being populated 220with short filenames only. 221To generate long filenames on empty DOS file systems use 222.Fl l . 223.Pp 224Note that Windows 95/98 handles only access dates, 225but not access times. 226