1.\" $NetBSD: mount_msdos.8,v 1.41 2020/02/12 09:43:19 leot Exp $ 2.\" 3.\" Copyright (c) 1993, 1994 Christopher G. Demetriou 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 3. All advertising materials mentioning features or use of this software 15.\" must display the following acknowledgement: 16.\" This product includes software developed for the 17.\" NetBSD Project. See http://www.NetBSD.org/ for 18.\" information about NetBSD. 19.\" 4. The name of the author may not be used to endorse or promote products 20.\" derived from this software without specific prior written permission. 21.\" 22.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 23.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 24.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 25.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 26.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 27.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 31.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32.\" 33.\" <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>> 34.\" 35.Dd February 12, 2020 36.Dt MOUNT_MSDOS 8 37.Os 38.Sh NAME 39.Nm mount_msdos 40.Nd mount an MS-DOS file system 41.Sh SYNOPSIS 42.Nm 43.Op Fl 9GlsU 44.Op Fl g Ar gid 45.Op Fl M Ar mask 46.Op Fl m Ar mask 47.Op Fl o Ar options 48.Op Fl t Ar gmtoff 49.Op Fl u Ar uid 50.Pa special 51.Pa node 52.Sh DESCRIPTION 53The 54.Nm 55command attaches the MS-DOS file system residing on 56the device 57.Pa special 58to the global file system namespace at the location 59indicated by 60.Pa node . 61Both 62.Ar special 63and 64.Ar node 65are converted to absolute paths before use. 66This command is normally executed by 67.Xr mount 8 68at boot time, but can be used by any user to mount an 69MS-DOS file system on any directory that they own (provided, 70of course, that they have appropriate access to the device that 71contains the file system). 72.Pp 73Support for FAT16 and VFAT32 as well as long file names is available. 74.Pp 75The options are as follows: 76.Bl -tag -width XoXoptionsXX 77.It Fl 9 78Ignore the special Win'95 directory entries even 79if deleting or renaming a file. 80This forces 81.Fl s . 82.It Fl G 83This option causes the file system to be interpreted as an Atari-Gemdos 84file system. 85The differences to the MS-DOS file system are minimal and 86limited to the boot block. 87This option also allows mounting X680x0's Human68k floppies. 88This option enforces 89.Fl s . 90.It Fl g Ar gid 91Set the group of the files in the file system to 92.Ar gid . 93The default group is the group of the directory 94on which the file system is being mounted. 95.It Fl l 96Force listing and generation of 97Win'95 long filenames 98and separate creation/modification/access dates. 99.Pp 100If neither 101.Fl s 102nor 103.Fl l 104are given, 105.Nm 106searches the root directory of the file system to 107be mounted for any existing Win'95 long filenames. 108If the file system is not empty and no such entries are found, 109.Fl s 110is the default. 111Otherwise 112.Fl l 113is assumed. 114.It Fl U 115The MS-DOS file system stores filenames in a short 116version using 8-bit characters according to some 117character set and a long version with 16-bit unicode 118characters. 119The default method to store encoding-agnostic UNIX filenames 120is to copy them byte-wise into both fields. 121This is 122transparent but generates wrong unicode characters 123for anything that is not ASCII. 124Setting the 125.Fl U 126flag interprets UNIX filenames as UTF-8 and generates 127correctly encoded long filenames. 128This forces 129.Fl l . 130.It Fl M Ar mask 131Specify the maximum file permissions for directories 132in the file system. 133The value of 134.Fl m 135is used if it is supplied and 136.Fl M 137is omitted. 138.It Fl m Ar mask 139Specify the maximum file permissions for files 140in the file system. 141(For example, a mask of 142.Li 755 143specifies that, by default, the owner should have 144read, write, and execute permissions for files, but 145others should only have read and execute permissions. 146See 147.Xr chmod 1 148for more information about octal file modes.) 149Only the nine low-order bits of 150.Ar mask 151are used. 152The value of 153.Fl M 154is used if it is supplied and 155.Fl m 156is omitted. 157The default mask is taken from the 158directory on which the file system is being mounted. 159.It Fl o Ar options 160Use the specified mount 161.Ar options , 162as described in 163.Xr mount 8 . 164.It Fl s 165Force behaviour to 166ignore and not generate Win'95 long filenames. 167See also 168.Fl l . 169.It Fl t Ar gmtoff 170Set the time zone offset (in seconds) from UTC to 171.Ar gmtoff , 172with positive values indicating east of the Prime Meridian. 173If not set, the user's current time zone will be used. 174.It Fl u Ar uid 175Set the owner of the files in the file system to 176.Ar uid . 177The default owner is the owner of the directory 178on which the file system is being mounted. 179.El 180.Sh EXAMPLES 181To remove the 'execute' permission bit for all files, but still keep 182directories searchable, use: 183.Bl -item -offset indent 184.It 185mount_msdos -m 0644 -M 0755 /dev/wd0e /msdos 186.El 187.Sh SEE ALSO 188.Xr mount 2 , 189.Xr unmount 2 , 190.Xr fstab 5 , 191.Xr mount 8 192.Sh HISTORY 193The predecessor to 194.Nm 195utility named 196.Nm mount_pcfs 197appeared in 198.Nx 0.8 . 199It was abandoned in favour of the more aptly-named 200.Nm 201in 202.Nx 0.9 203and rewritten entirely by 204.Nx 1.0 . 205.Sh AUTHORS 206Initial implementation as 207.Nm mount_pcfs 208was written by 209.An -nosplit 210.An Paul Popelka Aq Mt paulp@uts.amdahl.com . 211It was rewritten by 212.An Christopher G. Demetriou Aq Mt cgd@NetBSD.org . 213.Sh BUGS 214Compressed partitions are not supported. 215.Pp 216The use of the 217.Fl 9 218flag could result in damaged file systems, 219albeit the damage is in part taken care of by 220procedures similar to the ones used in Win'95. 221