1.\" $NetBSD: mount_ntfs.8,v 1.22 2017/04/15 10:30:55 abhinav Exp $ 2.\" 3.\" Copyright (c) 1993,1994 Christopher G. Demetriou 4.\" Copyright (c) 1999 Semen Ustimenko 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 acknowledgment: 17.\" This product includes software developed by Christopher G. Demetriou. 18.\" 3. 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.\" Id: mount_ntfs.8,v 1.3 1999/05/04 11:34:33 jkoshy Exp 33.\" 34.Dd September 9, 2015 35.Dt MOUNT_NTFS 8 36.Os 37.Sh NAME 38.Nm mount_ntfs 39.Nd mount an NTFS file system 40.Sh SYNOPSIS 41.Nm mount_ntfs 42.Op Fl a 43.Op Fl i 44.Op Fl u Ar uid 45.Op Fl g Ar gid 46.Op Fl m Ar mask 47.Pa special 48.Pa node 49.Sh DESCRIPTION 50The 51.Nm 52command attaches the NTFS filesystem residing on the device 53.Pa special 54to the global filesystem namespace at the location 55indicated by 56.Pa node . 57Both 58.Ar special 59and 60.Ar node 61are converted to absolute paths before use. 62This command is normally executed by 63.Xr mount 8 64at boot time, but can be used by any user to mount an 65NTFS file system on any directory that they own (provided, 66of course, that they have appropriate access to the device that 67contains the file system). 68.Pp 69The supported NTFS versions include both NTFS4, as used by Microsoft 70Windows NT 4.0, and NTFS5, as used by Microsoft Windows 2000 and XP. 71.Pp 72The options are as follows: 73.Bl -tag -width Ds 74.It Fl a 75Force behaviour to return MS-DOS 8.3 names also on 76.Xr readdir 3 . 77.It Fl i 78Make name lookup case insensitive for all names except POSIX names. 79.It Fl u Ar uid 80Set the owner of the files in the file system to 81.Ar uid . 82The default owner is the owner of the directory 83on which the file system is being mounted. 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 m Ar mask 90Specify the maximum file permissions for files 91in the file system. 92.El 93.Sh FEATURES 94.Ss NTFS file attributes 95NTFS file attributes can be accessed in the following way: 96.Bd -literal -offset indent 97foo[[:ATTRTYPE]:ATTRNAME] 98.Ed 99.Pp 100.Sq ATTRTYPE 101is one of identifier listed in $AttrDef file of volume. 102Default is $DATA. 103.Sq ATTRNAME 104is an attribute name. 105Default is none. 106.Pp 107.Sy Examples : 108.Pp 109To get volume name (in Unicode): 110.Bd -literal -offset indent 111# cat /mnt/\e$Volume:\e$VOLUME_NAME 112.Ed 113.Pp 114To read directory raw data: 115.Bd -literal -offset indent 116# cat /mnt/foodir:\e$INDEX_ROOT:\e$I30 117.Ed 118.Ss Limited support for writing 119There is limited writing ability for files. 120Limitations: 121.Bl -bullet -compact 122.It 123file must be non-resident 124.It 125file must 126.Em not 127contain any holes (uninitialized areas) 128.It 129file can't be compressed 130.El 131.Pp 132Note that it's not currently possible to create or remove files 133on NTFS filesystems. 134.Pp 135.Sy Warning : 136do not mount NTFS filesystems read-write. 137The write support is not very useful and is not tested well. 138It's not safe to write to any file on NTFS; you might damage the filesystem. 139Unless you want to debug NTFS filesystem code, mount the NTFS filesystem 140read-only. 141.Sh SEE ALSO 142.Xr mount 2 , 143.Xr unmount 2 , 144.Xr fstab 5 , 145.Xr disklabel 8 , 146.Xr mbrlabel 8 , 147.Xr mount 8 148.Sh HISTORY 149Support for NTFS first appeared in 150.Fx 3.0 . 151It was ported to 152.Nx 153and first appeared in 154.Nx 1.5 . 155.Sh AUTHORS 156NTFS kernel implementation, 157.Nm 158and this manual were originally written by 159.An Semen Ustimenko Aq Mt semenu@FreeBSD.org . 160.Pp 161The 162.Nx 163port was done by 164.An Christos Zoulas 165.Aq christos@NetBSD.org 166and 167.An Jaromir Dolecek 168.Aq jdolecek@NetBSD.org . 169.Sh BUGS 170The write support should be enhanced to actually be able to change 171file size, and to create and remove files and directories. 172It's not very useful right now. 173.Pp 174If the attempt to mount NTFS gives you an error like this: 175.Bd -literal 176# mount -t ntfs /dev/wd0k /mnt 177mount_ntfs: /dev/wd0k on /mnt: Invalid argument 178.Ed 179.Pp 180make sure that appropriate partition has correct entry in the 181disk label, particularly that the partition offset is correct. 182.Pp 183Recently many cards (in particular SDXC ones) are formatted using 184exFAT. 185For those cards, disklabel reports NTFS as the partition type. 186There is currently no support for mounting exFAT drives. 187.Pp 188If the NTFS partition is the first partition on the disk, the 189offset should be '63' or '2048' on i386 (see 190.Xr disklabel 8 ) . 191exFAT partitions typically report an offset of '32768'. 192.Xr mbrlabel 8 193could help you to set up the disk label correctly. 194.Pp 195If the NTFS partition is marked as 196.Ql dynamic 197under Microsoft Windows XP, 198it won't be possible to access it under 199.Nx 200anymore. 201