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