1.\" $OpenBSD: mount_msdos.8,v 1.31 2020/04/23 21:28:09 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: April 23 2020 $ 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 9ls 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 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.El 143.Pp 144File permissions for FAT file systems are imitated, 145since the file system has no real concept of permissions. 146The default mask is taken from the 147directory on which the file system is being mounted, 148except when the 149.Fl m 150option is used. 151FAT does have a 152.Dq read only 153mode, 154in which the writable bit is unset. 155If such files are found, 156they are marked non-writable; 157it can be set using 158.Li chmod -w 159or unset using 160.Li chmod +w . 161.Pp 162File modes work the same way for directories. 163However a directory will inherit the executable bit if it is readable. 164See 165.Xr chmod 1 166for more information about octal file modes. 167.Sh SEE ALSO 168.Xr chmod 1 , 169.Xr mount 2 , 170.Xr disklabel 5 , 171.Xr fstab 5 , 172.Xr disklabel 8 , 173.Xr mount 8 , 174.Xr umount 8 175.Sh HISTORY 176The 177.Nm 178utility first appeared in 179.Nx 0.9 . 180Its predecessor, the 181.Nm mount_pcfs 182utility, appeared in 183.Nx 0.8 , 184and was abandoned in favor 185of the more aptly named 186.Nm mount_msdos . 187.Sh AUTHORS 188.An -nosplit 189The original code was written by 190.An Paul Popelka Aq Mt paulp@uts.amdahl.com 191as a patch to 192.Bx 386 0.1 193in November 1992. 194The current version is based on code written by 195.An Christopher G. Demetriou Aq Mt cgd@netbsd.org 196in April 1994. 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