1.\" $OpenBSD: mount_msdos.8,v 1.33 2022/08/20 07:03:24 tb 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 20 2022 $ 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 group 42.Op Fl m Ar mask 43.Op Fl o Ar options 44.Op Fl u Ar user 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 group 85Specifies the group name or GID of the root inode of the file system. 86Defaults to the mount point's GID. 87.It Fl l 88Force listing and generation of 89Windows 95/98 long filenames 90and separate creation/modification/access dates. 91.Pp 92This is the default. 93.It Fl m Ar mask 94Specify the maximum permissions for files and directories 95in the file system. 96Only the nine low-order bits of 97.Ar mask 98are used. 99.It Fl o Ar options 100Use the specified mount 101.Ar options , 102as described in 103.Xr mount 8 . 104.It Fl s 105Force behaviour to 106ignore and not generate Windows 95/98 long filenames. 107.It Fl u Ar user 108Specifies the user name or UID of the root inode of the file system. 109Defaults to the mount point's UID. 110.El 111.Pp 112File permissions for FAT file systems are imitated, 113since the file system has no real concept of permissions. 114The default mask is taken from the 115directory on which the file system is being mounted, 116except when the 117.Fl m 118option is used. 119FAT does have a 120.Dq read only 121mode, 122in which the writable bit is unset. 123If such files are found, 124they are marked non-writable; 125it can be set using 126.Li chmod -w 127or unset using 128.Li chmod +w . 129.Pp 130File modes work the same way for directories. 131However a directory will inherit the executable bit if it is readable. 132See 133.Xr chmod 1 134for more information about octal file modes. 135.Sh SEE ALSO 136.Xr chmod 1 , 137.Xr mount 2 , 138.Xr disklabel 5 , 139.Xr fstab 5 , 140.Xr disklabel 8 , 141.Xr mount 8 , 142.Xr umount 8 143.Sh HISTORY 144The 145.Nm 146utility first appeared in 147.Nx 0.9 . 148Its predecessor, the 149.Nm mount_pcfs 150utility, appeared in 151.Nx 0.8 , 152and was abandoned in favor 153of the more aptly named 154.Nm mount_msdos . 155.Sh AUTHORS 156.An -nosplit 157The original code was written by 158.An Paul Popelka Aq Mt paulp@uts.amdahl.com 159as a patch to 160.Bx 386 0.1 161in November 1992. 162The current version is based on code written by 163.An Christopher G. Demetriou Aq Mt cgd@netbsd.org 164in April 1994. 165.Sh CAVEATS 166The maximum file size supported by the MS-DOS file system is 167one byte less than 4GB. 168This is a FAT file system limitation, documented by Microsoft 169in Knowledge Base article 314463. 170.Pp 171The MS-DOS file system (even with long filenames) does not support 172filenames with trailing dots or spaces. 173Any such characters will be silently removed before the directory entry 174is written. 175This too is a FAT file system limitation. 176.Pp 177The use of the 178.Fl 9 179flag could result in damaged file systems, 180albeit the damage is in part taken care of by 181procedures similar to the ones used in Windows 95/98. 182.Pp 183Note that Windows 95/98 handles only access dates, 184but not access times. 185