summaryrefslogtreecommitdiff
path: root/src/ntfs-3g.8 (plain)
blob: ee5f7f8011b41535b8d4d4dffddd77b4f78322f9
1.\" Copyright (c) 2005-2006 Yura Pakhuchiy.
2.\" Copyright (c) 2005 Richard Russon.
3.\" Copyright (c) 2006-2009 Szabolcs Szakacsits.
4.\" Copyright (c) 2009-2012 Jean-Pierre Andre
5.\" This file may be copied under the terms of the GNU Public License.
6.\"
7.TH NTFS-3G 8 "May 2012" "ntfs-3g 2014.2.15"
8.SH NAME
9ntfs-3g \- Third Generation Read/Write NTFS Driver
10.SH SYNOPSIS
11.B ntfs-3g
12\fB[-o \fIoption\fP\fB[,...]]\fR
13.I volume mount_point
14.br
15.B mount \-t ntfs-3g
16\fB[-o \fIoption\fP\fB[,...]]\fR
17.I volume mount_point
18.br
19.B lowntfs-3g
20\fB[-o \fIoption\fP\fB[,...]]\fR
21.I volume mount_point
22.br
23.B mount \-t lowntfs-3g
24\fB[-o \fIoption\fP\fB[,...]]\fR
25.I volume mount_point
26.SH DESCRIPTION
27\fBntfs-3g\fR is an NTFS driver, which can create, remove, rename, move
28files, directories, hard links, and streams; it can read and write files,
29including streams, sparse files and transparently compressed files; it can
30handle special files like symbolic links, devices, and FIFOs; moreover it
31provides standard management of file ownership and permissions, including
32POSIX ACLs.
33.PP
34It comes in two variants \fBntfs-3g\fR and \fBlowntfs-3g\fR with
35a few differences mentioned below in relevant options descriptions.
36.PP
37The \fIvolume\fR to be mounted can be either a block device or
38an image file.
39.SS Windows hibernation and fast restarting
40On computers which can be dual-booted into Windows or Linux, Windows has
41to be fully shut down before booting into Linux, otherwise the NTFS file
42systems on internal disks may be left in an inconsistent state and changes
43made by Linux may be ignored by Windows.
44.P
45So, Windows may not be left in hibernation when starting Linux, in order
46to avoid inconsistencies. Moreover, the fast restart feature available on
47recent Windows systems has to be disabled. This can be achieved by issuing
48as an Administrator the Windows command which disables both
49hibernation and fast restarting :
50.RS
51.sp
52powercfg /h off
53.sp
54.RE
55.SS Access Handling and Security
56By default, files and directories are owned by the effective
57user and group of the mounting process, and everybody has
58full read, write, execution and directory browsing permissions.
59You can also assign permissions to a single user by using the
60.B uid
61and/or the
62.B gid
63options together with the
64.B umask,
65or
66.B fmask
67and
68.B dmask
69options.
70.PP
71Doing so, Windows users have full access to the files created by
72.B ntfs-3g.
73.PP
74But, by setting the \fBpermissions\fR option, you can benefit from the full
75ownership and permissions features as defined by POSIX. Moreover, by defining
76a Windows-to-Linux user mapping, the ownerships and permissions are even
77applied to Windows users and conversely.
78.PP
79If
80.B ntfs-3g
81is set setuid-root then non-root users will
82be also able to mount volumes.
83.SS Windows Filename Compatibility
84NTFS supports several filename namespaces: DOS, Win32 and POSIX. While the
85\fBntfs-3g\fR driver handles all of them, it always creates new files in the
86POSIX namespace for maximum portability and interoperability reasons.
87This means that filenames are case sensitive and all characters are
88allowed except '/' and '\\0'. This is perfectly legal on Windows, though
89some application may get confused. The option \fBwindows_names\fP may be
90used to apply Windows restrictions to new file names.
91.SS Alternate Data Streams (ADS)
92NTFS stores all data in streams. Every file has exactly one unnamed
93data stream and can have many named data streams. The size of a file is the
94size of its unnamed data stream. By default, \fBntfs-3g\fR will only read
95the unnamed data stream.
96.PP
97By using the options "streams_interface=windows", with the ntfs-3g driver
98(not possible with lowntfs-3g), you will be able to read any named data
99streams, simply by specifying the stream's name after a colon.
100For example:
101.RS
102.sp
103cat some.mp3:artist
104.sp
105.RE
106Named data streams act like normal files, so you can read from them, write to
107them and even delete them (using rm). You can list all the named data streams
108a file has by getting the "ntfs.streams.list" extended attribute.
109.SH OPTIONS
110Below is a summary of the options that \fBntfs-3g\fR accepts.
111.TP
112\fBuid=\fP\fIvalue\fP and \fBgid=\fP\fIvalue\fP
113Set the owner and the group of files and directories. The values are numerical.
114The defaults are the uid and gid of the current process.
115.TP
116.BI umask= value
117Set the bitmask of the file and directory permissions that are not
118present. The value is given in octal. The default value is 0 which
119means full access to everybody.
120.TP
121.BI fmask= value
122Set the bitmask of the file permissions that are not present.
123The value is given in octal. The default value is 0 which
124means full access to everybody.
125.TP
126.BI dmask= value
127Set the bitmask of the directory permissions that are not
128present. The value is given in octal. The default value is 0 which
129means full access to everybody.
130.TP
131.BI usermapping= file-name
132Use file \fIfile-name\fP as the user mapping file instead of the default
133\fB.NTFS-3G/UserMapping\fP. If \fIfile-name\fP defines a full path, the
134file must be located on a partition previously mounted. If it defines a
135relative path, it is interpreted relative to the root of NTFS partition
136being mounted.
137.P
138.RS
139When a user mapping file is defined, the options \fBuid=\fP, \fBgid=\fP,
140\fBumask=\fP, \fBfmask=\fP, \fBdmask=\fP and \fBsilent\fP are ignored.
141.RE
142.TP
143.B permissions
144Set standard permissions on created files and use standard access control.
145This option is set by default when a user mapping file is present.
146.TP
147.B acl
148Enable setting Posix ACLs on created files and use them for access control.
149This option is only available on specific builds. It is set by default
150when a user mapping file is present and the
151.B permissions
152mount option is not set.
153.TP
154.B inherit
155When creating a new file, set its initial protections
156according to inheritance rules defined in parent directory. These rules
157deviate from Posix specifications, but yield a better Windows
158compatibility. The \fBcompression\fR option or a valid user mapping file
159is required for this option to be effective.
160.TP
161.B ro
162Mount filesystem read\-only. Useful if Windows is hibernated or the
163NTFS journal file is unclean.
164.TP
165.BI locale= value
166This option can be useful when wanting a language specific locale environment.
167It is however discouraged as it leads to files with untranslatable chars
168to not be visible.
169.TP
170.B force
171This option is obsolete. It has been superseded by the \fBrecover\fR and
172\fBnorecover\fR options.
173.TP
174.B recover
175Recover and try to mount a partition which was not unmounted properly by
176Windows. The Windows logfile is cleared, which may cause inconsistencies.
177Currently this is the default option.
178.TP
179.B norecover
180Do not try to mount a partition which was not unmounted properly by Windows.
181.TP
182.B ignore_case \fP(only with lowntfs-3g)
183Ignore character case when accessing a file (\fBFOO\fR, \fBFoo\fR, \fBfoo\fR,
184etc. designate the same file). All files are displayed with lower case in
185directory listings.
186.TP
187.B remove_hiberfile
188Unlike in case of read-only mount, the read-write mount is denied if
189the NTFS volume is hibernated. One needs either to resume Windows and
190shutdown it properly, or use this option which will remove the Windows
191hibernation file. Please note, this means that the saved Windows
192session will be completely lost. Use this option under your own
193responsibility.
194.TP
195.B atime, noatime, relatime
196The
197.B atime
198option updates inode access time for each access.
199
200The
201.B noatime
202option disables inode access time updates which can speed up
203file operations and prevent sleeping (notebook) disks spinning
204up too often thus saving energy and disk lifetime.
205
206The
207.B relatime
208option is very similar to
209.B noatime.
210It updates inode access times relative to modify or change time.
211The access time is only updated if the previous access time was earlier
212than the current modify or change time. Unlike
213.B noatime
214this option doesn't break applications that need to know
215if a file has been read since the last time it was modified.
216This is the default behaviour.
217.TP
218.B delay_mtime[= value]
219Only update the file modification time and the file change time of a file
220when it is closed or when the indicated delay since the previous update has
221elapsed. The argument is a number of seconds, with a default value of 60.
222This is mainly useful for big files which are kept open for a long
223time and written to without changing their size, such as databases or file
224system images mounted as loop.
225.TP
226.B show_sys_files
227Show the metafiles in directory listings. Otherwise the default behaviour is
228to hide the metafiles, which are special files used to store the NTFS
229structure. Please note that even when this option is specified, "$MFT" may
230not be visible due to a glibc bug. Furthermore, irrespectively of
231show_sys_files, all files are accessible by name, for example you can always
232do
233"ls \-l '$UpCase'".
234.TP
235.B hide_hid_files
236Hide the hidden files and directories in directory listings, the hidden files
237and directories being the ones whose NTFS attribute have the hidden flag set.
238The hidden files will not be selected when using wildcards in commands,
239but all files and directories remain accessible by full name, for example you
240can always display the Windows trash bin directory by :
241"ls \-ld '$RECYCLE.BIN'".
242.TP
243.B hide_dot_files
244Set the hidden flag in the NTFS attribute for created files and directories
245whose first character of the name is a dot. Such files and directories
246normally do not appear in directory listings, and when the flag is set
247they do not appear in Windows directory displays either.
248When a file is renamed or linked with a new name, the hidden flag is
249adjusted to the latest name.
250.TP
251.B windows_names
252This option prevents files, directories and extended attributes to be
253created with a name not allowed by windows, either because it contains
254some not allowed character (which are the nine characters " * / : < > ? \\ | and
255those whose code is less than 0x20) or because the last character is a space
256or a dot. Existing such files can still be read (and renamed).
257.TP
258.B allow_other
259This option overrides the security measure restricting file access
260to the user mounting the filesystem. This option is only
261allowed to root, but this restriction can be overridden by
262the 'user_allow_other' option in the /etc/fuse.conf file.
263.TP
264.BI max_read= value
265With this option the maximum size of read operations can be set.
266The default is infinite. Note that the size of read requests is
267limited anyway to 32 pages (which is 128kbyte on i386).
268.TP
269.B silent
270Do nothing, without returning any error, on chmod and chown operations,
271when the \fBpermissions\fR option is not set and no user mapping file
272is defined. This option is on by default.
273.TP
274.B no_def_opts
275By default ntfs-3g acts as if "silent" (ignore errors on chmod and chown),
276"allow_other" (allow any user to access files) and "nonempty"
277(allow mounting on non-empty directories) were set, and "no_def_opts"
278cancels these default options.
279.TP
280.BI streams_interface= value
281This option controls how the user can access Alternate Data Streams (ADS) or
282in other words, named data streams. It can be set to, one of \fBnone\fR,
283\fBwindows\fR or \fBxattr\fR. If the option is set to \fBnone\fR, the user
284will have no access to the named data streams. If it is set to \fBwindows\fR
285(not possible with lowntfs-3g), then the user can access them just like in
286Windows (eg. cat file:stream). If it's set to \fBxattr\fR, then the named
287data streams are mapped to xattrs and user can manipulate them using
288\fB{get,set}fattr\fR utilities. The default is \fBxattr\fR.
289.TP
290.B user_xattr
291Same as \fBstreams_interface=\fP\fIxattr\fP.
292.TP
293.B efs_raw
294This option should only be used in backup or restore situation.
295It changes the apparent size of files and the behavior of read and
296write operation so that encrypted files can be saved and restored
297without being decrypted. The \fBuser.ntfs.efsinfo\fP extended attribute
298has also to be saved and restored for the file to be decrypted.
299.TP
300.B compression
301This option enables creating new transparently compressed files in
302directories marked for compression. A directory is marked for compression by
303setting the bit 11 (value 0x00000800) in its Windows attribute. In such a
304directory, new files are created compressed and new subdirectories are
305themselves marked for compression. The option and the flag have no effect
306on existing files.
307.TP
308.B nocompression
309This option disables creating new transparently compressed files in directories
310marked for compression. Existing compressed files can still be read and
311updated. Currently this is the default option.
312.TP
313.B big_writes
314This option prevents fuse from splitting write buffers into 4K chunks,
315enabling big write buffers to be transferred from the application in a
316single step (up to some system limit, generally 128K bytes).
317.TP
318.B debug
319Makes ntfs-3g to print a lot of debug output from libntfs-3g and FUSE.
320.TP
321.B no_detach
322Makes ntfs-3g to not detach from terminal and print some debug output.
323.SH USER MAPPING
324NTFS uses specific ids to record the ownership of files instead of
325the \fBuid\fP and \fBgid\fP used by Linux. As a consequence a mapping
326between the ids has to be defined for ownerships to be recorded into
327NTFS and recognized.
328.P
329By default, this mapping is fetched from the file \fB.NTFS-3G/UserMapping\fP
330located in the NTFS partition. The option \fBusermapping=\fP may be used
331to define another location. When the option permissions is set and
332no mapping file is found, a default mapping is used.
333.P
334Each line in the user mapping file defines a mapping. It is organized
335in three fields separated by colons. The first field identifies a \fBuid\fP,
336the second field identifies a \fBgid\fP and the third one identifies the
337corresponding NTFS id, known as a \fBSID\fP. The \fBuid\fP and the \fBgid\fP
338are optional and defining both of them for the same \fBSID\fP is not
339recommended.
340.P
341If no interoperation with Windows is needed, you can use the option
342\fBpermissions\fP to define a standard mapping. Alternately, you may define
343your own mapping by setting a single default mapping with no uid and gid. In
344both cases, files created on Linux will appear to Windows as owned by a
345foreign user, and files created on Windows will appear to Linux as owned by
346root. Just copy the example below and replace the 9 and 10-digit numbers by
347any number not greater than 4294967295. The resulting behavior is the same as
348the one with the option permission set with no ownership option and no user
349mapping file available.
350.RS
351.sp
352.B ::S-1-5-21-3141592653-589793238-462643383-10000
353.sp
354.RE
355If a strong interoperation with Windows is needed, the mapping has to be
356defined for each user and group known in both system, and the \fBSID\fPs used
357by Windows has to be collected. This will lead to a user mapping file like :
358.RS
359.sp
360.B john::S-1-5-21-3141592653-589793238-462643383-1008
361.B mary::S-1-5-21-3141592653-589793238-462643383-1009
362.B :smith:S-1-5-21-3141592653-589793238-462643383-513
363.B ::S-1-5-21-3141592653-589793238-462643383-10000
364.sp
365.RE
366.P
367The utility \fBntfs-3g.usermap\fP may be used to create such a user
368mapping file.
369.SH EXAMPLES
370Mount /dev/sda1 to /mnt/windows:
371.RS
372.sp
373.B ntfs-3g /dev/sda1 /mnt/windows
374.RE
375or
376.RS
377.B mount -t ntfs-3g /dev/sda1 /mnt/windows
378.sp
379.RE
380Mount the ntfs data partition /dev/sda3 to /mnt/data with standard Linux
381permissions applied :
382.RS
383.sp
384.B ntfs-3g -o permissions /dev/sda3 /mnt/data
385.RE
386or
387.RS
388.B mount -t ntfs-3g -o permissions /dev/sda3 /mnt/data
389.sp
390.RE
391Read\-only mount /dev/sda5 to /home/user/mnt and make user with uid 1000
392to be the owner of all files:
393.RS
394.sp
395.B ntfs-3g /dev/sda5 /home/user/mnt \-o ro,uid=1000
396.sp
397.RE
398/etc/fstab entry for the above (the sixth and last field has to be zero to
399avoid a file system check at boot time) :
400.RS
401.sp
402.B /dev/sda5 /home/user/mnt ntfs\-3g ro,uid=1000 0 0
403.sp
404.RE
405Unmount /mnt/windows:
406.RS
407.sp
408.B umount /mnt/windows
409.sp
410.RE
411.SH EXIT CODES
412To facilitate the use of the
413.B ntfs-3g
414driver in scripts, an exit code is returned to give an indication of the
415mountability status of a volume. Value 0 means success, and all other
416ones mean an error. The unique error codes are documented in the
417.BR ntfs-3g.probe (8)
418manual page.
419.SH KNOWN ISSUES
420Please see
421.RS
422.sp
423http://www.tuxera.com/support/
424.sp
425.RE
426for common questions and known issues.
427If you would find a new one in the latest release of
428the software then please send an email describing it
429in detail. You can contact the
430development team on the ntfs\-3g\-devel@lists.sf.net
431address.
432.SH AUTHORS
433.B ntfs-3g
434was based on and a major improvement to ntfsmount and libntfs which were
435written by Yura Pakhuchiy and the Linux-NTFS team. The improvements were
436made, the ntfs-3g project was initiated and currently led by long time
437Linux-NTFS team developer Szabolcs Szakacsits (szaka@tuxera.com).
438.SH THANKS
439Several people made heroic efforts, often over five or more
440years which resulted the ntfs-3g driver. Most importantly they are
441Anton Altaparmakov, Jean-Pierre André, Richard Russon, Szabolcs Szakacsits,
442Yura Pakhuchiy, Yuval Fledel, and the author of the groundbreaking FUSE
443filesystem development framework, Miklos Szeredi.
444.SH SEE ALSO
445.BR ntfs-3g.probe (8),
446.BR ntfsprogs (8),
447.BR attr (5),
448.BR getfattr (1)
449