NTFS-3G(8)

๐Ÿ’– ntfs-3g(8) โ€” Third Generation Read/Write NTFS Driver ๐Ÿ’–

NAME

ntfs-3g โ€” Third Generation Read/Write NTFS Driver

SYNOPSIS

ntfs-3g [-o option[,...]]  volume mount_point
mount -t ntfs-3g [-o option[,...]]  volume mount_point
lowntfs-3g [-o option[,...]]  volume mount_point
mount -t lowntfs-3g [-o option[,...]]  volume mount_point

DESCRIPTION

Okay bestie, ntfs-3g is an NTFS driver, and it is lowkey iconic: it can create, remove, rename, move files, directories, hard links, and streams; it can read and write files, including streams, sparse files and transparently compressed files; it can handle special files like symbolic links, devices, and FIFOs; and moreover it provides standard management of file ownership and permissions, including POSIX ACLs. ๐Ÿ’…

It comes in two variants, ntfs-3g and lowntfs-3g, with a few differences mentioned below in relevant options descriptions. ๐Ÿซถ

The volume to be mounted can be either a block device or an image file, either by using the mount command or starting the drive. โœจ

๐ŸงŠ Windows hibernation and fast restarting

On computers which can be dual-booted into Windows or Linux, Windows has to be fully shut down before booting into Linux, otherwise the NTFS file systems on internal disks may be left in an inconsistent state and changes made by Linux may be ignored by Windows. No cap, this part matters. ๐Ÿ˜ญ

So, Windows may not be left in hibernation when starting Linux, in order to avoid inconsistencies. Moreover, the fast restart feature available on recent Windows systems has to be disabled. This can be achieved by issuing as an Administrator the Windows command which disables both hibernation and fast restarting:

powercfg /h off

If either Windows is hibernated or its fast restart is enabled, partitions on internal disks are forced to be mounted in read-only mode. Read-only. Forced. The vibe check said no. ๐Ÿ’€

๐Ÿ” Access Handling and Security

By default, files and directories are owned by the effective user and group of the mounting process, and everybody has full read, write, execution and directory browsing permissions. You can also assign permissions to a single user by using the uid and/or the gid options together with the umask, or fmask and dmask options. ๐ŸŒธ

Doing so, all Windows users have full access to the files created by ntfs-3g.

But, by setting the permissions option, you can benefit from the full ownership and permissions features as defined by POSIX. Moreover, by defining a Windows-to-Linux user mapping, the ownerships and permissions are even applied to Windows users and conversely. Thatโ€™s the good stuff. โœจ

If ntfs-3g is set setuid-root then non-root users will be also able to mount volumes. ๐Ÿ‘‘

๐ŸŒˆ Windows Filename Compatibility

NTFS supports several filename namespaces: DOS, Win32 and POSIX. While the ntfs-3g driver handles all of them, it always creates new files in the POSIX namespace for maximum portability and interoperability reasons. This means that filenames are case sensitive and all characters are allowed except '/' and '\0'. This is perfectly legal on Windows, though some application may get confused. The option windows_names may be used to apply Windows restrictions to new file names. ๐Ÿฆ‹

๐Ÿ’ง Alternate Data Streams (ADS)

NTFS stores all data in streams. Every file has exactly one unnamed data stream and can have many named data streams. The size of a file is the size of its unnamed data stream. By default, ntfs-3g will only read the unnamed data stream.

By using the option streams_interface=windows, with the ntfs-3g driver (not possible with lowntfs-3g), you will be able to read any named data streams, simply by specifying the stream name after a colon. For example:

cat some.mp3:artist

Named data streams act like normal files, so you can read from them, write to them and even delete them (using rm). You can list all the named data streams a file has by getting the ntfs.streams.list extended attribute. ๐Ÿ“


โœจ OPTIONS โœจ

Below is a summary of the options that ntfs-3g accepts. Bestie, there are a lot of them, but weโ€™re getting through every single one. ๐Ÿ’…

  • acl โ€” Enable setting Posix ACLs on created files and use them for access control. This option is only available on specific builds. It is set by default when a user mapping file is present and the permissions mount option is not set.
  • allow_other โ€” This option overrides the security measure restricting file access to the user mounting the filesystem. This option is only allowed to root, but this restriction can be overridden by the user_allow_other option in the /etc/fuse.conf file.
  • atime, noatime, relatime โ€” The atime option updates inode access time for each access. The noatime option disables inode access time updates, which can speed up file operations and prevent sleeping (notebook) disks spinning up too often thus saving energy and disk lifetime. The relatime option is very similar to noatime. It updates inode access times relative to modify or change time. The access time is only updated if the previous access time was earlier than the current modify or change time. Unlike noatime this option doesn't break applications that need to know if a file has been read since the last time it was modified. This is the default behaviour. Main character default energy. โญ
  • big_writes โ€” This option prevents fuse from splitting write buffers into 4K chunks, enabling big write buffers to be transferred from the application in a single step (up to some system limit, generally 128K bytes).
  • compression โ€” This option enables creating new transparently compressed files in directories marked for compression. A directory is marked for compression by setting the bit 11 (value 0x00000800) in its Windows attribute. In such a directory, new files are created compressed and new subdirectories are themselves marked for compression. The option and the flag have no effect on existing files. Currently this is the default option. ๐ŸŽ€
  • debug โ€” Makes ntfs-3g (or lowntfs-3g) to print a lot of debug output from libntfs-3g and FUSE. Not me running debug mode just to watch the lore unfold. ๐Ÿ˜ญ
  • delay_mtime[= value] โ€” Only update the file modification time and the file change time of a file when it is closed or when the indicated delay since the previous update has elapsed. The argument is a number of seconds, with a default value of 60. This is mainly useful for big files which are kept open for a long time and written to without changing their size, such as databases or file system images mounted as loop.
  • dmask=value โ€” Set the bitmask of the directory permissions that are not present. The value is given in octal. The default value is 0 which means full access to everybody.
  • efs_raw โ€” This option should only be used in backup or restore situation. It changes the apparent size of files and the behavior of read and write operation so that encrypted files can be saved and restored without being decrypted. The user.ntfs.efsinfo extended attribute has also to be saved and restored for the file to be decrypted. ๐Ÿ”
  • fmask=value โ€” Set the bitmask of the file permissions that are not present. The value is given in octal. The default value is 0 which means full access to everybody.
  • force โ€” This option is obsolete. It has been superseded by the recover and norecover options. Retired. Gone. Not the moment. ๐Ÿ’€
  • hide_dot_files โ€” Set the hidden flag in the NTFS attribute for created files and directories whose first character of the name is a dot. Such files and directories normally do not appear in directory listings, and when the flag is set they do not appear in Windows directory displays either. When a file is renamed or linked with a new name, the hidden flag is adjusted to the latest name. ๐Ÿ™ˆ
  • hide_hid_files โ€” Hide the hidden files and directories in directory listings, the hidden files and directories being the ones whose NTFS attribute have the hidden flag set. The hidden files will not be selected when using wildcards in commands, but all files and directories remain accessible by full name, for example you can always display the Windows trash bin directory by: ls -ld '$RECYCLE.BIN'.
  • ignore_case (only with lowntfs-3g) โ€” Ignore character case when accessing a file (FOO, Foo, foo, etc. designate the same file). All files are displayed with lower case in directory listings. ๐ŸŒ€
  • inherit โ€” When creating a new file, set its initial protections according to inheritance rules defined in parent directory. These rules deviate from Posix specifications, but yield a better Windows compatibility. The permissions (or acl) option or a valid user mapping file is required for this option to be effective.
  • locale=value โ€” This option can be useful when wanting a language specific locale environment. It is however discouraged as it leads to files with untranslatable characters to not be visible. Bestie, the warning is right there. ๐Ÿซถ
  • max_read=value โ€” With this option the maximum size of read operations can be set. The default is infinite. Note that the size of read requests is limited anyway by the system (usually to 128kbyte).
  • no_def_opts โ€” By default ntfs-3g acts as if silent (ignore permission errors when permissions are not enabled), allow_other (allow any user to access files) and nonempty (allow mounting on non-empty directories) were set, and no_def_opts cancels these default options.
  • no_detach โ€” Makes ntfs-3g to not detach from terminal and print some debug output. Terminal clinginess, but make it diagnostic. ๐Ÿ’…
  • nocompression โ€” This option disables creating new transparently compressed files in directories marked for compression. Existing compressed files can still be read and updated.
  • norecover โ€” Do not try to mount a partition which was not unmounted properly by Windows. Respect the โ€œdo not recoverโ€ boundary, bestie.
  • permissions โ€” Set standard permissions on created files and use standard access control. This option is set by default when a user mapping file is present. ๐Ÿ‘‘
  • posix_nlink โ€” Compute the count of hard links of a file or directory according to the POSIX specifications. When this option is not set, a count of 1 is set for directories, and the short name of files is accounted for. Using the option entails some penalty as the count is not stored and has to be computed.
  • recover โ€” Recover and try to mount a partition which was not unmounted properly by Windows. The Windows logfile is cleared, which may cause inconsistencies. Currently this is the default option. ๐Ÿ”ฅ
  • remove_hiberfile โ€” okay so when the NTFS volume is hibernated, a read-write mount gets denied and a read-only mount is forced instead ๐Ÿ˜ญ. Your two options are: go resume Windows and shut it down properly like a good citizen, or use this flag, which deletes the Windows hibernation file. Just know that this means the saved Windows session is completely lost โ€” gone, poof, no takebacks ๐Ÿ’€. Use it under your own responsibility, bestie.
  • ro โ€” mount the filesystem read-only ๐ŸงŠ. Lowkey the move when Windows is hibernated or the NTFS journal file is unclean.
  • show_sys_files โ€” shows the metafiles in directory listings ๐Ÿ‘€. Default behaviour is to hide them, since metafiles are those special files that store the NTFS structure. Fair warning though: even with this option on, "$MFT" might still not show up because of a glibc bug ๐Ÿ™ˆ. And regardless of show_sys_files, every file is accessible by name anyway โ€” like, you can always do "ls -l '$UpCase'".
  • silent โ€” does nothing, and returns no error, on chmod and chown operations and on permission checking errors, when the permissions option isn't set and no user mapping file is defined ๐Ÿคซ. This one is on by default, and when it's set off (via option no_def_opts) the ownership and permissions parameters have to be set.
  • special_files=mode โ€” picks the mode for representing a special file that's about to be created (symbolic link, socket, fifo, character or block device) ๐Ÿงš. The mode can be interix or wsl, and existing files in either mode get recognized no matter which mode you picked. Interix is the traditional mode and it's the default; wsl interoperates with Windows WSL but it is not compatible with Windows versions earlier than Windows 10 โš ๏ธ. Also, neither mode is interoperable with Windows.
  • streams_interface=mode โ€” this controls how the user can access Alternate Data Streams (ADS), a.k.a. named data streams ๐ŸŒŠ. The mode can be none, windows or xattr:
    • none โ€” the user has no access to named data streams at all, sorry ๐Ÿšซ
    • windows โ€” the user can access them just like in Windows, eg. cat file:stream (not possible with lowntfs-3g!)
    • xattr โ€” named data streams get mapped to extended attributes and you can manipulate them using {get,set}fattr utilities โœจ

The default is xattr.

  • uid=value and gid=value โ€” sets the owner and the group of files and directories ๐Ÿ‘‘. The values are numerical. Defaults are the uid and gid of the current process.
  • umask=value โ€” sets the bitmask of the file and directory permissions that are not present ๐ŸŽญ. The value is given in octal. Default value is 0, which means full access to everybody โ€” yes, everybody, be careful.
  • usermapping=file-name โ€” use the file file-name as the user mapping file instead of the default .NTFS-3G/UserMapping ๐Ÿ“. If file-name defines a full path, the file must be located on a partition that was previously mounted. If it defines a relative path, it's interpreted relative to the root of the NTFS partition being mounted.

When a user mapping file is defined, the options uid=, gid=, umask=, fmask=, dmask= and silent are ignored ๐Ÿซฅ.

  • user_xattr โ€” same as streams_interface=xattr, iykyk ๐Ÿ’….
  • windows_names โ€” stops files, directories and extended attributes from being created with a name Windows doesn't allow, because:
    • it contains some not allowed character,
    • or the last character is a space or a dot,
    • or the name is reserved.

The forbidden characters are the nine characters " * / : < > ? \ | and those whose code is less than 0x20, and the reserved names are CON, PRN, AUX, NUL, COM1..COM9, LPT1..LPT9, with no suffix or followed by a dot ๐Ÿšซ.

Existing such files can still be read (and renamed) though, so it's not a full lockdown.


๐Ÿ—บ๏ธ USER MAPPING

NTFS uses specific ids to record the ownership of files instead of the uid (user id) and gid (group id) that Linux uses. So as a consequence, a mapping between the ids has to be defined for ownerships to actually be recorded into NTFS files and recognized ๐Ÿซถ.

By default, this mapping is fetched from the file .NTFS-3G/UserMapping located in the NTFS partition. The option usermapping= may be used to define another location. When the option permissions is set and no mapping file is found, a default mapping is used โœจ.

Each line in the user mapping file defines a mapping. It's organized in three fields separated by colons :. The first field identifies a uid, the second field identifies a gid, and the third one identifies the corresponding NTFS id, known as a SID. The uid and the gid are optional, and defining both of them for the same SID is not recommended ๐Ÿ™…โ€โ™€๏ธ.

If no interoperation with Windows is needed, you can use the option permissions to define a standard mapping. Alternately, you may define your own mapping by setting a single default mapping with no uid and gid. In both cases, files created on Linux will appear to Windows as owned by a foreign user, and files created on Windows will appear to Linux as owned by root ๐ŸŒˆ. Just copy the example below and replace the 9 and 10-digit numbers by any number not greater than 4294967295. The resulting behavior is the same as the one with the option permission set with no ownership option and no user mapping file available:

::S-1-5-21-3141592653-589793238-462643383-10000

If a strong interoperation with Windows is needed, the mapping has to be defined for each user and group known to both systems, and the SIDs used by Windows have to be collected ๐Ÿ•ต๏ธโ€โ™€๏ธ. This will lead to a user mapping file like:

john::S-1-5-21-3141592653-589793238-462643383-1008
mary::S-1-5-21-3141592653-589793238-462643383-1009
:smith:S-1-5-21-3141592653-589793238-462643383-513
::S-1-5-21-3141592653-589793238-462643383-10000

The utility ntfsusermap may be used to create such a user mapping file ๐Ÿ› ๏ธ.


๐ŸŒธ EXAMPLES ๐ŸŒธ

Mount /dev/sda1 to /mnt/windows:

ntfs-3g /dev/sda1 /mnt/windows

or

mount -t ntfs-3g /dev/sda1 /mnt/windows

Mount the ntfs data partition /dev/sda3 to /mnt/data with standard Linux permissions applied:

ntfs-3g -o permissions /dev/sda3 /mnt/data

or

mount -t ntfs-3g -o permissions /dev/sda3 /mnt/data

Read-only mount /dev/sda5 to /home/user/mnt and make the user with uid 1000 the owner of all files:

ntfs-3g /dev/sda5 /home/user/mnt -o ro,uid=1000

/etc/fstab entry for the above (the sixth and last field has to be zero to avoid a file system check at boot time):

/dev/sda5 /home/user/mnt ntfs-3g ro,uid=1000 0 0

Unmount /mnt/windows:

umount /mnt/windows

๐Ÿšฆ EXIT CODES

To facilitate the use of the ntfs-3g driver in scripts, an exit code is returned to give an indication of the mountability status of a volume ๐Ÿ“Š. Value 0 means success, and all other ones mean an error. The unique error codes are documented in the ntfs-3g.probe(8) manual page.


๐Ÿ’€ KNOWN ISSUES

Please see

https://github.com/tuxera/ntfs-3g/wiki/NTFS-3G-FAQ

for common questions and known issues ๐Ÿ‘€. If you find a new one in the latest release of the software, then please post an ntfs-3g issue describing it in detail so that the development team can be aware of the issue and take care of it:

https://github.com/tuxera/ntfs-3g/issues

๐Ÿ‘‘ AUTHORS

ntfs-3g was based on and a major improvement to ntfsmount and libntfs, which were written by Yura Pakhuchiy and the Linux-NTFS team ๐Ÿซถ. The improvements were made, the ntfs-3g project was initiated, and it's currently led by long time Linux-NTFS team developer Szabolcs Szakacsits (szaka@tuxera.com).


๐Ÿ’– THANKS

Several people made heroic efforts, often over five or more years, which resulted in the ntfs-3g driver ๐Ÿ†. Most importantly they are Anton Altaparmakov, Jean-Pierre Andrรฉ, Erik Larsson, Richard Russon, Szabolcs Szakacsits, Yura Pakhuchiy, Yuval Fledel, and the author of the groundbreaking FUSE filesystem development framework, Miklos Szeredi. Icons, all of them, periodt โœจ.


๐Ÿ”— SEE ALSO

ntfs-3g.probe(8), ntfsprogs(8), attr(5), getfattr(1)


And that's the whole page, bestie โ€” you ate that ๐Ÿ’…โœจ This one's ntfs-3g version 2026.9.28, dated Aug 2021, and it's the NTFS-3G(8) manual. Now go mount something responsibly ๐ŸŽ€๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from