Максимальное количество файлов в папке windows ntfs

Вы можете поместить 4,294,967,295 файлов в одну папку, если диск отформатирован в NTFS (было бы необычно, если бы это было не так), пока вы не ...

Вы можете поместить 4,294,967,295 файлов в одну папку, если диск отформатирован в NTFS (было бы необычно, если бы это было не так), при условии, что вы не превышаете 256 терабайт (размер одного файла и пространство) или все доступное дисковое пространство, в зависимости от того, что меньше.

Максимальный размер файла: 256 терабайт. Максимальное количество файлов на диске: 4,294,967,295 4,294,967,295 XNUMX XNUMX. Максимальное количество файлов в одной папке: XNUMX XNUMX XNUMX XNUMX.

Сколько папок можно хранить в папке?

5 ответов. См. Эту ссылку в Microsoft. Он предполагает, что нет ограничений на количество файлов в данной папке, пока количество файлов на любом заданном томе не превышает 4,294,967,295 32 XNUMX XNUMX (в NTFS), ссылка дает гораздо более низкие ограничения для FATXNUMX.

Какой максимальный размер файла в Windows 10?

NTFS может поддерживать тома размером до 8 петабайт в Windows Server 2019 и новее и Windows 10 версии 1709 и новее (более старые версии поддерживают до 256 ТБ). Поддерживаемые размеры томов зависят от размера кластера и количества кластеров.

Сколько файлов может быть в каталоге?

Максимальное количество файлов в каталоге: 216 — 1 (65,535 XNUMX)

Как ограничить размер папки в Windows 10?

Как настроить квоту на объем в Windows 10

  1. Откройте проводник (клавиша Windows + E).
  2. Щелкните по этому компьютеру.
  3. В разделе «Устройства и диски» щелкните правой кнопкой мыши диск, который нужно ограничить, и выберите «Свойства».
  4. Щелкните вкладку Quota.
  5. Нажмите кнопку Показать параметры квоты.
  6. Установите флажок Включить управление квотами.

10 ян. 2018 г.

Сколько подпапок можно создать в папке?

Таким образом, нет ограничений на количество уровней вложенности для папок. Однако максимальное количество подкаталогов в одном каталоге для ext3 ограничено примерно 32000.

Как мне организовать файлы и папки на моем компьютере?

Лучшие практики для организации компьютерных файлов

  1. Пропустите рабочий стол. Никогда не храните файлы на рабочем столе. …
  2. Пропустить загрузки. Не позволяйте файлам оставаться в папке «Загрузки». …
  3. Немедленно подайте документы в архив. …
  4. Сортируйте все раз в неделю. …
  5. Используйте описательные имена. …
  6. Поиск — это мощный инструмент. …
  7. Не используйте слишком много папок. …
  8. Придерживаться.

30 ночей. 2018 г.

Какая функциональность у папок в Windows?

Папки помогают хранить файлы организованными и отдельными. Если бы на вашем компьютере не было папок, все ваши документы, программы и файлы операционной системы были бы расположены в одном месте. Папки также позволяют иметь более одного файла с одним и тем же именем. Например, у вас может быть файл под названием Resume.

В чем разница между файлом и папкой?

Файл — это обычная единица хранения в компьютере, и все программы и данные «записываются» в файл и «читаются» из файла. Папка содержит один или несколько файлов, и папка может быть пустой, пока не будет заполнена. Папка также может содержать другие папки, и в папках может быть много уровней папок.

Какую файловую систему использует Windows 10?

Windows 10 использует файловую систему NTFS по умолчанию, как и Windows 8 и 8.1. Хотя в последние месяцы профессионалы ходили слухами о полном изменении новой файловой системы ReFS, последняя техническая сборка, выпущенная Microsoft, не привела к кардинальным изменениям, и Windows 10 продолжала использовать NTFS в качестве стандартной файловой системы.

Какой самый большой размер файла для exFAT?

Функции. Спецификации, функции и требования файловой системы exFAT включают в себя: Ограничение размера файла 16 эксбибайт (264-1 байта или около 1019 байтов, что в противном случае ограничено максимальным размером тома 128 ПиБ или 257-1 байтов) , увеличенный с 4 ГиБ (232-1 байт) в стандартной файловой системе FAT32.

Как передать файлы размером более 4 ГБ в FAT32?

К сожалению, нет возможности скопировать файл размером> 4 ГБ в файловую систему FAT32. И быстрый Google говорит, что ваша PS3 распознает только файловые системы FAT32. Единственный вариант — использовать файлы меньшего размера. Возможно, порежьте их на куски, прежде чем перемещать или сжимать.

Каков максимальный размер файла FAT32?

FAT32

ограничения
Максимум. размер файла 2,147,483,647 байтов (2 ГиБ — 1) (без LFS) 4,294,967,295 байтов (4 ГиБ — 1) (с LFS) 274,877,906,943 байта (256 ГиБ — 1) (только с FAT32 +)
Детализация размера файла 16 байт
Максимум. количество файлов 268,173,300 32 XNUMX для кластеров XNUMX КБ

Сколько файлов может содержать FAT32?

Максимальный размер каталога FAT32 составляет 65536 32-битных записей. Для файла потребуется как минимум 2 записи в зависимости от длины имени файла. Длинные имена файлов сохраняются в 16-битных символах UNICODE, и только тринадцать символов хранятся в каждой записи каталога. Следует избегать больших каталогов по соображениям производительности.

Сколько данных может вместить FAT32?

Размер отдельных файлов на диске FAT32 не может превышать 4 ГБ — это максимум. Раздел FAT32 также должен быть меньше 8 ТБ, что, по общему признанию, является меньшим ограничением, если вы не используете диски сверхвысокой емкости.

Какое максимальное количество файлов может присутствовать в каталоге на томе NTFS?
Тот же вопрос для каталога для тома FAT32?

NTFS: нет фиксированного лимита. Максимальное количество файлов — один верхний предел. Этот предел составляет либо 2 ^ 23-1 (в соответствии со многими реализациями драйверов), либо 2 ^ 48 -1 (в соответствии со структурой MFT_REF).
Поскольку у вас будут каталоги LARGE, вы увидите нерезидентные потоки $ BITMAP_ALLOCATION, большой поток INDEX. Индексный поток по сути является B+ деревом имен файлов.


FAT32: есть разница между корневым каталогом и подкаталогами. Корень имеет определенные ограничения.

ответ дан Dominik Weber285

В Windows Server 2012 R2 NTFS превысила 2 32 (чуть более 4 миллиардов). 
В настоящее время я использую сервер обработки документов с почти 5 миллионами файлов, как показано ниже. 
Я использую NTFS, а не ReFS, которая, как я знаю, может содержать 2 64 файла. 
NTFS в Windows 2012 R2 может содержать более 2 32 файлов.

PS E:> chkdsk /v
The type of the file system is NTFS.
Volume label is Data.

WARNING!  F parameter not specified.
Running CHKDSK in read-only mode.

Stage 1: Examining basic file system structure ...
  4992768 file records processed.
File verification completed.
  27 large file records processed.
  0 bad file records processed.

ответ дан John Groselle11

Я просто пытался переместить файлы на флешку. У меня нет счета, но между 64 и 128 это максимум, что Windows 7 будет делать. W7 предлагает, чтобы я поместил оставшиеся файлы в новый каталог.

там нет практических ограничений на объединенные размеры всех файлов в папке, хотя могут быть ограничения на количество файлов в папке. Что еще более важно, существуют ограничения на размер отдельных файлов, которые зависят от того, какую файловую систему вы используете на жестком диске. («Файловая система» — это не что иное, как спецификация того, как именно файлы хранятся на диске.)

разберем по файловой системе:

•жир aka FAT16

жир, для таблицы распределения файлов, является преемником оригинальной файловой системы FAT12, поставляемой с MS-DOS много, много лет назад.

Maximum максимальный размер диска: 4 гигабайта

◦максимальный размер файла: 4 ГБ

◦максимальное количество файлов на диске: 65,517

Maximum максимальное количество файлов в одной папке: 512 (если я правильно помню, корневая папка «/» имела нижний предел 128).

•FAT32

» там нет практических лимит на общий размер всех файлов в папке, хотя там может быть ограничения на количество файлов в папке.»FAT32 был введен для преодоления некоторых ограничений FAT16.

◦максимальный размер диска: 2 ТБ

◦максимальный размер файла: 4 ГБ

◦максимальное количество файлов на диске: 268,435,437

◦максимальное количество файлов в одной папке: 65 534

•NTFS

NTFS, или » новая технология Файловая система», введенная в Windows NT, является полностью переработанной файловой системой.

◦максимальный размер диска: 256 терабайт

◦максимальный размер файла: 256 терабайт

◦максимальное количество файлов на диске: 4,294,967,295

◦максимальное число файлов в одной папке: 4,294,967,295

обратите внимание, что когда я говорю «диск» выше, я действительно говорю о «логических» дисках, не обязательно физических. Никто не делает 256 терабайт диск, но с помощью NTFS массив дисков можно рассматривать как один логический диск. Предположительно, если у вас их достаточно, вы можете построить огромный логический диск.

Также обратите внимание, что ограничение NTFS в 256 терабайт вполне может быть просто ограничение реализации — я читал, что формат NTFS может поддерживать диски до 16 эксабайт (16 раз 1,152,921,504,606,846,976 байт).

Source

New Technology File System[1]

Developer(s) Microsoft
Full name NT File System[2]
Introduced July 1993; 29 years ago with Windows NT 3.1
Partition identifier 0x07 (MBR)
EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 (GPT)
Structures
Directory contents B-tree variant[3][4]
File allocation Bitmap
Bad blocks $BadClus (MFT Record)
Limits
Max. volume size 264 clusters − 1 cluster (format);
256 TB[a] − 64 KB[a] (Windows 10 version 1703, Windows Server 2016 or earlier implementation)[5]
8 PB − 2 MB[a] (Windows 10 version 1709, Windows Server 2019 or later implementation)[6]
Max. file size 16 EB[a] − 1 KB (format);
16 TB − 64 KB (Windows 7, Windows Server 2008 R2 or earlier implementation)[5]
256 TB − 64 KB (Windows 8, Windows Server 2012 or later implementation)[7]
8 PB − 2 MB (Windows 10 version 1709, Windows Server 2019 or later implementation)[6]
Max. number of files 4,294,967,295 (232−1)[5]
Max. filename length 255 UTF-16 code units[8]
Allowed characters in filenames
  • In Win32 namespace: any UTF-16 code unit (case-insensitive) except /:*"?<>| as well as NUL[8]
  • In POSIX namespace: any UTF-16 code unit (case-sensitive) except / as well as NUL
  • Trailing spaces are not allowed and will be removed[9]
Features
Dates recorded Creation, modification, POSIX change, access
Date range 1 January 1601 – 28 May 60056 (File times are 63-bit numbers counting 100-nanosecond intervals (ten million per second) since 1601, which is 29,227 years)
Date resolution 100 ns
Forks Yes (see § Alternate data stream (ADS) below)
Attributes Read-only, hidden, system, archive, not content indexed, off-line, temporary, compressed, encrypted
File system permissions ACLs
Transparent compression Per-file, LZ77 (Windows NT 3.51 onward)
Transparent encryption Per-file,
DESX (Windows 2000 onward),
Triple DES (Windows XP onward),
AES (Windows XP Service Pack 1, Windows Server 2003 onward)
Data deduplication Yes (Windows Server 2012)[10]
Other
Supported operating systems Windows NT 3.1 and later
Mac OS X 10.3 and later (read-only)
Linux kernel version 2.6 and later
Linux kernel versions 2.2-2.4 (read-only)
FreeBSD
NetBSD
OpenBSD (read-only)
ChromeOS
Solaris
ReactOS (read-only)

New Technology File System (NTFS) is a proprietary journaling file system developed by Microsoft.[2][1] Starting with Windows NT 3.1, it is the default file system of the Windows NT family.[11] It superseded File Allocation Table (FAT) as the preferred filesystem on Windows and is supported in Linux and BSD as well. NTFS reading and writing support is provided using a free and open-source kernel implementation known as NTFS3 in Linux and the NTFS-3G driver in BSD.[12][13] By using the convert command, Windows can convert FAT32/16/12 into NTFS without the need to rewrite all files.[14] NTFS uses several files typically hidden from the user to store metadata about other files stored on the drive which can help improve speed and performance when reading data.[1] Unlike FAT and High Performance File System (HPFS), NTFS supports access control lists (ACLs), filesystem encryption, transparent compression, sparse files and file system journaling. NTFS also supports shadow copy to allow backups of a system while it is running, but the functionality of the shadow copies varies between different versions of Windows.[15]

History[edit]

In the mid-1980s, Microsoft and IBM formed a joint project to create the next generation of graphical operating system; the result was OS/2 and HPFS. Because Microsoft disagreed with IBM on many important issues, they eventually separated; OS/2 remained an IBM project and Microsoft worked to develop Windows NT and NTFS.

The HPFS file system for OS/2 contained several important new features. When Microsoft created their new operating system, they «borrowed» many of these concepts for NTFS.[16] The original NTFS developers were Tom Miller, Gary Kimura, Brian Andrew, and David Goebel.[17]

Probably as a result of this common ancestry, HPFS and NTFS use the same disk partition identification type code (07). Using the same Partition ID Record Number is highly unusual, since there were dozens of unused code numbers available, and other major file systems have their own codes. For example, FAT has more than nine (one each for FAT12, FAT16, FAT32, etc.). Algorithms identifying the file system in a partition type 07 must perform additional checks to distinguish between HPFS and NTFS.

Versions[edit]

Microsoft has released five versions of NTFS:

NTFS version number First operating system Release date New features Remarks
1.0 Windows NT 3.1 1993[11] Initial version NTFS 1.0 is incompatible with 1.1 and newer: volumes written by Windows NT 3.5x cannot be read by Windows NT 3.1 until an update (available on the NT 3.5x installation media) is installed.[18]
1.1 Windows NT 3.51 1995 Compressed files, named streams, and access control lists[19]
1.2 Windows NT 4.0 1996 Security descriptors Commonly called NTFS 4.0 after the OS release
3.0 Windows 2000 2000 Disk quotas, file-level encryption in a form of Encrypting File System, sparse files, reparse points, update sequence number (USN) journaling, distributed link tracking, the $Extend folder and its files Compatibility was also made available for Windows NT 4.0 with the Service Pack 4 update. Commonly called NTFS 5.0 after the OS release.[20]
3.1 Windows XP October 2001 Expanded the Master File Table (MFT) entries with redundant MFT record number (useful for recovering damaged MFT files) Commonly called NTFS 5.1 after the OS release. LFS version 1.1 was replaced by version 2.0 as of Windows 8 to improve performance.

The NTFS.sys version number (e.g. v5.0 in Windows 2000) is based on the operating system version; it should not be confused with the NTFS version number (v3.1 since Windows XP).[21]

Although subsequent versions of Windows added new file system-related features, they did not change NTFS itself. For example, Windows Vista implemented NTFS symbolic links, Transactional NTFS, partition shrinking, and self-healing.[22] NTFS symbolic links are a new feature in the file system; all the others are new operating system features that make use of NTFS features already in place.

Scalability[edit]

NTFS is optimized for 4 KB[a] clusters, but supports a maximum cluster size of 2 MB[a]. (Earlier implementations support up to 64 KB)[6] The maximum NTFS volume size that the specification can support is 264 − 1 clusters, but not all implementations achieve this theoretical maximum, as discussed below.

The maximum NTFS volume size implemented in Windows XP Professional is 232 − 1 clusters, partly due to partition table limitations. For example, using 64 KB clusters, the maximum size Windows XP NTFS volume is 256 TB minus 64 KB. Using the default cluster size of 4 KB, the maximum NTFS volume size is 16 TB minus 4 KB. Both of these are vastly higher than the 128 GB[a] limit in Windows XP SP1. Because partition tables on master boot record (MBR) disks support only partition sizes up to 2 TB, multiple GUID Partition Table (GPT or «dynamic») volumes must be combined to create a single NTFS volume larger than 2 TB. Booting from a GPT volume to a Windows environment in a Microsoft supported way requires a system with Unified Extensible Firmware Interface (UEFI) and 64-bit support.[23]

The NTFS maximum theoretical limit on the size of individual files is 16 EB[a][24] (16 × 10246 or 264 bytes) minus 1 KB, which totals 18,446,744,073,709,550,592 bytes. With Windows 10 version 1709 and Windows Server 2019, the maximum implemented file size is 8 PB[a] minus 2 MB or 9,007,199,252,643,840 bytes.[6]

Interoperability[edit]

Windows[edit]

While the different NTFS versions are for the most part fully forward- and backward-compatible, there are technical considerations for mounting newer NTFS volumes in older versions of Microsoft Windows. This affects dual-booting, and external portable hard drives. For example, attempting to use an NTFS partition with «Previous Versions» (Volume Shadow Copy) on an operating system that does not support it will result in the contents of those previous versions being lost.[15] A Windows command-line utility called convert.exe can convert supporting file systems to NTFS, including HPFS (only on Windows NT 3.1, 3.5, and 3.51), FAT16 and FAT32 (on Windows 2000 and later).[25][26]

FreeBSD[edit]

FreeBSD 3.2 released in May 1999 included read-only NTFS support written by Semen Ustimenko.[27][28] This implementation was ported to NetBSD by Christos Zoulas and Jaromir Dolecek and released with NetBSD 1.5 in December 2000.[29] The FreeBSD implementation of NTFS was also ported to OpenBSD by Julien Bordet and offers native read-only NTFS support by default on i386 and amd64 platforms as of version 4.9 released 1 May 2011.[30][28]

Linux[edit]

Linux kernel versions 2.1.74 and later include a driver written by Martin von Löwis which has the ability to read NTFS partitions;[31] kernel versions 2.5.11 and later contain a new driver written by Anton Altaparmakov (University of Cambridge) and Richard Russon which supports file read.[32][33][31] The ability to write to files was introduced with kernel version 2.6.15 in 2006 which allows users to write to existing files but does not allow the creation of new ones.[34] Paragon’s NTFS driver (see below) has been merged into kernel version 5.15, and it supports read/write on normal, compressed and sparse files, as well as journal replaying.[35]

NTFS-3G is a free GPL-licensed FUSE implementation of NTFS that was initially developed as a Linux kernel driver by Szabolcs Szakacsits. It was re-written as a FUSE program to work on other systems that FUSE supports like macOS, FreeBSD, NetBSD, OpenBSD,[36] Solaris, QNX, and Haiku[37] and allows reading and writing to NTFS partitions. A performance enhanced commercial version of NTFS-3G, called «Tuxera NTFS for Mac», is also available from the NTFS-3G developers.[38]

Captive NTFS, a ‘wrapping’ driver that uses Windows’ own driver ntfs.sys, exists for Linux. It was built as a Filesystem in Userspace (FUSE) program and released under the GPL but work on Captive NTFS ceased in 2006.[39]

Linux kernel versions 5.15 onwards carry NTFS3, a fully functional NTFS Read-Write driver which works on NTFS versions up to 3.1 and is maintained primarily by the Paragon Software Group with the source code found here.

Mac OS[edit]

Mac OS X 10.3 included Ustimenko’s read-only implementation of NTFS from FreeBSD. Then in 2006 Apple hired Anton Altaparmakov to write a new NTFS implementation for Mac OS X 10.6.[40] Native NTFS write support is included in 10.6 and later, but is not activated by default, although workarounds do exist to enable the functionality. However, user reports indicate the functionality is unstable and tends to cause kernel panics.[41]

Paragon Software Group sells a read-write driver named NTFS for Mac OS X,[42] which is also included on some models of Seagate hard drives.[43]

OS/2[edit]

The NetDrive package for OS/2 (and derivatives such as eComStation and ArcaOS) supports a plugin which allows read and write access to NTFS volumes.[44][45]

DOS[edit]

There is a free-for-personal-use read/write driver for MS-DOS by Avira called «NTFS4DOS».[46][47]

Ahead Software developed a «NTFSREAD» driver (version 1.200) for DR-DOS 7.0x between 2002 and 2004. It was part of their Nero Burning ROM software.

Security[edit]

NTFS uses access control lists and user-level encryption to help secure user data.

Access control lists (ACLs)[edit]

NTFS file system permissions on a modern Windows system

In NTFS, each file or folder is assigned a security descriptor that defines its owner and contains two access control lists (ACLs). The first ACL, called discretionary access control list (DACL), defines exactly what type of interactions (e.g. reading, writing, executing or deleting) are allowed or forbidden by which user or groups of users. For example, files in the C:Program Files folder may be read and executed by all users but modified only by a user holding administrative privileges.[48] Windows Vista adds mandatory access control info to DACLs. DACLs are the primary focus of User Account Control in Windows Vista and later.

The second ACL, called system access control list (SACL), defines which interactions with the file or folder are to be audited and whether they should be logged when the activity is successful, failed or both. For example, auditing can be enabled on sensitive files of a company, so that its managers get to know when someone tries to delete them or make a copy of them, and whether he or she succeeds.[48]

Encryption[edit]

Encrypting File System (EFS) provides user-transparent encryption of any file or folder on an NTFS volume.[49] EFS works in conjunction with the EFS service, Microsoft’s CryptoAPI and the EFS File System Run-Time Library (FSRTL). EFS works by encrypting a file with a bulk symmetric key (also known as the File Encryption Key, or FEK), which is used because it takes a relatively small amount of time to encrypt and decrypt large amounts of data than if an asymmetric key cipher is used. The symmetric key that is used to encrypt the file is then encrypted with a public key that is associated with the user who encrypted the file, and this encrypted data is stored in an alternate data stream of the encrypted file. To decrypt the file, the file system uses the private key of the user to decrypt the symmetric key that is stored in the data stream. It then uses the symmetric key to decrypt the file. Because this is done at the file system level, it is transparent to the user.[50] Also, in case of a user losing access to their key, support for additional decryption keys has been built into the EFS system, so that a recovery agent can still access the files if needed. NTFS-provided encryption and NTFS-provided compression are mutually exclusive; however, NTFS can be used for one and a third-party tool for the other.

The support of EFS is not available in Basic, Home, and MediaCenter versions of Windows, and must be activated after installation of Professional, Ultimate, and Server versions of Windows or by using enterprise deployment tools within Windows domains.

Features[edit]

Journaling[edit]

NTFS is a journaling file system and uses the NTFS Log ($LogFile) to record metadata changes to the volume. It is a feature that FAT does not provide and critical for NTFS to ensure that its complex internal data structures will remain consistent in case of system crashes or data moves performed by the defragmentation API, and allow easy rollback of uncommitted changes to these critical data structures when the volume is remounted. Notably affected structures are the volume allocation bitmap, modifications to MFT records such as moves of some variable-length attributes stored in MFT records and attribute lists, and indices for directories and security descriptors.

The ($LogFile) format has evolved through several versions:

Windows Version $LogFile format version
Windows NT 4.0 1.1
Windows 2000
Windows XP
Windows Vista
Windows 7
Windows 8 2.0
Windows 8.1
Windows 10

The incompatibility of the $LogFile versions implemented by Windows 8, Windows 10, Windows 11 prevents Windows 7 (and earlier versions of Windows) from recognizing version 2.0 of the $LogFile. Backward compatibility is provided by downgrading the $LogFile to version 1.1 when an NTFS volume is cleanly dismounted. It is again upgraded to version 2.0 when mounting on a compatible version of Windows. However, when hibernating to disk in the logoff state (a.k.a. Hybrid Boot or Fast Boot, which is enabled by default), mounted file systems are not dismounted, and thus the $LogFiles of any active file systems are not downgraded to version 1.1. The inability to process version 2.0 of the $LogFile by versions of Windows older than 8.0 results in an unnecessary invocation of the CHKDSK disk repair utility. This is particularly a concern in a multi-boot scenario involving pre- and post-8.0 versions of Windows, or when frequently moving a storage device between older and newer versions. A Windows Registry setting exists to prevent the automatic upgrade of the $LogFile to the newer version. The problem can also be dealt with by disabling Hybrid Boot.[51]

The USN Journal (Update Sequence Number Journal) is a system management feature that records (in $Extend$UsnJrnl) changes to files, streams and directories on the volume, as well as their various attributes and security settings. The journal is made available for applications to track changes to the volume.[52] This journal can be enabled or disabled on non-system volumes.[53]

Hard links[edit]

The hard link feature allows different file names to directly refer to the same file contents. Hard links may link only to files in the same volume, because each volume has its own MFT.
Hard links were originally included to support the POSIX subsystem in Windows NT.[54]

Although Hard links use the same MFT record (inode) which records file metadata such as file size, modification date, and attributes, NTFS also caches this data in the directory entry as a performance enhancement. This means that when listing the contents of a directory using FindFirstFile/FindNextFile family of APIs, (equivalent to the POSIX opendir/readdir APIs) you will also receive this cached information, in addition to the name and inode. However, you may not see up-to-date information, as this information is only guaranteed to be updated when a file is closed, and then only for the directory from which the file was opened.[55] This means where a file has multiple names via hard links, updating a file via one name does not update the cached data associated with the other name. You can always obtain up-to-date data using GetFileInformationByHandle (which is the true equivalent of POSIX stat function). This can be done using a handle which has no access to the file itself (passing zero to CreateFile for dwDesiredAccess), and closing this handle has the incidental effect of updating the cached information.

Windows uses hard links to support short (8.3) filenames in NTFS. Operating system support is needed because there are legacy applications that can work only with 8.3 filenames, but support can be disabled. In this case, an additional filename record and directory entry is added, but both 8.3 and long file name are linked and updated together, unlike a regular hard link.

The NTFS file system has a limit of 1024 hard links on a file.[56]

Alternate data stream (ADS)[edit]

Alternate data streams allow more than one data stream to be associated with a filename (a fork), using the format «filename:streamname» (e.g., «text.txt:extrastream»).

NTFS Streams were introduced in Windows NT 3.1, to enable Services for Macintosh (SFM) to store resource forks. Although current versions of Windows Server no longer include SFM, third-party Apple Filing Protocol (AFP) products (such as GroupLogic’s ExtremeZ-IP) still use this feature of the file system. Very small ADSs (named «Zone.Identifier») are added by Internet Explorer and recently[when?] by other browsers to mark files downloaded from external sites as possibly unsafe to run; the local shell would then require user confirmation before opening them.[57] When the user indicates that they no longer want this confirmation dialog, this ADS is deleted.

Alternate streams are not listed in Windows Explorer, and their size is not included in the file’s size. When the file is copied or moved to another file system without ADS support the user is warned that alternate data streams cannot be preserved. No such warning is typically provided if the file is attached to an e-mail, or uploaded to a website. Thus, using alternate streams for critical data may cause problems. Microsoft provides a tool called Streams[58] to view streams on a selected volume. Starting with Windows PowerShell 3.0, it is possible to manage ADS natively with six cmdlets: Add-Content, Clear-Content, Get-Content, Get-Item, Remove-Item, Set-Content.[59]

Malware has used alternate data streams to hide code.[60] As a result, malware scanners and other special tools now check for alternate data streams.

File compression[edit]

Compression is enabled on a per-folder or per-file basis by setting the ‘compressed’ attribute. When compression is enabled on a folder, any files moved or saved to that folder will be automatically compressed using LZNT1 algorithm (a variant of LZ77).[61] The compression algorithm is designed to support cluster sizes of up to 4 KB; when the cluster size is greater than 4 KB on an NTFS volume, NTFS compression is not available.[62] Data is compressed in 16-cluster chunks (up to 64 KB in size); if the compression reduces 64 KB of data to 60 KB or less, NTFS treats the unneeded 4 KB pages like empty sparse file clusters—they are not written. This allows for reasonable random-access times as the OS merely has to follow the chain of fragments.

Compression works best with files that have repetitive content, are seldom written, are usually accessed sequentially, and are not themselves compressed. Single-user systems with limited hard disk space can benefit from NTFS compression for small files, from 4 KB to 64 KB or more, depending on compressibility. Files smaller than approximately 900 bytes are stored within the directory entry of the MFT.[63]

Advantages[edit]

Users of fast multi-core processors will find improvements in application speed by compressing their applications and data as well as a reduction in space used. Even when SSD controllers already compress data, there is still a reduction in I/Os since less data is transferred.[64]

According to research by Microsoft’s NTFS Development team, 50–60 GB is a reasonable maximum size for a compressed file on an NTFS volume with a 4 KB (default) cluster (block) size. This reasonable maximum size decreases sharply for volumes with smaller cluster sizes.[65]

Disadvantages[edit]

Large compressible files become highly fragmented since every chunk smaller than 64 KB becomes a fragment.[65][66] Flash memory, such as SSD drives do not have the head movement delays and high access time of mechanical hard disk drives, so fragmentation has only a smaller penalty.

If system files that are needed at boot time (such as drivers, NTLDR, winload.exe, or BOOTMGR) are compressed, the system may fail to boot correctly, because decompression filters are not yet loaded.[67][failed verification] Later editions of Windows[which?] do not allow important system files to be compressed.

System compression[edit]


Since Windows 10, Microsoft has introduced new file compression scheme based on the XPRESS algorithm with 4K/8K/16K block size[68] and the LZX algorithm;[69] both are variants of LZ77 updated with Huffman entropy coding and range coding, which LZNT1 lacked. These compression algorithms were taken from Windows Imaging Format (WIM file).

The new compression scheme is used by CompactOS feature, which reduces disk usage by compressing Windows system files.[70] CompactOS is not an extension of NTFS file compression and does not use the ‘compressed’ attribute; instead, it sets a reparse point on each compressed file with a WOF (Windows Overlay Filter) tag,[71] but the actual data is stored in an alternate data stream named «WofCompressedData», which is decompressed on-the-fly by a WOF filesystem filter driver, and the main file is an empty sparse file.[71] This design is meant purely for read-only access, so any writes to compressed files result in an automatic decompression.[71][72][73]

CompactOS compression is intended for OEMs who prepare OS images with the /compact flag of the DISM tool in Windows ADK,[74] but it can also be manually turned on per file with the /exe flag of the compact command.[75] CompactOS algorithm avoids file fragmentation by writing compressed data in contiguously allocated chunks, unlike core NTFS compression.[citation needed]

CompactOS file compression is an improved version of WIMBoot feature introduced in Windows 8.1. WIMBoot reduces Windows disk usage by keeping system files in a compressed WIM image on a separate hidden disk partition.[76] Similarly to CompactOS, Windows system directories only contain sparse files marked by a reparse point with a WOF tag, and Windows Overlay Filter driver decompresses file contents on-the-fly from the WIM image. WIMBoot is less effective than CompactOS though, as new updated versions of system files need to be written to the system partition, consuming disk space.[71]

Sparse files[edit]

A sparse file: Empty bytes don’t need to be saved, thus they can be represented by metadata.

One petabyte (1,125,899,906,842,624 bytes) of sparse files, 0 bytes on disk.

Sparse files are files interspersed with empty segments for which no actual storage space is used. To the applications, the file looks like an ordinary file with empty regions seen as regions filled with zeros; the file system maintains an internal list of such regions for each sparse file.[77] A sparse file does not necessarily include sparse zeros areas; the «sparse file» attribute just means that the file is allowed to have them.

Database applications, for instance, may use sparse files.[78] As with compressed files, the actual sizes of sparse files are not taken into account when determining quota limits.[79]

Volume Shadow Copy[edit]

The Volume Shadow Copy Service (VSS) keeps historical versions of files and folders on NTFS volumes by copying old, newly overwritten data to shadow copy via copy-on-write technique. The user may later request an earlier version to be recovered. This also allows data backup programs to archive files currently in use by the file system.

Windows Vista also introduced persistent shadow copies for use with System Restore and Previous Versions features. Persistent shadow copies, however, are deleted when an older operating system mounts that NTFS volume. This happens because the older operating system does not understand the newer format of persistent shadow copies.[80]

Transactions[edit]

As of Windows Vista, applications can use Transactional NTFS (TxF) to group multiple changes to files together into a single transaction. The transaction will guarantee that either all of the changes happen, or none of them do, and that no application outside the transaction will see the changes until they are committed.[81]

It uses similar techniques as those used for Volume Shadow Copies (i.e. copy-on-write) to ensure that overwritten data can be safely rolled back, and a CLFS log to mark the transactions that have still not been committed, or those that have been committed but still not fully applied (in case of system crash during a commit by one of the participants).

Transactional NTFS does not restrict transactions to just the local NTFS volume, but also includes other transactional data or operations in other locations such as data stored in separate volumes, the local registry, or SQL databases, or the current states of system services or remote services. These transactions are coordinated network-wide with all participants using a specific service, the DTC, to ensure that all participants will receive same commit state, and to transport the changes that have been validated by any participant (so that the others can invalidate their local caches for old data or rollback their ongoing uncommitted changes). Transactional NTFS allows, for example, the creation of network-wide consistent distributed file systems, including with their local live or offline caches.

Microsoft now advises against using TxF: «Microsoft strongly recommends developers utilize alternative means» since «TxF may not be available in future versions of Microsoft Windows».[82]

Quotas[edit]

Disk quotas were introduced in NTFS v3. They allow the administrator of a computer that runs a version of Windows that supports NTFS to set a threshold of disk space that users may use. It also allows administrators to keep track of how much disk space each user is using. An administrator may specify a certain level of disk space that a user may use before they receive a warning, and then deny access to the user once they hit their upper limit of space. Disk quotas do not take into account NTFS’s transparent file-compression, should this be enabled. Applications that query the amount of free space will also see the amount of free space left to the user who has a quota applied to them.

Reparse points[edit]

Introduced in NTFS v3, NTFS reparse points are used by associating a reparse tag in the user space attribute of a file or directory. Microsoft includes several default tags including symbolic links, directory junction points and volume mount points. When the Object Manager parses a file system name lookup and encounters a reparse attribute, it will reparse the name lookup, passing the user controlled reparse data to every file system filter driver that is loaded into Windows. Each filter driver examines the reparse data to see whether it is associated with that reparse point, and if that filter driver determines a match, then it intercepts the file system request and performs its special functionality.

Limitations[edit]

Resizing[edit]

Starting with Windows Vista Microsoft added the built-in ability to shrink or expand a partition. However, this ability does not relocate page file fragments or files that have been marked as unmovable, so shrinking a volume will often require relocating or disabling any page file, the index of Windows Search, and any Shadow Copy used by System Restore. Various third-party tools are capable of resizing NTFS partitions.

OneDrive[edit]

Since 2017, Microsoft requires the OneDrive file structure to reside on an NTFS disk.[83] This is because OneDrive Files On-Demand feature uses NTFS reparse points to link files and folders that are stored in OneDrive to the local filesystem, making the file or folder unusable with any previous version of Windows, with any other NTFS file system driver, or any file system and backup utilities not updated to support it.[84]

Structure[edit]

NTFS is made up of several components including: a partition boot sector (PBS) that holds boot information; the master file table that stores a record of all files and folders in the filesystem; a series of meta files that help structure meta data more efficiently; data streams and locking mechanisms.

Internally, NTFS uses B-trees to index file system data. A file system journal is used to guarantee the integrity of the file system metadata but not individual files’ content. Systems using NTFS are known to have improved reliability compared to FAT file systems.[85]

NTFS allows any sequence of 16-bit values for name encoding (e.g. file names, stream names or index names) except 0x0000. This means UTF-16 code units are supported, but the file system does not check whether a sequence is valid UTF-16 (it allows any sequence of short values, not restricted to those in the Unicode standard). In Win32 namespace, any UTF-16 code units are case insensitive whereas in POSIX namespace they are case sensitive. File names are limited to 255 UTF-16 code units. Certain names are reserved in the volume root directory and cannot be used for files. These are $MFT, $MFTMirr, $LogFile, $Volume, $AttrDef, . (dot), $Bitmap, $Boot, $BadClus, $Secure, $UpCase, and $Extend.[5] . (dot) and $Extend are both directories; the others are files. The NT kernel limits full paths to 32,767 UTF-16 code units. There are some additional restrictions on code points and file names.[86]

Partition Boot Sector (PBS)[edit]

This boot partition format is roughly based upon the earlier FAT filesystem, but the fields are in different locations. Some of these fields, especially the «sectors per track», «number of heads» and «hidden sectors» fields may contain dummy values on drives where they either do not make sense or are not determinable.

The OS first looks at the 8 bytes at 0x30 to find the cluster number of the $MFT, then multiplies that number by the number of sectors per cluster (1 byte found at 0x0D). This value is the sector offset (LBA) to the $MFT, which is described below.

Master File Table[edit]

In NTFS, all file, directory and metafile data—file name, creation date, access permissions (by the use of access control lists), and size—are stored as metadata in the Master File Table (MFT). This abstract approach allowed easy addition of file system features during Windows NT’s development—an example is the addition of fields for indexing used by the Active Directory and the Windows Search. This also enables fast file search software to locate named local files and folders included in the MFT very quickly, without requiring any other index.

The MFT structure supports algorithms which minimize disk fragmentation.[89] A directory entry consists of a filename and a «file ID» (analogous to the inode number), which is the record number representing the file in the Master File Table. The file ID also contains a reuse count to detect stale references. While this strongly resembles the W_FID of Files-11, other NTFS structures radically differ.

A partial copy of the MFT, called the MFT mirror, is stored to be used in case of corruption.[90] If the first record of the MFT is corrupted, NTFS reads the second record to find the MFT mirror file. Locations for both files are stored in the boot sector.[91]

Metafiles[edit]

NTFS contains several files that define and organize the file system. In all respects, most of these files are structured like any other user file ($Volume being the most peculiar), but are not of direct interest to file system clients.[92] These metafiles define files, back up critical file system data, buffer file system changes, manage free space allocation, satisfy BIOS expectations, track bad allocation units, and store security and disk space usage information. All content is in an unnamed data stream, unless otherwise indicated.

These metafiles are treated specially by Windows, handled directly by the NTFS.SYS driver and are difficult to directly view: special purpose-built tools are needed.[93] As of Windows 7, the NTFS driver completely prohibits user access, resulting in a BSoD whenever an attempt to execute a metadata file is made. One such tool is the nfi.exe («NTFS File Sector Information Utility») that is freely distributed as part of the Microsoft «OEM Support Tools». For example, to obtain information on the «$MFT»-Master File Table Segment the following command is used: nfi.exe c:$MFT[94] Another way to bypass the restriction is to use 7-Zip’s file manager and go to the low-level NTFS path \.X: (where X: resembles any drive/partition). Here, 3 new folders will appear: $EXTEND, [DELETED] (a pseudo-folder that 7-Zip uses to attach files deleted from the file system to view), and [SYSTEM] (another pseudo-folder that contains all the NTFS metadata files). This trick can be used from removable devices (USB flash drives, external hard drives, SD Cards, etc.) inside Windows, but doing this on the active partition requires offline access (namely WinRE).

Attribute lists, attributes, and streams[edit]

For each file (or directory) described in the MFT record, there is a linear repository of stream descriptors (also named attributes), packed together in one or more MFT records (containing the so-called attributes list), with extra padding to fill the fixed 1 KB size of every MFT record, and that fully describes the effective streams associated with that file.

Each attribute has an attribute type (a fixed-size integer mapping to an attribute definition in file $AttrDef), an optional attribute name (for example, used as the name for an alternate data stream), and a value, represented in a sequence of bytes. For NTFS, the standard data of files, the alternate data streams, or the index data for directories are stored as attributes.

According to $AttrDef, some attributes can be either resident or non-resident. The $DATA attribute, which contains file data, is such an example. When the attribute is resident (which is represented by a flag), its value is stored directly in the MFT record. Otherwise, clusters are allocated for the data, and the cluster location information is stored as data runs in the attribute.

  • For each file in the MFT, the attributes identified by attribute type, attribute name must be unique. Additionally, NTFS has some ordering constraints for these attributes.
  • There is a predefined null attribute type, used to indicate the end of the list of attributes in one MFT record. It must be present as the last attribute in the record (all other storage space available after it will be ignored and just consists of padding bytes to match the record size in the MFT).
  • Some attribute types are required and must be present in each MFT record, except unused records that are just indicated by null attribute types.
    • This is the case for the $STANDARD_INFORMATION attribute that is stored as a fixed-size record and contains the timestamps and other basic single-bit attributes (compatible with those managed by FAT in DOS or Windows 9x).
  • Some attribute types cannot have a name and must remain anonymous.
    • This is the case for the standard attributes, or for the preferred NTFS «filename» attribute type, or the «short filename» attribute type, when it is also present (for compatibility with DOS-like applications, see below). It is also possible for a file to contain only a short filename, in which case it will be the preferred one, as listed in the Windows Explorer.
    • The filename attributes stored in the attribute list do not make the file immediately accessible through the hierarchical file system. In fact, all the filenames must be indexed separately in at least one other directory on the same volume. There it must have its own MFT record and its own security descriptors and attributes that reference the MFT record number for this file. This allows the same file or directory to be «hardlinked» several times from several containers on the same volume, possibly with distinct filenames.
  • The default data stream of a regular file is a stream of type $DATA but with an anonymous name, and the ADSs are similar but must be named.
  • On the other hand, the default data stream of directories has a distinct type, but are not anonymous: they have an attribute name («$I30» in NTFS 3+) that reflects its indexing format.

All attributes of a given file may be displayed by using the nfi.exe («NTFS File Sector Information Utility») that is freely distributed as part of the Microsoft «OEM Support Tools».[94]

Windows system calls may handle alternate data streams.[5] Depending on the operating system, utility and remote file system, a file transfer might silently strip data streams.[5] A safe way of copying or moving files is to use the BackupRead and BackupWrite system calls, which allow programs to enumerate streams, to verify whether each stream should be written to the destination volume and to knowingly skip unwanted streams.[5]

Resident vs. non-resident attributes[edit]

To optimize the storage and reduce the I/O overhead for the very common case of attributes with very small associated value, NTFS prefers to place the value within the attribute itself (if the size of the attribute does not then exceed the maximum size of an MFT record), instead of using the MFT record space to list clusters containing the data; in that case, the attribute will not store the data directly but will just store an allocation map (in the form of data runs) pointing to the actual data stored elsewhere on the volume.[95] When the value can be accessed directly from within the attribute, it is called «resident data» (by computer forensics workers). The amount of data that fits is highly dependent on the file’s characteristics, but 700 to 800 bytes is common in single-stream files with non-lengthy filenames and no ACLs.

  • Some attributes (such as the preferred filename, the basic file attributes) cannot be made non-resident. For non-resident attributes, their allocation map must fit within MFT records.
  • Encrypted-by-NTFS, sparse data streams, or compressed data streams cannot be made resident.
  • The format of the allocation map for non-resident attributes depends on its capability of supporting sparse data storage. In the current implementation of NTFS, once a non-resident data stream has been marked and converted as sparse, it cannot be changed back to non-sparse data, so it cannot become resident again, unless this data is fully truncated, discarding the sparse allocation map completely.
  • When a non-resident attribute is so fragmented, that its effective allocation map cannot fit entirely within one MFT record, NTFS stores the attribute in multiple records. The first one among them is called the base record, while the others are called extension records. NTFS creates a special attribute $ATTRIBUTE_LIST to store information mapping different parts of the long attribute to the MFT records, which means the allocation map may be split into multiple records. The $ATTRIBUTE_LIST itself can also be non-resident, but its own allocation map must fit within one MFT record.
  • When there are too many attributes for a file (including ADS’s, extended attributes, or security descriptors), so that they cannot fit all within the MFT record, extension records may also be used to store the other attributes, using the same format as the one used in the base MFT record, but without the space constraints of one MFT record.

The allocation map is stored in a form of data runs with compressed encoding. Each data run represents a contiguous group of clusters that store the attribute value. For files on a multi-GB volume, each entry can be encoded as 5 to 7 bytes, which means a 1 KB MFT record can store about 100 such data runs. However, as the $ATTRIBUTE_LIST also has a size limit, it is dangerous to have more than 1 million fragments of a single file on an NTFS volume, which also implies that it is in general not a good idea to use NTFS compression on a file larger than 10 GB.[96]

The NTFS file system driver will sometimes attempt to relocate the data of some of the attributes that can be made non-resident into the clusters, and will also attempt to relocate the data stored in clusters back to the attribute inside the MFT record, based on priority and preferred ordering rules, and size constraints.

Since resident files do not directly occupy clusters («allocation units»), it is possible for an NTFS volume to contain more files on a volume than there are clusters. For example, a 74.5 GB partition NTFS formats with 19,543,064 clusters of 4 KB. Subtracting system files (a 64 MB log file, a 2,442,888-byte Bitmap file, and about 25 clusters of fixed overhead) leaves 19,526,158 clusters free for files and indices. Since there are four MFT records per cluster, this volume theoretically could hold almost 4 × 19,526,158 = 78,104,632 resident files.

Opportunistic locks[edit]

Opportunistic file locks (oplocks) allow clients to alter their buffering strategy for a given file or stream in order to increase performance and reduce network use.[97] Oplocks apply to the given open stream of a file and do not affect oplocks on a different stream.

Oplocks can be used to transparently access files in the background. A network client may avoid writing information into a file on a remote server if no other process is accessing the data, or it may buffer read-ahead data if no other process is writing data.

Windows supports four different types of oplocks:

  • Level 2 (or shared) oplock: multiple readers, no writers (i.e. read caching).
  • Level 1 (or exclusive) oplock: exclusive access with arbitrary buffering (i.e. read and write caching).
  • Batch oplock (also exclusive): a stream is opened on the server, but closed on the client machine (i.e. read, write and handle caching).
  • Filter oplock (also exclusive): applications and file system filters can «back out» when others try to access the same stream (i.e. read and write caching) (since Windows 2000)

Opportunistic locks have been enhanced in Windows 7 and Windows Server 2008 R2 with per-client oplock keys.[98]

Time[edit]

Windows NT and its descendants keep internal timestamps as UTC and make the appropriate conversions for display purposes; all NTFS timestamps are in UTC.[citation needed]

For historical reasons, the versions of Windows that do not support NTFS all keep time internally as local zone time, and therefore so do all file systems – other than NTFS – that are supported by current versions of Windows. This means that when files are copied or moved between NTFS and non-NTFS partitions, the OS needs to convert timestamps on the fly. But if some files are moved when daylight saving time (DST) is in effect, and other files are moved when standard time is in effect, there can be some ambiguities in the conversions. As a result, especially shortly after one of the days on which local zone time changes, users may observe that some files have timestamps that are incorrect by one hour. Due to the differences in implementation of DST in different jurisdictions, this can result in a potential timestamp error of up to 4 hours in any given 12 months.[99]

See also[edit]

  • Comparison of file systems
  • NTFSDOS
  • ntfsresize
  • WinFS (a canceled Microsoft filesystem)
  • ReFS, a newer Microsoft filesystem

Notes[edit]

  1. ^ a b c d e f g h i 1 byte = 8 bits
    1 KB = 1,024 bytes
    1 MB = 1,048,576 bytes
    1 GB = 1,073,741,824 bytes
    1 TB = 1,099,511,627,776 bytes
    1 PB = 1,125,899,906,842,624 bytes
    1 EB = 1,152,921,504,606,846,976 bytes

References[edit]

  1. ^ a b c Karresand, Martin; Axelsson, Stefan; Dyrkolbotn, Geir Olav (2019-07-01). «Using NTFS Cluster Allocation Behavior to Find the Location of User Data». Digital Investigation. 29: –51–S60. doi:10.1016/j.diin.2019.04.018. ISSN 1742-2876. S2CID 199004263. Retrieved 2021-12-01.
  2. ^ a b «Glossary». [MS-EFSR]: Encrypting File System Remote (EFSRPC) Protocol. Microsoft. 14 November 2013.
  3. ^ «How NTFS Works». TechNet. Microsoft. Retrieved 2 December 2017.
  4. ^ «B*Trees — NTFS Directory Trees — Concept — NTFS Documentation». flatcap.org. Archived from the original on 2019-05-13. Retrieved 2019-05-13.
  5. ^ a b c d e f g «How NTFS Works». Windows Server 2003 Technical Reference. 2003-03-28. Retrieved 2011-09-12.
  6. ^ a b c d «Appendix A: Product Behavior». [MS-FSA]: File System Algorithms. Microsoft. 2018-09-12. Retrieved 2018-10-01. NTFS uses a default cluster size of 4 KB, a maximum cluster size of 64 KB on Windows 10 v1703 operating system and Windows Server 2016 and prior, and 2 MB on Windows 10 v1709 operating system and Windows Server 2019 and later, and a minimum cluster size of 512 bytes.
  7. ^ «Appendix A: Product Behavior». [MS-FSA]: File System Algorithms. Microsoft. 14 November 2013. Retrieved 2012-09-21.
  8. ^ a b Russon, Richard; Fledel, Yuval. «NTFS Documentation» (PDF). Archived (PDF) from the original on 2022-10-09. Retrieved 2011-06-26.
  9. ^ «WineHQ Bugzilla – Bug 51808 – the issue with trailing spaces (Spaces at the end of a filename)».
  10. ^ Rick Vanover (14 September 2011). «Windows Server 8 data deduplication». Retrieved 2011-12-02.
  11. ^ a b Custer, Helen (1994). Inside the Windows NT File System. Microsoft Press. ISBN 978-1-55615-660-1.
  12. ^ «NTFS3 — The Linux Kernel documentation». www.kernel.org. Retrieved 2021-12-02.
  13. ^ «ntfs-3g». www.freebsd.org. Retrieved 2021-12-02.
  14. ^ «How to Convert a Drive from FAT32 to NTFS without Data Loss». WindowsLoop. 11 July 2021. Retrieved 8 August 2021.
  15. ^ a b cfsbloggers (July 14, 2006). «How restore points and other recovery features in Windows Vista are affected when dual-booting with Windows XP». The Filing Cabinet. Retrieved 2007-03-21.
  16. ^ Kozierok, Charles (14 February 2018). «Overview and History of NTFS». The PC Guide. Retrieved May 30, 2019.
  17. ^ Custer, Helen (1994). Inside the Windows NT File System. Microsoft Press. p. vii. ISBN 978-1-55615-660-1.
  18. ^ «Recovering Windows NT After a Boot Failure on an NTFS Drive». Microsoft. November 1, 2006.
  19. ^ a b Russinovich, Mark. «Inside Win2K NTFS, Part 1». MSDN. Microsoft. Retrieved 2008-04-18.
  20. ^ «What’s New in Windows NT 4.0 Service Pack 4?». Microsoft.com. 12 January 1999. Archived from the original on 17 January 1999. Retrieved 17 August 2018.
  21. ^ «New Capabilities and Features of the NTFS 3.1 File System». Microsoft. 1 December 2007.
  22. ^ Loveall, John (2006). «Storage improvements in Windows Vista and Windows Server 2008» (PowerPoint). Microsoft. pp. 14–20. Retrieved 2007-09-04.
  23. ^ «Booting from GPT». Rodsbooks.com. Retrieved 22 September 2018.
  24. ^ «NTFS vs FAT vs exFAT — NTFS.com». www.ntfs.com. Retrieved 2021-01-19.
  25. ^ «How to Convert FAT Disks to NTFS». Microsoft. 18 December 2017. Retrieved May 30, 2019.
  26. ^ «How to use Convert.exe to convert a partition to the NTFS file system». Microsoft Corporation. 2007-02-12. Retrieved 2010-12-26.
  27. ^ «FreeBSD 3.2 Release Notes». 17 May 1999. Retrieved 2020-06-15.
  28. ^ a b «mount_ntfs — OpenBSD manual pages». Retrieved 2020-06-15.
  29. ^ «Announcing NetBSD 1.5». 6 December 2000. Retrieved 2020-06-15.
  30. ^ «OpenBSD 4.9». Openbsd.com. Retrieved 22 September 2018.
  31. ^ a b «NTFS Credits and History». Linux-NTFS Project. Retrieved 2021-09-05.
  32. ^ «Kernel development». lwn.net. 2 May 2002. Retrieved 2021-09-05.
  33. ^ «Release notes for v2.5.11». 29 April 2002. Retrieved 2021-09-05.
  34. ^ «2.6.15 changelog». Linux project. 3 January 2006. Retrieved 2021-09-05.
  35. ^ Anderson, Tim (2021-09-06). «GitHub merges ‘useless garbage’ says Linus Torvalds as new NTFS support added to Linux kernel 5.15». The Register. Retrieved 2021-09-07.
  36. ^ «OpenBSD adds fuse(4) support for adding file systems in userland». OpenBSD Journal. 2013-11-08. Retrieved 2013-11-08.
  37. ^ «NTFS-3G Stable Read/Write Driver». 2009-07-25.
  38. ^ «Tuxera NTFS for Mac». Tuxera. August 30, 2011. Retrieved September 20, 2011.
  39. ^ «Jan Kratochvil: Captive: The first free NTFS read/write filesystem for GNU/Linux». Retrieved 2020-06-15.
  40. ^ «About Tuxera». Retrieved 2020-06-15.
  41. ^ «10.6: Enable native NTFS read/write support». 1 October 2009. Retrieved 5 September 2021.
  42. ^ «NTFS for Mac OS X, communication channel between Mac OS X and Windows». Paragon Software Group. Retrieved September 20, 2011.
  43. ^ «The Leader in Mass Data Storage Solutions | Seagate US». Seagate.com. Archived from the original on February 10, 2011.
  44. ^ «NTFS plugin for NetDrive». ecsoft2.org. Retrieved 2020-09-09.
  45. ^ «NetDrive for OS/2». arcanoae.com. Retrieved 2020-09-09.
  46. ^ «Avira NTFS4DOS Personal». Archived from the original on June 19, 2010. Retrieved 2009-07-25.
  47. ^ «Download Avira NTFS4DOS Personal 1.9». Archived from the original on 10 November 2013. Retrieved 22 September 2018.
  48. ^ a b «How Security Descriptors and Access Control Lists Work». TechNet. Microsoft. Retrieved 4 September 2015.
  49. ^ Morello, John (February 2007). «Security Watch Deploying EFS: Part 1». Technet Magazine. Microsoft. Retrieved 2009-01-25.
  50. ^ «How EFS Works». Windows 2000 Resource Kit. Microsoft. Retrieved 25 February 2014.
  51. ^ «Windows 8 volume compatibility considerations with prior versions of Windows». Retrieved 2021-12-17.
  52. ^ «Change Journals (Windows)». MSDN. Retrieved 2010-04-16.
  53. ^ «Creating, Modifying, and Deleting a Change Journal (Windows)». MSDN. Retrieved 2010-04-16.
  54. ^ «Chapter 29 – POSIX Compatibility». MS Windows NT Workstation 4.0 Resource Guide. Microsoft. 1995. Retrieved 21 October 2013.
  55. ^ «Hard Links and Junctions». MSDN. Microsoft. 12 October 2013. Retrieved 21 October 2013.
  56. ^ «MSDN – CreateHardLink function». Retrieved 14 January 2016.
  57. ^ Russinovich, Mark E.; Solomon, David A.; Ionescu, Alex (2009). «File Systems». Windows Internals (5th ed.). Microsoft Press. p. 921. ISBN 978-0-7356-2530-3. One component in Windows that uses multiple data streams is the Attachment Execution Service[…] depending on which zone the file was downloaded from […] Windows Explorer might warn the user
  58. ^ «Streams — Windows Sysinternals». Technet.microsoft.com. Retrieved 22 September 2018.
  59. ^ «FileSystem Provider». Microsoft. 9 August 2012. Archived from the original on 23 January 2015. Retrieved 23 January 2015.
  60. ^ Malware utilising Alternate Data Streams? Archived 2008-07-23 at the Wayback Machine, AusCERT Web Log, 21 August 2007
  61. ^ «File Compression and Decompression». MSDN Platform SDK: File Systems. Retrieved 2005-08-18.
  62. ^ «The Default Cluster Size for the NTFS and FAT File Systems». Microsoft. January 31, 2002. Retrieved 2012-01-10.
  63. ^ «How NTFS Works». 2003-03-28. Retrieved 2011-10-24.
  64. ^ Masiero, Manuel (2011-12-01). «Should You Compress Data On Your SSD?». Tom’s Hardware. Bestofmedia Group. Retrieved 2013-04-05.
  65. ^ a b Middleton, Dennis. «Understanding NTFS Compression». Ntdebugging Blog. Microsoft. Retrieved 2011-03-16.
  66. ^ «Shrinking the gap: carving NTFS-compressed files». Retrieved 2011-05-29.
  67. ^ «Disk Concepts and Troubleshooting». Microsoft. Retrieved 2012-03-26.
  68. ^ «[MS-XCA]: Xpress Compression Algorithm».
  69. ^ wimlib: the open source Windows Imaging (WIM) library — Compression algorithm
  70. ^ «Compact OS, single-instancing, and image optimization». Microsoft. Retrieved 1 October 2019.
  71. ^ a b c d Raymond Chen.What is WofCompressedData? Does WOF mean that Windows is a dog? Microsoft DevBlogs.
  72. ^ Biggers, Eric (29 April 2019). «NTFS-3G plugin for reading «system compressed» files». GitHub. Retrieved 1 October 2019.
  73. ^ «Re: [ntfs-3g-devel] Experimental support for Windows 10 «System Compressed» files». SourceForge.net. Retrieved 1 October 2019.
  74. ^ «DISM Overview».
  75. ^ «Compact».
  76. ^ Windows Image File Boot (WIMBoot) Overview
  77. ^ «Sparse Files». MSDN. Microsoft. 12 October 2013. Retrieved 21 October 2013.
  78. ^ Kandoth, Suresh B. (4 March 2009). «Sparse File Errors: 1450 or 665 due to file fragmentation: Fixes and Workarounds». CSS SQL Server Engineers. Microsoft. Retrieved 21 October 2013.
  79. ^ «Sparse Files and Disk Quotas». MSDN Library. Microsoft. 12 October 2013. Retrieved 21 October 2013.
  80. ^ cfsbloggers (July 14, 2006). «How restore points and other recovery features in Windows Vista are affected when you dual-boot with Windows XP». The Filing Cabinet. Retrieved 2007-03-21.
  81. ^ «Transactional NTFS». MSDN. Microsoft. Retrieved 2007-02-02.
  82. ^ «Transactional NTFS (TxF)». Windows Dev Center (MSDN). Microsoft. Retrieved 24 May 2015.
  83. ^ «Unable to open content synced in a OneDrive folder on an external drive». Microsoft Support. Retrieved 2021-04-03.
  84. ^ André, Jean-Pierre (March 1, 2019). «NTFS-3G: Junction Points, Symbolic Links and Reparse Points». jp-andre.pagesperso-orange.fr.
  85. ^ «Chapter 18 – Choosing a File System». MS Windows NT Workstation 4.0 Resource Guide. Microsoft. Retrieved 25 February 2014.
  86. ^ «Naming Files, Paths, and Namespaces». MSDN. Microsoft. Naming Conventions. Retrieved 25 February 2014.
  87. ^ «NTFS. Partition Boot Sector». Ntfs.com. Retrieved 22 September 2018.
  88. ^ «Boot Sector». Technet.microsoft.com. September 11, 2008. Table 1.13 BPB and Extended BPB Fields on NTFS Volumes. Retrieved 22 September 2018.
  89. ^ «Master File Table». MSDN. July 2, 2012.
  90. ^ «Forensics: What is the MFT Mirror?». Where is Your Data?. 2009-06-05. Retrieved 2021-07-30.
  91. ^ «NTFS Master File Table (MFT)». Ntfs.com. Retrieved 22 September 2018.
  92. ^ Schwarz, Thomas. «COEN 252 Computer Forensics NTFS». Faculty of Organization and Informatics University of Zagreb. Archived from the original on 2021-02-27. Retrieved May 30, 2019.
  93. ^ Since Windows XP, it is very difficult to view a listing of these files: they exist in the root directory’s index, but the Win32 interface filters them out. In NT 4.0, the command line dir command would list the metafiles in the root directory if /a were specified. In Windows 2000, dir /a stopped working, but dir /a $MFT worked.
  94. ^ a b «OEM Support Tools Phase 3 Service Release 2 Availability». Microsoft Corporation. 2007-02-21. Archived from the original on 2015-02-23. Retrieved 2010-06-16. Windows NT File System (NTFS) File Sector Information Utility … A tool used to dump information about an NTFS volume
  95. ^ «The Four Stages of NTFS File Growth». Retrieved 22 September 2018.
  96. ^ «A heavily fragmented file in an NTFS volume may not grow beyond a certain size». Archived from the original on 2021-05-06. Retrieved 2021-05-19.
  97. ^ «How Oplocks function in the Windows Environment: Overview». Archived from the original on 2010-08-23. Retrieved 2018-12-19.
  98. ^ «What’s New in NTFS». Technet.microsoft.com. Retrieved 22 September 2018.
  99. ^ «Beating the Daylight Saving Time bug and getting correct file modification times Archived 2004-11-14 at the Wayback Machine» The Code Project

Further reading[edit]

  • Bolosky, William J.; Corbin, Scott; Goebel, David; Douceur, John R. (January 2000). «Single Instance Storage in Windows 2000». Proceedings of 4th USENIX Windows Systems Symposium.
  • Custer, Helen (1994). Inside the Windows NT File System. Microsoft Press. ISBN 978-1-55615-660-1.
  • Nagar, Rajeev (1997). Windows NT File System Internals: A Developer’s Guide. O’Reilly. ISBN 978-1-56592-249-5.
  • «NTFS Technical Reference». Microsoft TechNet. Microsoft. 28 March 2003.
New Technology File System[1]

Developer(s) Microsoft
Full name NT File System[2]
Introduced July 1993; 29 years ago with Windows NT 3.1
Partition identifier 0x07 (MBR)
EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 (GPT)
Structures
Directory contents B-tree variant[3][4]
File allocation Bitmap
Bad blocks $BadClus (MFT Record)
Limits
Max. volume size 264 clusters − 1 cluster (format);
256 TB[a] − 64 KB[a] (Windows 10 version 1703, Windows Server 2016 or earlier implementation)[5]
8 PB − 2 MB[a] (Windows 10 version 1709, Windows Server 2019 or later implementation)[6]
Max. file size 16 EB[a] − 1 KB (format);
16 TB − 64 KB (Windows 7, Windows Server 2008 R2 or earlier implementation)[5]
256 TB − 64 KB (Windows 8, Windows Server 2012 or later implementation)[7]
8 PB − 2 MB (Windows 10 version 1709, Windows Server 2019 or later implementation)[6]
Max. number of files 4,294,967,295 (232−1)[5]
Max. filename length 255 UTF-16 code units[8]
Allowed characters in filenames
  • In Win32 namespace: any UTF-16 code unit (case-insensitive) except /:*"?<>| as well as NUL[8]
  • In POSIX namespace: any UTF-16 code unit (case-sensitive) except / as well as NUL
  • Trailing spaces are not allowed and will be removed[9]
Features
Dates recorded Creation, modification, POSIX change, access
Date range 1 January 1601 – 28 May 60056 (File times are 63-bit numbers counting 100-nanosecond intervals (ten million per second) since 1601, which is 29,227 years)
Date resolution 100 ns
Forks Yes (see § Alternate data stream (ADS) below)
Attributes Read-only, hidden, system, archive, not content indexed, off-line, temporary, compressed, encrypted
File system permissions ACLs
Transparent compression Per-file, LZ77 (Windows NT 3.51 onward)
Transparent encryption Per-file,
DESX (Windows 2000 onward),
Triple DES (Windows XP onward),
AES (Windows XP Service Pack 1, Windows Server 2003 onward)
Data deduplication Yes (Windows Server 2012)[10]
Other
Supported operating systems Windows NT 3.1 and later
Mac OS X 10.3 and later (read-only)
Linux kernel version 2.6 and later
Linux kernel versions 2.2-2.4 (read-only)
FreeBSD
NetBSD
OpenBSD (read-only)
ChromeOS
Solaris
ReactOS (read-only)

New Technology File System (NTFS) is a proprietary journaling file system developed by Microsoft.[2][1] Starting with Windows NT 3.1, it is the default file system of the Windows NT family.[11] It superseded File Allocation Table (FAT) as the preferred filesystem on Windows and is supported in Linux and BSD as well. NTFS reading and writing support is provided using a free and open-source kernel implementation known as NTFS3 in Linux and the NTFS-3G driver in BSD.[12][13] By using the convert command, Windows can convert FAT32/16/12 into NTFS without the need to rewrite all files.[14] NTFS uses several files typically hidden from the user to store metadata about other files stored on the drive which can help improve speed and performance when reading data.[1] Unlike FAT and High Performance File System (HPFS), NTFS supports access control lists (ACLs), filesystem encryption, transparent compression, sparse files and file system journaling. NTFS also supports shadow copy to allow backups of a system while it is running, but the functionality of the shadow copies varies between different versions of Windows.[15]

History[edit]

In the mid-1980s, Microsoft and IBM formed a joint project to create the next generation of graphical operating system; the result was OS/2 and HPFS. Because Microsoft disagreed with IBM on many important issues, they eventually separated; OS/2 remained an IBM project and Microsoft worked to develop Windows NT and NTFS.

The HPFS file system for OS/2 contained several important new features. When Microsoft created their new operating system, they «borrowed» many of these concepts for NTFS.[16] The original NTFS developers were Tom Miller, Gary Kimura, Brian Andrew, and David Goebel.[17]

Probably as a result of this common ancestry, HPFS and NTFS use the same disk partition identification type code (07). Using the same Partition ID Record Number is highly unusual, since there were dozens of unused code numbers available, and other major file systems have their own codes. For example, FAT has more than nine (one each for FAT12, FAT16, FAT32, etc.). Algorithms identifying the file system in a partition type 07 must perform additional checks to distinguish between HPFS and NTFS.

Versions[edit]

Microsoft has released five versions of NTFS:

NTFS version number First operating system Release date New features Remarks
1.0 Windows NT 3.1 1993[11] Initial version NTFS 1.0 is incompatible with 1.1 and newer: volumes written by Windows NT 3.5x cannot be read by Windows NT 3.1 until an update (available on the NT 3.5x installation media) is installed.[18]
1.1 Windows NT 3.51 1995 Compressed files, named streams, and access control lists[19]
1.2 Windows NT 4.0 1996 Security descriptors Commonly called NTFS 4.0 after the OS release
3.0 Windows 2000 2000 Disk quotas, file-level encryption in a form of Encrypting File System, sparse files, reparse points, update sequence number (USN) journaling, distributed link tracking, the $Extend folder and its files Compatibility was also made available for Windows NT 4.0 with the Service Pack 4 update. Commonly called NTFS 5.0 after the OS release.[20]
3.1 Windows XP October 2001 Expanded the Master File Table (MFT) entries with redundant MFT record number (useful for recovering damaged MFT files) Commonly called NTFS 5.1 after the OS release. LFS version 1.1 was replaced by version 2.0 as of Windows 8 to improve performance.

The NTFS.sys version number (e.g. v5.0 in Windows 2000) is based on the operating system version; it should not be confused with the NTFS version number (v3.1 since Windows XP).[21]

Although subsequent versions of Windows added new file system-related features, they did not change NTFS itself. For example, Windows Vista implemented NTFS symbolic links, Transactional NTFS, partition shrinking, and self-healing.[22] NTFS symbolic links are a new feature in the file system; all the others are new operating system features that make use of NTFS features already in place.

Scalability[edit]

NTFS is optimized for 4 KB[a] clusters, but supports a maximum cluster size of 2 MB[a]. (Earlier implementations support up to 64 KB)[6] The maximum NTFS volume size that the specification can support is 264 − 1 clusters, but not all implementations achieve this theoretical maximum, as discussed below.

The maximum NTFS volume size implemented in Windows XP Professional is 232 − 1 clusters, partly due to partition table limitations. For example, using 64 KB clusters, the maximum size Windows XP NTFS volume is 256 TB minus 64 KB. Using the default cluster size of 4 KB, the maximum NTFS volume size is 16 TB minus 4 KB. Both of these are vastly higher than the 128 GB[a] limit in Windows XP SP1. Because partition tables on master boot record (MBR) disks support only partition sizes up to 2 TB, multiple GUID Partition Table (GPT or «dynamic») volumes must be combined to create a single NTFS volume larger than 2 TB. Booting from a GPT volume to a Windows environment in a Microsoft supported way requires a system with Unified Extensible Firmware Interface (UEFI) and 64-bit support.[23]

The NTFS maximum theoretical limit on the size of individual files is 16 EB[a][24] (16 × 10246 or 264 bytes) minus 1 KB, which totals 18,446,744,073,709,550,592 bytes. With Windows 10 version 1709 and Windows Server 2019, the maximum implemented file size is 8 PB[a] minus 2 MB or 9,007,199,252,643,840 bytes.[6]

Interoperability[edit]

Windows[edit]

While the different NTFS versions are for the most part fully forward- and backward-compatible, there are technical considerations for mounting newer NTFS volumes in older versions of Microsoft Windows. This affects dual-booting, and external portable hard drives. For example, attempting to use an NTFS partition with «Previous Versions» (Volume Shadow Copy) on an operating system that does not support it will result in the contents of those previous versions being lost.[15] A Windows command-line utility called convert.exe can convert supporting file systems to NTFS, including HPFS (only on Windows NT 3.1, 3.5, and 3.51), FAT16 and FAT32 (on Windows 2000 and later).[25][26]

FreeBSD[edit]

FreeBSD 3.2 released in May 1999 included read-only NTFS support written by Semen Ustimenko.[27][28] This implementation was ported to NetBSD by Christos Zoulas and Jaromir Dolecek and released with NetBSD 1.5 in December 2000.[29] The FreeBSD implementation of NTFS was also ported to OpenBSD by Julien Bordet and offers native read-only NTFS support by default on i386 and amd64 platforms as of version 4.9 released 1 May 2011.[30][28]

Linux[edit]

Linux kernel versions 2.1.74 and later include a driver written by Martin von Löwis which has the ability to read NTFS partitions;[31] kernel versions 2.5.11 and later contain a new driver written by Anton Altaparmakov (University of Cambridge) and Richard Russon which supports file read.[32][33][31] The ability to write to files was introduced with kernel version 2.6.15 in 2006 which allows users to write to existing files but does not allow the creation of new ones.[34] Paragon’s NTFS driver (see below) has been merged into kernel version 5.15, and it supports read/write on normal, compressed and sparse files, as well as journal replaying.[35]

NTFS-3G is a free GPL-licensed FUSE implementation of NTFS that was initially developed as a Linux kernel driver by Szabolcs Szakacsits. It was re-written as a FUSE program to work on other systems that FUSE supports like macOS, FreeBSD, NetBSD, OpenBSD,[36] Solaris, QNX, and Haiku[37] and allows reading and writing to NTFS partitions. A performance enhanced commercial version of NTFS-3G, called «Tuxera NTFS for Mac», is also available from the NTFS-3G developers.[38]

Captive NTFS, a ‘wrapping’ driver that uses Windows’ own driver ntfs.sys, exists for Linux. It was built as a Filesystem in Userspace (FUSE) program and released under the GPL but work on Captive NTFS ceased in 2006.[39]

Linux kernel versions 5.15 onwards carry NTFS3, a fully functional NTFS Read-Write driver which works on NTFS versions up to 3.1 and is maintained primarily by the Paragon Software Group with the source code found here.

Mac OS[edit]

Mac OS X 10.3 included Ustimenko’s read-only implementation of NTFS from FreeBSD. Then in 2006 Apple hired Anton Altaparmakov to write a new NTFS implementation for Mac OS X 10.6.[40] Native NTFS write support is included in 10.6 and later, but is not activated by default, although workarounds do exist to enable the functionality. However, user reports indicate the functionality is unstable and tends to cause kernel panics.[41]

Paragon Software Group sells a read-write driver named NTFS for Mac OS X,[42] which is also included on some models of Seagate hard drives.[43]

OS/2[edit]

The NetDrive package for OS/2 (and derivatives such as eComStation and ArcaOS) supports a plugin which allows read and write access to NTFS volumes.[44][45]

DOS[edit]

There is a free-for-personal-use read/write driver for MS-DOS by Avira called «NTFS4DOS».[46][47]

Ahead Software developed a «NTFSREAD» driver (version 1.200) for DR-DOS 7.0x between 2002 and 2004. It was part of their Nero Burning ROM software.

Security[edit]

NTFS uses access control lists and user-level encryption to help secure user data.

Access control lists (ACLs)[edit]

NTFS file system permissions on a modern Windows system

In NTFS, each file or folder is assigned a security descriptor that defines its owner and contains two access control lists (ACLs). The first ACL, called discretionary access control list (DACL), defines exactly what type of interactions (e.g. reading, writing, executing or deleting) are allowed or forbidden by which user or groups of users. For example, files in the C:Program Files folder may be read and executed by all users but modified only by a user holding administrative privileges.[48] Windows Vista adds mandatory access control info to DACLs. DACLs are the primary focus of User Account Control in Windows Vista and later.

The second ACL, called system access control list (SACL), defines which interactions with the file or folder are to be audited and whether they should be logged when the activity is successful, failed or both. For example, auditing can be enabled on sensitive files of a company, so that its managers get to know when someone tries to delete them or make a copy of them, and whether he or she succeeds.[48]

Encryption[edit]

Encrypting File System (EFS) provides user-transparent encryption of any file or folder on an NTFS volume.[49] EFS works in conjunction with the EFS service, Microsoft’s CryptoAPI and the EFS File System Run-Time Library (FSRTL). EFS works by encrypting a file with a bulk symmetric key (also known as the File Encryption Key, or FEK), which is used because it takes a relatively small amount of time to encrypt and decrypt large amounts of data than if an asymmetric key cipher is used. The symmetric key that is used to encrypt the file is then encrypted with a public key that is associated with the user who encrypted the file, and this encrypted data is stored in an alternate data stream of the encrypted file. To decrypt the file, the file system uses the private key of the user to decrypt the symmetric key that is stored in the data stream. It then uses the symmetric key to decrypt the file. Because this is done at the file system level, it is transparent to the user.[50] Also, in case of a user losing access to their key, support for additional decryption keys has been built into the EFS system, so that a recovery agent can still access the files if needed. NTFS-provided encryption and NTFS-provided compression are mutually exclusive; however, NTFS can be used for one and a third-party tool for the other.

The support of EFS is not available in Basic, Home, and MediaCenter versions of Windows, and must be activated after installation of Professional, Ultimate, and Server versions of Windows or by using enterprise deployment tools within Windows domains.

Features[edit]

Journaling[edit]

NTFS is a journaling file system and uses the NTFS Log ($LogFile) to record metadata changes to the volume. It is a feature that FAT does not provide and critical for NTFS to ensure that its complex internal data structures will remain consistent in case of system crashes or data moves performed by the defragmentation API, and allow easy rollback of uncommitted changes to these critical data structures when the volume is remounted. Notably affected structures are the volume allocation bitmap, modifications to MFT records such as moves of some variable-length attributes stored in MFT records and attribute lists, and indices for directories and security descriptors.

The ($LogFile) format has evolved through several versions:

Windows Version $LogFile format version
Windows NT 4.0 1.1
Windows 2000
Windows XP
Windows Vista
Windows 7
Windows 8 2.0
Windows 8.1
Windows 10

The incompatibility of the $LogFile versions implemented by Windows 8, Windows 10, Windows 11 prevents Windows 7 (and earlier versions of Windows) from recognizing version 2.0 of the $LogFile. Backward compatibility is provided by downgrading the $LogFile to version 1.1 when an NTFS volume is cleanly dismounted. It is again upgraded to version 2.0 when mounting on a compatible version of Windows. However, when hibernating to disk in the logoff state (a.k.a. Hybrid Boot or Fast Boot, which is enabled by default), mounted file systems are not dismounted, and thus the $LogFiles of any active file systems are not downgraded to version 1.1. The inability to process version 2.0 of the $LogFile by versions of Windows older than 8.0 results in an unnecessary invocation of the CHKDSK disk repair utility. This is particularly a concern in a multi-boot scenario involving pre- and post-8.0 versions of Windows, or when frequently moving a storage device between older and newer versions. A Windows Registry setting exists to prevent the automatic upgrade of the $LogFile to the newer version. The problem can also be dealt with by disabling Hybrid Boot.[51]

The USN Journal (Update Sequence Number Journal) is a system management feature that records (in $Extend$UsnJrnl) changes to files, streams and directories on the volume, as well as their various attributes and security settings. The journal is made available for applications to track changes to the volume.[52] This journal can be enabled or disabled on non-system volumes.[53]

Hard links[edit]

The hard link feature allows different file names to directly refer to the same file contents. Hard links may link only to files in the same volume, because each volume has its own MFT.
Hard links were originally included to support the POSIX subsystem in Windows NT.[54]

Although Hard links use the same MFT record (inode) which records file metadata such as file size, modification date, and attributes, NTFS also caches this data in the directory entry as a performance enhancement. This means that when listing the contents of a directory using FindFirstFile/FindNextFile family of APIs, (equivalent to the POSIX opendir/readdir APIs) you will also receive this cached information, in addition to the name and inode. However, you may not see up-to-date information, as this information is only guaranteed to be updated when a file is closed, and then only for the directory from which the file was opened.[55] This means where a file has multiple names via hard links, updating a file via one name does not update the cached data associated with the other name. You can always obtain up-to-date data using GetFileInformationByHandle (which is the true equivalent of POSIX stat function). This can be done using a handle which has no access to the file itself (passing zero to CreateFile for dwDesiredAccess), and closing this handle has the incidental effect of updating the cached information.

Windows uses hard links to support short (8.3) filenames in NTFS. Operating system support is needed because there are legacy applications that can work only with 8.3 filenames, but support can be disabled. In this case, an additional filename record and directory entry is added, but both 8.3 and long file name are linked and updated together, unlike a regular hard link.

The NTFS file system has a limit of 1024 hard links on a file.[56]

Alternate data stream (ADS)[edit]

Alternate data streams allow more than one data stream to be associated with a filename (a fork), using the format «filename:streamname» (e.g., «text.txt:extrastream»).

NTFS Streams were introduced in Windows NT 3.1, to enable Services for Macintosh (SFM) to store resource forks. Although current versions of Windows Server no longer include SFM, third-party Apple Filing Protocol (AFP) products (such as GroupLogic’s ExtremeZ-IP) still use this feature of the file system. Very small ADSs (named «Zone.Identifier») are added by Internet Explorer and recently[when?] by other browsers to mark files downloaded from external sites as possibly unsafe to run; the local shell would then require user confirmation before opening them.[57] When the user indicates that they no longer want this confirmation dialog, this ADS is deleted.

Alternate streams are not listed in Windows Explorer, and their size is not included in the file’s size. When the file is copied or moved to another file system without ADS support the user is warned that alternate data streams cannot be preserved. No such warning is typically provided if the file is attached to an e-mail, or uploaded to a website. Thus, using alternate streams for critical data may cause problems. Microsoft provides a tool called Streams[58] to view streams on a selected volume. Starting with Windows PowerShell 3.0, it is possible to manage ADS natively with six cmdlets: Add-Content, Clear-Content, Get-Content, Get-Item, Remove-Item, Set-Content.[59]

Malware has used alternate data streams to hide code.[60] As a result, malware scanners and other special tools now check for alternate data streams.

File compression[edit]

Compression is enabled on a per-folder or per-file basis by setting the ‘compressed’ attribute. When compression is enabled on a folder, any files moved or saved to that folder will be automatically compressed using LZNT1 algorithm (a variant of LZ77).[61] The compression algorithm is designed to support cluster sizes of up to 4 KB; when the cluster size is greater than 4 KB on an NTFS volume, NTFS compression is not available.[62] Data is compressed in 16-cluster chunks (up to 64 KB in size); if the compression reduces 64 KB of data to 60 KB or less, NTFS treats the unneeded 4 KB pages like empty sparse file clusters—they are not written. This allows for reasonable random-access times as the OS merely has to follow the chain of fragments.

Compression works best with files that have repetitive content, are seldom written, are usually accessed sequentially, and are not themselves compressed. Single-user systems with limited hard disk space can benefit from NTFS compression for small files, from 4 KB to 64 KB or more, depending on compressibility. Files smaller than approximately 900 bytes are stored within the directory entry of the MFT.[63]

Advantages[edit]

Users of fast multi-core processors will find improvements in application speed by compressing their applications and data as well as a reduction in space used. Even when SSD controllers already compress data, there is still a reduction in I/Os since less data is transferred.[64]

According to research by Microsoft’s NTFS Development team, 50–60 GB is a reasonable maximum size for a compressed file on an NTFS volume with a 4 KB (default) cluster (block) size. This reasonable maximum size decreases sharply for volumes with smaller cluster sizes.[65]

Disadvantages[edit]

Large compressible files become highly fragmented since every chunk smaller than 64 KB becomes a fragment.[65][66] Flash memory, such as SSD drives do not have the head movement delays and high access time of mechanical hard disk drives, so fragmentation has only a smaller penalty.

If system files that are needed at boot time (such as drivers, NTLDR, winload.exe, or BOOTMGR) are compressed, the system may fail to boot correctly, because decompression filters are not yet loaded.[67][failed verification] Later editions of Windows[which?] do not allow important system files to be compressed.

System compression[edit]


Since Windows 10, Microsoft has introduced new file compression scheme based on the XPRESS algorithm with 4K/8K/16K block size[68] and the LZX algorithm;[69] both are variants of LZ77 updated with Huffman entropy coding and range coding, which LZNT1 lacked. These compression algorithms were taken from Windows Imaging Format (WIM file).

The new compression scheme is used by CompactOS feature, which reduces disk usage by compressing Windows system files.[70] CompactOS is not an extension of NTFS file compression and does not use the ‘compressed’ attribute; instead, it sets a reparse point on each compressed file with a WOF (Windows Overlay Filter) tag,[71] but the actual data is stored in an alternate data stream named «WofCompressedData», which is decompressed on-the-fly by a WOF filesystem filter driver, and the main file is an empty sparse file.[71] This design is meant purely for read-only access, so any writes to compressed files result in an automatic decompression.[71][72][73]

CompactOS compression is intended for OEMs who prepare OS images with the /compact flag of the DISM tool in Windows ADK,[74] but it can also be manually turned on per file with the /exe flag of the compact command.[75] CompactOS algorithm avoids file fragmentation by writing compressed data in contiguously allocated chunks, unlike core NTFS compression.[citation needed]

CompactOS file compression is an improved version of WIMBoot feature introduced in Windows 8.1. WIMBoot reduces Windows disk usage by keeping system files in a compressed WIM image on a separate hidden disk partition.[76] Similarly to CompactOS, Windows system directories only contain sparse files marked by a reparse point with a WOF tag, and Windows Overlay Filter driver decompresses file contents on-the-fly from the WIM image. WIMBoot is less effective than CompactOS though, as new updated versions of system files need to be written to the system partition, consuming disk space.[71]

Sparse files[edit]

A sparse file: Empty bytes don’t need to be saved, thus they can be represented by metadata.

One petabyte (1,125,899,906,842,624 bytes) of sparse files, 0 bytes on disk.

Sparse files are files interspersed with empty segments for which no actual storage space is used. To the applications, the file looks like an ordinary file with empty regions seen as regions filled with zeros; the file system maintains an internal list of such regions for each sparse file.[77] A sparse file does not necessarily include sparse zeros areas; the «sparse file» attribute just means that the file is allowed to have them.

Database applications, for instance, may use sparse files.[78] As with compressed files, the actual sizes of sparse files are not taken into account when determining quota limits.[79]

Volume Shadow Copy[edit]

The Volume Shadow Copy Service (VSS) keeps historical versions of files and folders on NTFS volumes by copying old, newly overwritten data to shadow copy via copy-on-write technique. The user may later request an earlier version to be recovered. This also allows data backup programs to archive files currently in use by the file system.

Windows Vista also introduced persistent shadow copies for use with System Restore and Previous Versions features. Persistent shadow copies, however, are deleted when an older operating system mounts that NTFS volume. This happens because the older operating system does not understand the newer format of persistent shadow copies.[80]

Transactions[edit]

As of Windows Vista, applications can use Transactional NTFS (TxF) to group multiple changes to files together into a single transaction. The transaction will guarantee that either all of the changes happen, or none of them do, and that no application outside the transaction will see the changes until they are committed.[81]

It uses similar techniques as those used for Volume Shadow Copies (i.e. copy-on-write) to ensure that overwritten data can be safely rolled back, and a CLFS log to mark the transactions that have still not been committed, or those that have been committed but still not fully applied (in case of system crash during a commit by one of the participants).

Transactional NTFS does not restrict transactions to just the local NTFS volume, but also includes other transactional data or operations in other locations such as data stored in separate volumes, the local registry, or SQL databases, or the current states of system services or remote services. These transactions are coordinated network-wide with all participants using a specific service, the DTC, to ensure that all participants will receive same commit state, and to transport the changes that have been validated by any participant (so that the others can invalidate their local caches for old data or rollback their ongoing uncommitted changes). Transactional NTFS allows, for example, the creation of network-wide consistent distributed file systems, including with their local live or offline caches.

Microsoft now advises against using TxF: «Microsoft strongly recommends developers utilize alternative means» since «TxF may not be available in future versions of Microsoft Windows».[82]

Quotas[edit]

Disk quotas were introduced in NTFS v3. They allow the administrator of a computer that runs a version of Windows that supports NTFS to set a threshold of disk space that users may use. It also allows administrators to keep track of how much disk space each user is using. An administrator may specify a certain level of disk space that a user may use before they receive a warning, and then deny access to the user once they hit their upper limit of space. Disk quotas do not take into account NTFS’s transparent file-compression, should this be enabled. Applications that query the amount of free space will also see the amount of free space left to the user who has a quota applied to them.

Reparse points[edit]

Introduced in NTFS v3, NTFS reparse points are used by associating a reparse tag in the user space attribute of a file or directory. Microsoft includes several default tags including symbolic links, directory junction points and volume mount points. When the Object Manager parses a file system name lookup and encounters a reparse attribute, it will reparse the name lookup, passing the user controlled reparse data to every file system filter driver that is loaded into Windows. Each filter driver examines the reparse data to see whether it is associated with that reparse point, and if that filter driver determines a match, then it intercepts the file system request and performs its special functionality.

Limitations[edit]

Resizing[edit]

Starting with Windows Vista Microsoft added the built-in ability to shrink or expand a partition. However, this ability does not relocate page file fragments or files that have been marked as unmovable, so shrinking a volume will often require relocating or disabling any page file, the index of Windows Search, and any Shadow Copy used by System Restore. Various third-party tools are capable of resizing NTFS partitions.

OneDrive[edit]

Since 2017, Microsoft requires the OneDrive file structure to reside on an NTFS disk.[83] This is because OneDrive Files On-Demand feature uses NTFS reparse points to link files and folders that are stored in OneDrive to the local filesystem, making the file or folder unusable with any previous version of Windows, with any other NTFS file system driver, or any file system and backup utilities not updated to support it.[84]

Structure[edit]

NTFS is made up of several components including: a partition boot sector (PBS) that holds boot information; the master file table that stores a record of all files and folders in the filesystem; a series of meta files that help structure meta data more efficiently; data streams and locking mechanisms.

Internally, NTFS uses B-trees to index file system data. A file system journal is used to guarantee the integrity of the file system metadata but not individual files’ content. Systems using NTFS are known to have improved reliability compared to FAT file systems.[85]

NTFS allows any sequence of 16-bit values for name encoding (e.g. file names, stream names or index names) except 0x0000. This means UTF-16 code units are supported, but the file system does not check whether a sequence is valid UTF-16 (it allows any sequence of short values, not restricted to those in the Unicode standard). In Win32 namespace, any UTF-16 code units are case insensitive whereas in POSIX namespace they are case sensitive. File names are limited to 255 UTF-16 code units. Certain names are reserved in the volume root directory and cannot be used for files. These are $MFT, $MFTMirr, $LogFile, $Volume, $AttrDef, . (dot), $Bitmap, $Boot, $BadClus, $Secure, $UpCase, and $Extend.[5] . (dot) and $Extend are both directories; the others are files. The NT kernel limits full paths to 32,767 UTF-16 code units. There are some additional restrictions on code points and file names.[86]

Partition Boot Sector (PBS)[edit]

This boot partition format is roughly based upon the earlier FAT filesystem, but the fields are in different locations. Some of these fields, especially the «sectors per track», «number of heads» and «hidden sectors» fields may contain dummy values on drives where they either do not make sense or are not determinable.

The OS first looks at the 8 bytes at 0x30 to find the cluster number of the $MFT, then multiplies that number by the number of sectors per cluster (1 byte found at 0x0D). This value is the sector offset (LBA) to the $MFT, which is described below.

Master File Table[edit]

In NTFS, all file, directory and metafile data—file name, creation date, access permissions (by the use of access control lists), and size—are stored as metadata in the Master File Table (MFT). This abstract approach allowed easy addition of file system features during Windows NT’s development—an example is the addition of fields for indexing used by the Active Directory and the Windows Search. This also enables fast file search software to locate named local files and folders included in the MFT very quickly, without requiring any other index.

The MFT structure supports algorithms which minimize disk fragmentation.[89] A directory entry consists of a filename and a «file ID» (analogous to the inode number), which is the record number representing the file in the Master File Table. The file ID also contains a reuse count to detect stale references. While this strongly resembles the W_FID of Files-11, other NTFS structures radically differ.

A partial copy of the MFT, called the MFT mirror, is stored to be used in case of corruption.[90] If the first record of the MFT is corrupted, NTFS reads the second record to find the MFT mirror file. Locations for both files are stored in the boot sector.[91]

Metafiles[edit]

NTFS contains several files that define and organize the file system. In all respects, most of these files are structured like any other user file ($Volume being the most peculiar), but are not of direct interest to file system clients.[92] These metafiles define files, back up critical file system data, buffer file system changes, manage free space allocation, satisfy BIOS expectations, track bad allocation units, and store security and disk space usage information. All content is in an unnamed data stream, unless otherwise indicated.

These metafiles are treated specially by Windows, handled directly by the NTFS.SYS driver and are difficult to directly view: special purpose-built tools are needed.[93] As of Windows 7, the NTFS driver completely prohibits user access, resulting in a BSoD whenever an attempt to execute a metadata file is made. One such tool is the nfi.exe («NTFS File Sector Information Utility») that is freely distributed as part of the Microsoft «OEM Support Tools». For example, to obtain information on the «$MFT»-Master File Table Segment the following command is used: nfi.exe c:$MFT[94] Another way to bypass the restriction is to use 7-Zip’s file manager and go to the low-level NTFS path \.X: (where X: resembles any drive/partition). Here, 3 new folders will appear: $EXTEND, [DELETED] (a pseudo-folder that 7-Zip uses to attach files deleted from the file system to view), and [SYSTEM] (another pseudo-folder that contains all the NTFS metadata files). This trick can be used from removable devices (USB flash drives, external hard drives, SD Cards, etc.) inside Windows, but doing this on the active partition requires offline access (namely WinRE).

Attribute lists, attributes, and streams[edit]

For each file (or directory) described in the MFT record, there is a linear repository of stream descriptors (also named attributes), packed together in one or more MFT records (containing the so-called attributes list), with extra padding to fill the fixed 1 KB size of every MFT record, and that fully describes the effective streams associated with that file.

Each attribute has an attribute type (a fixed-size integer mapping to an attribute definition in file $AttrDef), an optional attribute name (for example, used as the name for an alternate data stream), and a value, represented in a sequence of bytes. For NTFS, the standard data of files, the alternate data streams, or the index data for directories are stored as attributes.

According to $AttrDef, some attributes can be either resident or non-resident. The $DATA attribute, which contains file data, is such an example. When the attribute is resident (which is represented by a flag), its value is stored directly in the MFT record. Otherwise, clusters are allocated for the data, and the cluster location information is stored as data runs in the attribute.

  • For each file in the MFT, the attributes identified by attribute type, attribute name must be unique. Additionally, NTFS has some ordering constraints for these attributes.
  • There is a predefined null attribute type, used to indicate the end of the list of attributes in one MFT record. It must be present as the last attribute in the record (all other storage space available after it will be ignored and just consists of padding bytes to match the record size in the MFT).
  • Some attribute types are required and must be present in each MFT record, except unused records that are just indicated by null attribute types.
    • This is the case for the $STANDARD_INFORMATION attribute that is stored as a fixed-size record and contains the timestamps and other basic single-bit attributes (compatible with those managed by FAT in DOS or Windows 9x).
  • Some attribute types cannot have a name and must remain anonymous.
    • This is the case for the standard attributes, or for the preferred NTFS «filename» attribute type, or the «short filename» attribute type, when it is also present (for compatibility with DOS-like applications, see below). It is also possible for a file to contain only a short filename, in which case it will be the preferred one, as listed in the Windows Explorer.
    • The filename attributes stored in the attribute list do not make the file immediately accessible through the hierarchical file system. In fact, all the filenames must be indexed separately in at least one other directory on the same volume. There it must have its own MFT record and its own security descriptors and attributes that reference the MFT record number for this file. This allows the same file or directory to be «hardlinked» several times from several containers on the same volume, possibly with distinct filenames.
  • The default data stream of a regular file is a stream of type $DATA but with an anonymous name, and the ADSs are similar but must be named.
  • On the other hand, the default data stream of directories has a distinct type, but are not anonymous: they have an attribute name («$I30» in NTFS 3+) that reflects its indexing format.

All attributes of a given file may be displayed by using the nfi.exe («NTFS File Sector Information Utility») that is freely distributed as part of the Microsoft «OEM Support Tools».[94]

Windows system calls may handle alternate data streams.[5] Depending on the operating system, utility and remote file system, a file transfer might silently strip data streams.[5] A safe way of copying or moving files is to use the BackupRead and BackupWrite system calls, which allow programs to enumerate streams, to verify whether each stream should be written to the destination volume and to knowingly skip unwanted streams.[5]

Resident vs. non-resident attributes[edit]

To optimize the storage and reduce the I/O overhead for the very common case of attributes with very small associated value, NTFS prefers to place the value within the attribute itself (if the size of the attribute does not then exceed the maximum size of an MFT record), instead of using the MFT record space to list clusters containing the data; in that case, the attribute will not store the data directly but will just store an allocation map (in the form of data runs) pointing to the actual data stored elsewhere on the volume.[95] When the value can be accessed directly from within the attribute, it is called «resident data» (by computer forensics workers). The amount of data that fits is highly dependent on the file’s characteristics, but 700 to 800 bytes is common in single-stream files with non-lengthy filenames and no ACLs.

  • Some attributes (such as the preferred filename, the basic file attributes) cannot be made non-resident. For non-resident attributes, their allocation map must fit within MFT records.
  • Encrypted-by-NTFS, sparse data streams, or compressed data streams cannot be made resident.
  • The format of the allocation map for non-resident attributes depends on its capability of supporting sparse data storage. In the current implementation of NTFS, once a non-resident data stream has been marked and converted as sparse, it cannot be changed back to non-sparse data, so it cannot become resident again, unless this data is fully truncated, discarding the sparse allocation map completely.
  • When a non-resident attribute is so fragmented, that its effective allocation map cannot fit entirely within one MFT record, NTFS stores the attribute in multiple records. The first one among them is called the base record, while the others are called extension records. NTFS creates a special attribute $ATTRIBUTE_LIST to store information mapping different parts of the long attribute to the MFT records, which means the allocation map may be split into multiple records. The $ATTRIBUTE_LIST itself can also be non-resident, but its own allocation map must fit within one MFT record.
  • When there are too many attributes for a file (including ADS’s, extended attributes, or security descriptors), so that they cannot fit all within the MFT record, extension records may also be used to store the other attributes, using the same format as the one used in the base MFT record, but without the space constraints of one MFT record.

The allocation map is stored in a form of data runs with compressed encoding. Each data run represents a contiguous group of clusters that store the attribute value. For files on a multi-GB volume, each entry can be encoded as 5 to 7 bytes, which means a 1 KB MFT record can store about 100 such data runs. However, as the $ATTRIBUTE_LIST also has a size limit, it is dangerous to have more than 1 million fragments of a single file on an NTFS volume, which also implies that it is in general not a good idea to use NTFS compression on a file larger than 10 GB.[96]

The NTFS file system driver will sometimes attempt to relocate the data of some of the attributes that can be made non-resident into the clusters, and will also attempt to relocate the data stored in clusters back to the attribute inside the MFT record, based on priority and preferred ordering rules, and size constraints.

Since resident files do not directly occupy clusters («allocation units»), it is possible for an NTFS volume to contain more files on a volume than there are clusters. For example, a 74.5 GB partition NTFS formats with 19,543,064 clusters of 4 KB. Subtracting system files (a 64 MB log file, a 2,442,888-byte Bitmap file, and about 25 clusters of fixed overhead) leaves 19,526,158 clusters free for files and indices. Since there are four MFT records per cluster, this volume theoretically could hold almost 4 × 19,526,158 = 78,104,632 resident files.

Opportunistic locks[edit]

Opportunistic file locks (oplocks) allow clients to alter their buffering strategy for a given file or stream in order to increase performance and reduce network use.[97] Oplocks apply to the given open stream of a file and do not affect oplocks on a different stream.

Oplocks can be used to transparently access files in the background. A network client may avoid writing information into a file on a remote server if no other process is accessing the data, or it may buffer read-ahead data if no other process is writing data.

Windows supports four different types of oplocks:

  • Level 2 (or shared) oplock: multiple readers, no writers (i.e. read caching).
  • Level 1 (or exclusive) oplock: exclusive access with arbitrary buffering (i.e. read and write caching).
  • Batch oplock (also exclusive): a stream is opened on the server, but closed on the client machine (i.e. read, write and handle caching).
  • Filter oplock (also exclusive): applications and file system filters can «back out» when others try to access the same stream (i.e. read and write caching) (since Windows 2000)

Opportunistic locks have been enhanced in Windows 7 and Windows Server 2008 R2 with per-client oplock keys.[98]

Time[edit]

Windows NT and its descendants keep internal timestamps as UTC and make the appropriate conversions for display purposes; all NTFS timestamps are in UTC.[citation needed]

For historical reasons, the versions of Windows that do not support NTFS all keep time internally as local zone time, and therefore so do all file systems – other than NTFS – that are supported by current versions of Windows. This means that when files are copied or moved between NTFS and non-NTFS partitions, the OS needs to convert timestamps on the fly. But if some files are moved when daylight saving time (DST) is in effect, and other files are moved when standard time is in effect, there can be some ambiguities in the conversions. As a result, especially shortly after one of the days on which local zone time changes, users may observe that some files have timestamps that are incorrect by one hour. Due to the differences in implementation of DST in different jurisdictions, this can result in a potential timestamp error of up to 4 hours in any given 12 months.[99]

See also[edit]

  • Comparison of file systems
  • NTFSDOS
  • ntfsresize
  • WinFS (a canceled Microsoft filesystem)
  • ReFS, a newer Microsoft filesystem

Notes[edit]

  1. ^ a b c d e f g h i 1 byte = 8 bits
    1 KB = 1,024 bytes
    1 MB = 1,048,576 bytes
    1 GB = 1,073,741,824 bytes
    1 TB = 1,099,511,627,776 bytes
    1 PB = 1,125,899,906,842,624 bytes
    1 EB = 1,152,921,504,606,846,976 bytes

References[edit]

  1. ^ a b c Karresand, Martin; Axelsson, Stefan; Dyrkolbotn, Geir Olav (2019-07-01). «Using NTFS Cluster Allocation Behavior to Find the Location of User Data». Digital Investigation. 29: –51–S60. doi:10.1016/j.diin.2019.04.018. ISSN 1742-2876. S2CID 199004263. Retrieved 2021-12-01.
  2. ^ a b «Glossary». [MS-EFSR]: Encrypting File System Remote (EFSRPC) Protocol. Microsoft. 14 November 2013.
  3. ^ «How NTFS Works». TechNet. Microsoft. Retrieved 2 December 2017.
  4. ^ «B*Trees — NTFS Directory Trees — Concept — NTFS Documentation». flatcap.org. Archived from the original on 2019-05-13. Retrieved 2019-05-13.
  5. ^ a b c d e f g «How NTFS Works». Windows Server 2003 Technical Reference. 2003-03-28. Retrieved 2011-09-12.
  6. ^ a b c d «Appendix A: Product Behavior». [MS-FSA]: File System Algorithms. Microsoft. 2018-09-12. Retrieved 2018-10-01. NTFS uses a default cluster size of 4 KB, a maximum cluster size of 64 KB on Windows 10 v1703 operating system and Windows Server 2016 and prior, and 2 MB on Windows 10 v1709 operating system and Windows Server 2019 and later, and a minimum cluster size of 512 bytes.
  7. ^ «Appendix A: Product Behavior». [MS-FSA]: File System Algorithms. Microsoft. 14 November 2013. Retrieved 2012-09-21.
  8. ^ a b Russon, Richard; Fledel, Yuval. «NTFS Documentation» (PDF). Archived (PDF) from the original on 2022-10-09. Retrieved 2011-06-26.
  9. ^ «WineHQ Bugzilla – Bug 51808 – the issue with trailing spaces (Spaces at the end of a filename)».
  10. ^ Rick Vanover (14 September 2011). «Windows Server 8 data deduplication». Retrieved 2011-12-02.
  11. ^ a b Custer, Helen (1994). Inside the Windows NT File System. Microsoft Press. ISBN 978-1-55615-660-1.
  12. ^ «NTFS3 — The Linux Kernel documentation». www.kernel.org. Retrieved 2021-12-02.
  13. ^ «ntfs-3g». www.freebsd.org. Retrieved 2021-12-02.
  14. ^ «How to Convert a Drive from FAT32 to NTFS without Data Loss». WindowsLoop. 11 July 2021. Retrieved 8 August 2021.
  15. ^ a b cfsbloggers (July 14, 2006). «How restore points and other recovery features in Windows Vista are affected when dual-booting with Windows XP». The Filing Cabinet. Retrieved 2007-03-21.
  16. ^ Kozierok, Charles (14 February 2018). «Overview and History of NTFS». The PC Guide. Retrieved May 30, 2019.
  17. ^ Custer, Helen (1994). Inside the Windows NT File System. Microsoft Press. p. vii. ISBN 978-1-55615-660-1.
  18. ^ «Recovering Windows NT After a Boot Failure on an NTFS Drive». Microsoft. November 1, 2006.
  19. ^ a b Russinovich, Mark. «Inside Win2K NTFS, Part 1». MSDN. Microsoft. Retrieved 2008-04-18.
  20. ^ «What’s New in Windows NT 4.0 Service Pack 4?». Microsoft.com. 12 January 1999. Archived from the original on 17 January 1999. Retrieved 17 August 2018.
  21. ^ «New Capabilities and Features of the NTFS 3.1 File System». Microsoft. 1 December 2007.
  22. ^ Loveall, John (2006). «Storage improvements in Windows Vista and Windows Server 2008» (PowerPoint). Microsoft. pp. 14–20. Retrieved 2007-09-04.
  23. ^ «Booting from GPT». Rodsbooks.com. Retrieved 22 September 2018.
  24. ^ «NTFS vs FAT vs exFAT — NTFS.com». www.ntfs.com. Retrieved 2021-01-19.
  25. ^ «How to Convert FAT Disks to NTFS». Microsoft. 18 December 2017. Retrieved May 30, 2019.
  26. ^ «How to use Convert.exe to convert a partition to the NTFS file system». Microsoft Corporation. 2007-02-12. Retrieved 2010-12-26.
  27. ^ «FreeBSD 3.2 Release Notes». 17 May 1999. Retrieved 2020-06-15.
  28. ^ a b «mount_ntfs — OpenBSD manual pages». Retrieved 2020-06-15.
  29. ^ «Announcing NetBSD 1.5». 6 December 2000. Retrieved 2020-06-15.
  30. ^ «OpenBSD 4.9». Openbsd.com. Retrieved 22 September 2018.
  31. ^ a b «NTFS Credits and History». Linux-NTFS Project. Retrieved 2021-09-05.
  32. ^ «Kernel development». lwn.net. 2 May 2002. Retrieved 2021-09-05.
  33. ^ «Release notes for v2.5.11». 29 April 2002. Retrieved 2021-09-05.
  34. ^ «2.6.15 changelog». Linux project. 3 January 2006. Retrieved 2021-09-05.
  35. ^ Anderson, Tim (2021-09-06). «GitHub merges ‘useless garbage’ says Linus Torvalds as new NTFS support added to Linux kernel 5.15». The Register. Retrieved 2021-09-07.
  36. ^ «OpenBSD adds fuse(4) support for adding file systems in userland». OpenBSD Journal. 2013-11-08. Retrieved 2013-11-08.
  37. ^ «NTFS-3G Stable Read/Write Driver». 2009-07-25.
  38. ^ «Tuxera NTFS for Mac». Tuxera. August 30, 2011. Retrieved September 20, 2011.
  39. ^ «Jan Kratochvil: Captive: The first free NTFS read/write filesystem for GNU/Linux». Retrieved 2020-06-15.
  40. ^ «About Tuxera». Retrieved 2020-06-15.
  41. ^ «10.6: Enable native NTFS read/write support». 1 October 2009. Retrieved 5 September 2021.
  42. ^ «NTFS for Mac OS X, communication channel between Mac OS X and Windows». Paragon Software Group. Retrieved September 20, 2011.
  43. ^ «The Leader in Mass Data Storage Solutions | Seagate US». Seagate.com. Archived from the original on February 10, 2011.
  44. ^ «NTFS plugin for NetDrive». ecsoft2.org. Retrieved 2020-09-09.
  45. ^ «NetDrive for OS/2». arcanoae.com. Retrieved 2020-09-09.
  46. ^ «Avira NTFS4DOS Personal». Archived from the original on June 19, 2010. Retrieved 2009-07-25.
  47. ^ «Download Avira NTFS4DOS Personal 1.9». Archived from the original on 10 November 2013. Retrieved 22 September 2018.
  48. ^ a b «How Security Descriptors and Access Control Lists Work». TechNet. Microsoft. Retrieved 4 September 2015.
  49. ^ Morello, John (February 2007). «Security Watch Deploying EFS: Part 1». Technet Magazine. Microsoft. Retrieved 2009-01-25.
  50. ^ «How EFS Works». Windows 2000 Resource Kit. Microsoft. Retrieved 25 February 2014.
  51. ^ «Windows 8 volume compatibility considerations with prior versions of Windows». Retrieved 2021-12-17.
  52. ^ «Change Journals (Windows)». MSDN. Retrieved 2010-04-16.
  53. ^ «Creating, Modifying, and Deleting a Change Journal (Windows)». MSDN. Retrieved 2010-04-16.
  54. ^ «Chapter 29 – POSIX Compatibility». MS Windows NT Workstation 4.0 Resource Guide. Microsoft. 1995. Retrieved 21 October 2013.
  55. ^ «Hard Links and Junctions». MSDN. Microsoft. 12 October 2013. Retrieved 21 October 2013.
  56. ^ «MSDN – CreateHardLink function». Retrieved 14 January 2016.
  57. ^ Russinovich, Mark E.; Solomon, David A.; Ionescu, Alex (2009). «File Systems». Windows Internals (5th ed.). Microsoft Press. p. 921. ISBN 978-0-7356-2530-3. One component in Windows that uses multiple data streams is the Attachment Execution Service[…] depending on which zone the file was downloaded from […] Windows Explorer might warn the user
  58. ^ «Streams — Windows Sysinternals». Technet.microsoft.com. Retrieved 22 September 2018.
  59. ^ «FileSystem Provider». Microsoft. 9 August 2012. Archived from the original on 23 January 2015. Retrieved 23 January 2015.
  60. ^ Malware utilising Alternate Data Streams? Archived 2008-07-23 at the Wayback Machine, AusCERT Web Log, 21 August 2007
  61. ^ «File Compression and Decompression». MSDN Platform SDK: File Systems. Retrieved 2005-08-18.
  62. ^ «The Default Cluster Size for the NTFS and FAT File Systems». Microsoft. January 31, 2002. Retrieved 2012-01-10.
  63. ^ «How NTFS Works». 2003-03-28. Retrieved 2011-10-24.
  64. ^ Masiero, Manuel (2011-12-01). «Should You Compress Data On Your SSD?». Tom’s Hardware. Bestofmedia Group. Retrieved 2013-04-05.
  65. ^ a b Middleton, Dennis. «Understanding NTFS Compression». Ntdebugging Blog. Microsoft. Retrieved 2011-03-16.
  66. ^ «Shrinking the gap: carving NTFS-compressed files». Retrieved 2011-05-29.
  67. ^ «Disk Concepts and Troubleshooting». Microsoft. Retrieved 2012-03-26.
  68. ^ «[MS-XCA]: Xpress Compression Algorithm».
  69. ^ wimlib: the open source Windows Imaging (WIM) library — Compression algorithm
  70. ^ «Compact OS, single-instancing, and image optimization». Microsoft. Retrieved 1 October 2019.
  71. ^ a b c d Raymond Chen.What is WofCompressedData? Does WOF mean that Windows is a dog? Microsoft DevBlogs.
  72. ^ Biggers, Eric (29 April 2019). «NTFS-3G plugin for reading «system compressed» files». GitHub. Retrieved 1 October 2019.
  73. ^ «Re: [ntfs-3g-devel] Experimental support for Windows 10 «System Compressed» files». SourceForge.net. Retrieved 1 October 2019.
  74. ^ «DISM Overview».
  75. ^ «Compact».
  76. ^ Windows Image File Boot (WIMBoot) Overview
  77. ^ «Sparse Files». MSDN. Microsoft. 12 October 2013. Retrieved 21 October 2013.
  78. ^ Kandoth, Suresh B. (4 March 2009). «Sparse File Errors: 1450 or 665 due to file fragmentation: Fixes and Workarounds». CSS SQL Server Engineers. Microsoft. Retrieved 21 October 2013.
  79. ^ «Sparse Files and Disk Quotas». MSDN Library. Microsoft. 12 October 2013. Retrieved 21 October 2013.
  80. ^ cfsbloggers (July 14, 2006). «How restore points and other recovery features in Windows Vista are affected when you dual-boot with Windows XP». The Filing Cabinet. Retrieved 2007-03-21.
  81. ^ «Transactional NTFS». MSDN. Microsoft. Retrieved 2007-02-02.
  82. ^ «Transactional NTFS (TxF)». Windows Dev Center (MSDN). Microsoft. Retrieved 24 May 2015.
  83. ^ «Unable to open content synced in a OneDrive folder on an external drive». Microsoft Support. Retrieved 2021-04-03.
  84. ^ André, Jean-Pierre (March 1, 2019). «NTFS-3G: Junction Points, Symbolic Links and Reparse Points». jp-andre.pagesperso-orange.fr.
  85. ^ «Chapter 18 – Choosing a File System». MS Windows NT Workstation 4.0 Resource Guide. Microsoft. Retrieved 25 February 2014.
  86. ^ «Naming Files, Paths, and Namespaces». MSDN. Microsoft. Naming Conventions. Retrieved 25 February 2014.
  87. ^ «NTFS. Partition Boot Sector». Ntfs.com. Retrieved 22 September 2018.
  88. ^ «Boot Sector». Technet.microsoft.com. September 11, 2008. Table 1.13 BPB and Extended BPB Fields on NTFS Volumes. Retrieved 22 September 2018.
  89. ^ «Master File Table». MSDN. July 2, 2012.
  90. ^ «Forensics: What is the MFT Mirror?». Where is Your Data?. 2009-06-05. Retrieved 2021-07-30.
  91. ^ «NTFS Master File Table (MFT)». Ntfs.com. Retrieved 22 September 2018.
  92. ^ Schwarz, Thomas. «COEN 252 Computer Forensics NTFS». Faculty of Organization and Informatics University of Zagreb. Archived from the original on 2021-02-27. Retrieved May 30, 2019.
  93. ^ Since Windows XP, it is very difficult to view a listing of these files: they exist in the root directory’s index, but the Win32 interface filters them out. In NT 4.0, the command line dir command would list the metafiles in the root directory if /a were specified. In Windows 2000, dir /a stopped working, but dir /a $MFT worked.
  94. ^ a b «OEM Support Tools Phase 3 Service Release 2 Availability». Microsoft Corporation. 2007-02-21. Archived from the original on 2015-02-23. Retrieved 2010-06-16. Windows NT File System (NTFS) File Sector Information Utility … A tool used to dump information about an NTFS volume
  95. ^ «The Four Stages of NTFS File Growth». Retrieved 22 September 2018.
  96. ^ «A heavily fragmented file in an NTFS volume may not grow beyond a certain size». Archived from the original on 2021-05-06. Retrieved 2021-05-19.
  97. ^ «How Oplocks function in the Windows Environment: Overview». Archived from the original on 2010-08-23. Retrieved 2018-12-19.
  98. ^ «What’s New in NTFS». Technet.microsoft.com. Retrieved 22 September 2018.
  99. ^ «Beating the Daylight Saving Time bug and getting correct file modification times Archived 2004-11-14 at the Wayback Machine» The Code Project

Further reading[edit]

  • Bolosky, William J.; Corbin, Scott; Goebel, David; Douceur, John R. (January 2000). «Single Instance Storage in Windows 2000». Proceedings of 4th USENIX Windows Systems Symposium.
  • Custer, Helen (1994). Inside the Windows NT File System. Microsoft Press. ISBN 978-1-55615-660-1.
  • Nagar, Rajeev (1997). Windows NT File System Internals: A Developer’s Guide. O’Reilly. ISBN 978-1-56592-249-5.
  • «NTFS Technical Reference». Microsoft TechNet. Microsoft. 28 March 2003.

Оптимальный способ хранения большого количества файлов на сервере

Как известно в одной папке не стоит хранить большое количество файлов т.к. очень быстро может произойти сбой в системе или попросту файлы будут очень медленно считываться.

Для решения этой задачи многие программисты берут md5 имени файла f789f789abc898d6892df98d09a8f8, после чего разбивают имя примерно таким образом:

/f7/89/f789abc898d6892df98d09a8f8.jpg

Математика тут очень проста — один символ это 16 вариантов.
Таким образом 2 символа это уже 16*16=256 вариантов.
В нашем случае у нас 2 вложенности по 2 символа, таким образом максимальное количество папок будет 256*256=65536 папок.
Если нам потребуется сохранить 1000000 файлов то число файлов в каждой папке не превысит 1000000/65536=15 файлов.

Да, вариант прост, но что если нам требуется не только хорошо сохранять файлы, но и еще быстро их находить?

Например у нас социальная сеть и мы хотим для каждого пользователя создать отдельную папку с номером его id и хранить в ней файлы которые в свою очередь тоже имеют свой id.
И для нас важно не только сохранить файл но и быстро найти где он лежит по его id.

Для решения этой задачи я написал класс, который позволяет сохранять на сервере большое количество файлов или папок в древовидной структуре папок.

Вот какую структуру создает класс:
image

Чтобы посчитать максимально число файлов которое уместится в этой структуре нужно возвести максимальное количество файлов в папке в степень количества ветвей плюс один.

На изображении мы видим 2 ветви и по 3 файла в каждой папке.
Таким образом 3 нужно возвести в степень 2+1 = 3*3*3=27 файлов.

Для сохранения не более 1000000 файлов в такой структуре нам хватит 2 ветви по 100 файлов в каждой папке (100*100*100).

В класс нужно передать массив параметров — путь к папке где будет строиться дерево, максимальное число файлов в папке, число ветвей, либо можно применить паттерн (параметр pattern) максимального числа файлов, который уже был заранее просчитан — bigint, int, mediumint, smallint:

Для варианта социальной сети описанной выше, требуется 2 раза использовать класс: вначале для построения дерева папок, потом для построения в каждой папке дерева для файлов.

Так же обращаю ваше внимание, что в этом посте я опустил (а не не знал) тему «Максимально допустимое количество файлов на жестком диске».

Есть ли ограничение на число файлов в определенной папке?

сколько файлов может содержать папка? У меня 30К папок в папке 1. Каждая из папок имеет 1 файл изображения. Есть ли ограничение на количество файлов в папке может храниться?

Я использую Windows Server 2003, IIS6.

4 ответов

Примечание: предполагая NTFS, так как никто в здравом уме не будет использовать FAT ни для чего другого, кроме USB-накопителей или карт памяти, не говоря уже о сервере (ok, это мысль-это страшно).

Да, есть предел. Хранение большего количества файлов, чем частиц во Вселенной, может оказаться непрактичным. Однако фактический предел значительно меньше.

NTFS имеет максимум 4,294,967,295 (2 32 — 1) файлов на томе. Некоторые из них уже используются самой файловой системой, и папка также должна считаться файлами.

30,000 не так уж много файлов. Но Microsoft рекомендует что ты выключить автоматическое создание DOS-совместимых коротких имен, если вы двигаетесь мимо 300,000, как найти уникальное короткое имя становится трудно, то.

там нет практических ограничений на объединенные размеры всех файлов в папке, хотя могут быть ограничения на количество файлов в папке. Что еще более важно, существуют ограничения на размер отдельных файлов, которые зависят от того, какую файловую систему вы используете на жестком диске. («Файловая система» — это не что иное, как спецификация того, как именно файлы хранятся на диске.)

разберем по файловой системе:

•жир aka FAT16

жир, для таблицы распределения файлов, является преемником оригинальной файловой системы FAT12, поставляемой с MS-DOS много, много лет назад.

Maximum максимальный размер диска: 4 гигабайта

◦максимальный размер файла: 4 ГБ

◦максимальное количество файлов на диске: 65,517

Maximum максимальное количество файлов в одной папке: 512 (если я правильно помню, корневая папка «/» имела нижний предел 128).

•FAT32

» там нет практических лимит на общий размер всех файлов в папке, хотя там может быть ограничения на количество файлов в папке.»FAT32 был введен для преодоления некоторых ограничений FAT16.

◦максимальный размер диска: 2 ТБ

◦максимальный размер файла: 4 ГБ

◦максимальное количество файлов на диске: 268,435,437

◦максимальное количество файлов в одной папке: 65 534

•NTFS

NTFS, или » новая технология Файловая система», введенная в Windows NT, является полностью переработанной файловой системой.

◦максимальный размер диска: 256 терабайт

◦максимальный размер файла: 256 терабайт

◦максимальное количество файлов на диске: 4,294,967,295

◦максимальное число файлов в одной папке: 4,294,967,295

обратите внимание, что когда я говорю «диск» выше, я действительно говорю о «логических» дисках, не обязательно физических. Никто не делает 256 терабайт диск, но с помощью NTFS массив дисков можно рассматривать как один логический диск. Предположительно, если у вас их достаточно, вы можете построить огромный логический диск.

Также обратите внимание, что ограничение NTFS в 256 терабайт вполне может быть просто ограничение реализации — я читал, что формат NTFS может поддерживать диски до 16 эксабайт (16 раз 1,152,921,504,606,846,976 байт).

Вы можете поместить 4,294,967,295 файлов в одну папку, если диск отформатирован в NTFS (было бы необычно, если бы это было не так), при условии, что вы не превышаете 256 терабайт (размер одного файла и пространство) или все доступное дисковое пространство, в зависимости от того, что меньше.

Есть ли ограничение на количество файлов в папке Windows?

Максимальный размер файла: 256 терабайт. Максимальное количество файлов на диске: 4,294,967,295 4,294,967,295 XNUMX XNUMX. Максимальное количество файлов в одной папке: XNUMX XNUMX XNUMX XNUMX.

Сколько папок можно хранить в папке?

5 ответов. См. Эту ссылку в Microsoft. Он предполагает, что нет ограничений на количество файлов в данной папке, пока количество файлов на любом заданном томе не превышает 4,294,967,295 32 XNUMX XNUMX (в NTFS), ссылка дает гораздо более низкие ограничения для FATXNUMX.

Какой максимальный размер файла в Windows 10?

NTFS может поддерживать тома размером до 8 петабайт в Windows Server 2019 и новее и Windows 10 версии 1709 и новее (более старые версии поддерживают до 256 ТБ). Поддерживаемые размеры томов зависят от размера кластера и количества кластеров.

Сколько файлов может быть в каталоге?

Максимальное количество файлов в каталоге: 216 — 1 (65,535 XNUMX)

Как ограничить размер папки в Windows 10?

Как настроить квоту на объем в Windows 10

  1. Откройте проводник (клавиша Windows + E).
  2. Щелкните по этому компьютеру.
  3. В разделе «Устройства и диски» щелкните правой кнопкой мыши диск, который нужно ограничить, и выберите «Свойства».
  4. Щелкните вкладку Quota.
  5. Нажмите кнопку Показать параметры квоты.
  6. Установите флажок Включить управление квотами.

Сколько подпапок можно создать в папке?

Таким образом, нет ограничений на количество уровней вложенности для папок. Однако максимальное количество подкаталогов в одном каталоге для ext3 ограничено примерно 32000.

Как мне организовать файлы и папки на моем компьютере?

Лучшие практики для организации компьютерных файлов

  1. Пропустите рабочий стол. Никогда не храните файлы на рабочем столе. …
  2. Пропустить загрузки. Не позволяйте файлам оставаться в папке «Загрузки». …
  3. Немедленно подайте документы в архив. …
  4. Сортируйте все раз в неделю. …
  5. Используйте описательные имена. …
  6. Поиск — это мощный инструмент. …
  7. Не используйте слишком много папок. …
  8. Придерживаться.

Какая функциональность у папок в Windows?

Папки помогают хранить файлы организованными и отдельными. Если бы на вашем компьютере не было папок, все ваши документы, программы и файлы операционной системы были бы расположены в одном месте. Папки также позволяют иметь более одного файла с одним и тем же именем. Например, у вас может быть файл под названием Resume.

В чем разница между файлом и папкой?

Файл — это обычная единица хранения в компьютере, и все программы и данные «записываются» в файл и «читаются» из файла. Папка содержит один или несколько файлов, и папка может быть пустой, пока не будет заполнена. Папка также может содержать другие папки, и в папках может быть много уровней папок.

Какую файловую систему использует Windows 10?

Windows 10 использует файловую систему NTFS по умолчанию, как и Windows 8 и 8.1. Хотя в последние месяцы профессионалы ходили слухами о полном изменении новой файловой системы ReFS, последняя техническая сборка, выпущенная Microsoft, не привела к кардинальным изменениям, и Windows 10 продолжала использовать NTFS в качестве стандартной файловой системы.

Какой самый большой размер файла для exFAT?

Функции. Спецификации, функции и требования файловой системы exFAT включают в себя: Ограничение размера файла 16 эксбибайт (264-1 байта или около 1019 байтов, что в противном случае ограничено максимальным размером тома 128 ПиБ или 257-1 байтов) , увеличенный с 4 ГиБ (232-1 байт) в стандартной файловой системе FAT32.

Как передать файлы размером более 4 ГБ в FAT32?

К сожалению, нет возможности скопировать файл размером> 4 ГБ в файловую систему FAT32. И быстрый Google говорит, что ваша PS3 распознает только файловые системы FAT32. Единственный вариант — использовать файлы меньшего размера. Возможно, порежьте их на куски, прежде чем перемещать или сжимать.

Каков максимальный размер файла FAT32?

ограничения
Максимум. размер файла 2,147,483,647 байтов (2 ГиБ — 1) (без LFS) 4,294,967,295 байтов (4 ГиБ — 1) (с LFS) 274,877,906,943 байта (256 ГиБ — 1) (только с FAT32 +)
Детализация размера файла 16 байт
Максимум. количество файлов 268,173,300 32 XNUMX для кластеров XNUMX КБ

Сколько файлов может содержать FAT32?

Максимальный размер каталога FAT32 составляет 65536 32-битных записей. Для файла потребуется как минимум 2 записи в зависимости от длины имени файла. Длинные имена файлов сохраняются в 16-битных символах UNICODE, и только тринадцать символов хранятся в каждой записи каталога. Следует избегать больших каталогов по соображениям производительности.

Сколько данных может вместить FAT32?

Размер отдельных файлов на диске FAT32 не может превышать 4 ГБ — это максимум. Раздел FAT32 также должен быть меньше 8 ТБ, что, по общему признанию, является меньшим ограничением, если вы не используете диски сверхвысокой емкости.

Dies Irae Dies Irae

03.10.2019

Сколько вложенных папок можно создать в Виндовс?

lightsaber lightsaber
03.10.2019

Пока объём диска не кончится

ξένος ξένος
03.10.2019

Вирус помню был в году 2006 создавал клон папки в папке и так до бесконечности.

Евгений Покровский Евгений Покровский
03.10.2019

По количеству именно папок ограничений нет. А есть — вот такие, зависит от файловой системы

FAT32
Максимальный размер диска: 2 терабайта
Максимальный размер файла: 4 гигабайта
Максимальное количество файлов на диске: 268,435,437
Максимальное количество файлов в одной папке: 65,534

NTFS:
Максимальный размер диска: 256Tb
Максимальный размер файла: 256Tb
Максимальное количество файлов на диске: 4 294 967 295
Максимальное количество файлов в одной папке: 4 294 967 295

leon melesh leon melesh
03.10.2019

Вложенность папок не ограничена

Stepeecoyote Stepeecoyote
03.10.2019

Создай батник, запусти и узнаешь!

Кот Мару Кот Мару
03.10.2019

Пока не упрешься в максимальное кол-во символов в пути (255). Но на десятке это ограничение можно отключить, так-что бесконечно.

elektron43 elektron43
03.10.2019

Никаких ограничений нет

  • Как можно если накачалось много папок в виндовс Чтобы не отрывать каждую вытащить содержимое из всех в новую папку?
  • Ошибка 0x80070017 Здравствуйте. Во время установки Windows 10 не удалось создать разделы удалить получился а создать н Ошибка 0x80070017 Здравствуйте… Во время установки Windows 10 не удалось создать разделы (удалить получился а создать н
  • Сколько файлов с одним именем, но разными расширениями можно создать в одной папке Windows 7+? Какое наибольшее количество файлов с одним именем (в данном случае, Nil) и различными расширениями имени модно создаиь в одной обычной папке Windows (7 и выше)? Даже учителя информатики не знают
  • Можно ли на виндоус 10, создать несколько папок? Срочно нужно 100 папок с названиями 1 до 100, скорее даже без разницы какие названия, но нужно большое количество папок. За несколько действий, а не создавать по 1 папке каждый раз.

Добавить комментарий

NTFS

Разработчик (и) Microsoft
Полное имя Файловая система NT
Введено июль 1993 г ​​.; 27 лет назад (1993-07) с Windows NT 3.1
Идентификатор раздела 0x07 (MBR ). EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 (GPT )
Structures
Содержимое каталога B-дерево вариант
Размещение файлов Bitmap
Плохие блоки $ BadClus (запись MFT)
Пределы
Макс.. размер тома 2кластеры — 1 кластер (формат);. 256 TiB — 64 KB (Windows 10 версия 1703, Windows Server 2016 или более ранняя реализация). 8 PB — 2 МБ (Windows 10 версии 1709, Windows Server 2019 или более поздняя реализация)
Макс. размер файла 16 EiB — 1 КБ (формат);. 16 ТБ — 64 KB (Windows 7, Windows Server 2008 R2 или более ранняя реализация). 256 TB — 64 KB (Windows 8, Windows Server 2012 или более поздняя реализация). 8 PB — 2 MiB (Windows 10 версии 1709, Windows Server 2019 или более поздняя реализация)
Макс. количество файлов 4,294,967,295 (2-1)
Макс. длина имени файла 255 UTF-16 единицы кода
Допустимые символы в именах файлов
  • В пространстве имен Win32 : любые UTF-16 единица кода (без учета регистра), кроме / : * "? <>|, а также NUL
  • В пространстве имен POSIX : любой UTF- 16 кодовая единица (с учетом регистра), кроме /, а также NUL
Функции
Записанные даты Создание, модификация, изменение POSIX, доступ
Диапазон дат 1 января 1601 г. — 28 мая 60056 г. (Время файла — это 64-битные числа, считающие 100-наносекундные интервалы (десять миллионов в секунду) с 1601 года, что составляет более 58000 лет)
Разрешение даты 100 нс
Форки Да (см. § Альтернативные потоки данных (ADS) ниже)
Атрибуты Только для чтения, скрытый, системный, архив, контент не проиндексирован, автономный, временный, сжатый
Разрешения файловой системы ACL
Прозрачное сжатие Для каждого файла, LZ77 (Windows NT 3.51 и далее)
Прозрачное шифрование для каждого файла,. D ESX (Windows 2000 и более поздние версии),. Triple DES (Windows XP и более поздние версии),. AES ( Пакет обновления 1 для Windows XP, Windows Server 2003 и более поздних версий)
Дедупликация данных Да (Windows Server 2012 )
Другое
Поддерживаемые операционные системы Windows NT 3.1 и новее. Mac OS X 10.3 и новее (только для чтения). ядро ​​Linux версии 2.6 и новее. ядро ​​Linux версии 2.2- 2.4 (только для чтения). ReactOS (только для чтения)

NTFS (NT File System ) является проприетарной файловая система журналов, разработанная Microsoft. Начиная с Windows NT 3.1, это файловая система по умолчанию для семейства Windows NT.

NTFS имеет несколько технических улучшений по сравнению с файловыми системами, которые она заменила — Таблица размещения файлов (FAT) и Высокопроизводительная файловая система (HPFS) — например, улучшенная поддержка метаданных и расширенных структур данных для повышения производительности, надежности и дискового пространства использование космоса. Дополнительные расширения представляют собой более сложную систему безопасности, основанную на списках управления доступом (ACL) и журналировании файловой системы..

NTFS также поддерживается в других операционных системах настольных компьютеров и серверов. Linux и BSD имеют бесплатный драйвер NTFS с открытым исходным кодом, называемый NTFS-3G, с функциями чтения и записи. macOS поставляется с поддержкой NTFS только для чтения; поддержка записи для NTFS нестабильна, поэтому по умолчанию запись файлов отключена.

Содержание

  • 1 История
  • 2 Версии
  • 3 Функции
    • 3.1 Масштабируемость
    • 3.2 Ведение журнала
    • 3.3 Жесткие ссылки
    • 3.4 Альтернативные потоки данных (ADS)
    • 3.5 Файл сжатие
      • 3.5.1 Алгоритмы CompactOS
    • 3.6 Разреженные файлы
    • 3.7 Теневое копирование тома
    • 3.8 Транзакции
    • 3.9 Безопасность
    • 3.10 Шифрование
    • 3.11 Квоты
    • 3.12 Точки повторной обработки
    • 3.13 Изменение размера
  • 4 Внутренние компоненты
    • 4.1 Загрузочный сектор раздела (VBR)
    • 4.2 Основная таблица файлов
    • 4.3 Метафайлы
    • 4.4 Списки атрибутов, атрибуты и потоки
    • 4.5 Резидентные и не- резидентные атрибуты
    • 4.6 Оппортунистические блокировки
    • 4.7 Время
  • 5 Взаимодействие
  • 6 Реализации
  • 7 См. также
  • 8 Ссылки
  • 9 Дополнительная литература

История

В середине 1980-х годов Microsoft и IBM сформировали совместный проект по созданию графической операционной системы следующего поколения; результатом были OS / 2 и HPFS. Поскольку Microsoft не соглашалась с IBM по многим важным вопросам, в конце концов они расстались; OS / 2 оставалась проектом IBM, а Microsoft работала над разработкой Windows NT и NTFS.

Файловая система HPFS для OS / 2 содержит несколько важных новых функций. Когда Microsoft создавала свою новую операционную систему, они «позаимствовали» многие из этих концепций для NTFS. Первыми разработчиками NTFS были Том Миллер, Гэри Кимура, Брайан Эндрю и Дэвид Гебель.

Вероятно, в результате этого общего происхождения HPFS и NTFS используют один и тот же раздел диска код типа идентификации (07). Использование одного и того же номера записи идентификатора раздела крайне необычно, поскольку были доступны десятки неиспользуемых кодовых номеров, а другие основные файловые системы имеют свои собственные коды. Например, в FAT их больше девяти (по одному для FAT12, FAT16, FAT32 и т. Д.). Алгоритмы, идентифицирующие файловую систему в разделе типа 07, должны выполнять дополнительные проверки, чтобы различать HPFS и NTFS.

Версии

Microsoft выпустила пять версий NTFS:

номер версии NTFS Первая операционная система Дата выпуска Новые функции Примечания
1.0 Windows NT 3.1 1993 Начальная версия NTFS 1.0 несовместима с 1.1 и новее: тома написаны Windows NT 3.5x не может быть прочитан Windows NT 3.1, пока не будет установлено обновление (доступное на установочном носителе NT 3.5x).
1.1 Windows NT 3.51 1995 Сжатые файлы, названные потоки и списки управления доступом
1.2 Windows NT 4.0 1996 Дескрипторы безопасности Обычно называются NTFS 4.0 после выпуска ОС
3.0 Windows 2000 2000 Дисковые квоты, Шифрованная файловая система, разреженные файлы, точки повторной обработки, ведение журнала обновлений порядкового номера (USN), папка $ Extendи ее файлы Совместимость также стала доступной для Windows NT 4.0 с обновлением Service Pack 4. te. После выпуска ОС обычно называется NTFS 5.0.
3.1 Windows XP октябрь 2001 Записи Master File Table (MFT) добавлены в записи с избыточным номером записи MFT ( полезен для восстановления поврежденных файлов MFT) Обычно называется NTFS 5.1 после выпуска ОС

Номер версии NTFS.sys(например, v5.0 в Windows 2000) зависит от операционной версия системы; его не следует путать с номером версии NTFS (v3.1 начиная с Windows XP).

Хотя в последующих версиях Windows были добавлены новые функции, связанные с файловой системой, они не изменили саму NTFS. Например, в Windows Vista реализованы символические ссылки NTFS, Transactional NTFS, сжатие раздела и самовосстановление. Символьные ссылки NTFS — это новая функция файловой системы; все остальные — это новые функции операционной системы, в которых используются уже существующие функции NTFS.

Возможности

NTFS v3.0 включает несколько новых функций по сравнению со своими предшественниками: поддержка разреженных файлов, квоты использования диска, точки повторной обработки, распределенное отслеживание ссылок и шифрование на уровне файлов, называемое Шифрованная файловая система (EFS).

Масштабируемость

NTFS оптимизирована для 4 KB кластеров, но поддерживает максимальный размер кластера 2 МБ. (Более ранние реализации поддерживают до 64 КБ). Максимальный размер тома NTFS, который может поддерживать спецификация, составляет 2–1 кластер, но не все реализации достигают этого теоретического максимума, как обсуждается ниже.

Максимальный размер тома NTFS, реализованный в Windows XP Professional, составляет 2–1 кластер, частично из-за ограничений таблицы разделов. Например, при использовании кластеров размером 64 КБ максимальный размер тома NTFS Windows XP составляет 256 ТБ минус 64 КБ. При использовании размера кластера по умолчанию 4 КБ максимальный размер тома NTFS составляет 16 ТБ минус 4 КБ. Оба эти значения значительно превышают ограничение в 128 ГБ в Windows XP SP1. Поскольку таблицы разделов на дисках с основной загрузочной записью (MBR) поддерживают только размеры разделов до 2 ТБ, несколько томов GUID Partition Table (GPT или «динамический») должны быть объединены для создания одного тома NTFS размером более 2 Туберкулез. Для загрузки с тома GPT в среду Windows способом, поддерживаемым Microsoft, требуется система с Unified Extensible Firmware Interface (UEFI) и поддержкой 64-разрядных версий.

Максимальный теоретический предел NTFS для размер отдельных файлов составляет 16 EiB (16 × 1024 или 2 байта) минус 1 КБ, что в сумме составляет 18 446 744 073 709 550 592 байта. В Windows 10 версии 1709 и Windows Server 2019 максимальный реализованный размер файла составляет 8 ПБ минус 2 МБ, или 9 007 199 252 643 840 байт.

Журнал

NTFS — это файловая система с журналированием, которая использует журнал NTFS ($ LogFile) для записи изменений метаданных на том. Это функция, которую FAT не предоставляет, и она критически важна для NTFS, чтобы гарантировать, что ее сложные внутренние структуры данных останутся согласованными в случае сбоев системы или перемещения данных, выполняемых дефрагментацией API, и позволяют легко откатить незафиксированные изменения этих критических структур данных при перемонтировании тома. В частности, затронутыми структурами являются битовая карта распределения томов, модификации записей MFT, такие как перемещение некоторых атрибутов переменной длины, хранящихся в записях MFT и списках атрибутов, а также индексы для каталогов и дескрипторов безопасности.

Формат ($ LogFile) претерпел несколько изменений:

версия Windows версия формата $ LogFile
Windows NT 4.0 1.1
Windows 2000 1.1
Windows XP 1.1
Windows Vista 1.1
Windows 7 1.1
Windows 8 1.1
Windows 8.1 2.0
Windows 10 2.0

Несовместимость версий $ LogFile, реализованная в Windows 8.1 и Windows 10, не позволяет Windows 8 (и более ранним версиям Windows) правильно обрабатывать $ LogFile в случае, если том NTFS остается в грязном состоянии в результате внезапного выключения или перехода в спящий режим на диск в состоянии выхода из системы (иначе: гибридная загрузка или быстрая загрузка, которая включена по умолчанию в Windows 10 ). Невозможность обработать v2.0 файла $ LogFile на грязных томах этими более ранними версиями Windows приводит к вызову утилиты восстановления диска CHKDSK при двойной загрузке Windows 10 с этими старые системы. Имеется параметр реестра Windows для предотвращения автоматического обновления $ LogFile до более новой версии.

Журнал USN (журнал обновлений порядковых номеров) — это управление системой функция, которая записывает (в $ Extend $ UsnJrnl) изменения файлов, потоков и каталогов на томе, а также их различные атрибуты и настройки безопасности. Журнал предоставляется приложениям для отслеживания изменений в объеме. Этот журнал можно включить или отключить на несистемных томах.

Жесткие ссылки

Функция жесткая ссылка позволяет различным именам файлов напрямую ссылаться на одно и то же содержимое файла. Жесткие ссылки аналогичны соединениям каталогов, но вместо этого относятся к файлам. Жесткие ссылки могут ссылаться только на файлы в одном томе, потому что каждый том имеет свой собственный MFT. Жесткие ссылки имеют собственные метаданные файлов, поэтому изменение размера файла или атрибутов одной жесткой ссылки может не обновить другие, пока они не будут открыты. Изначально жесткие ссылки были включены для поддержки подсистемы POSIX в Windows NT.

Windows использует жесткие ссылки для поддержки коротких (8.3) имен файлов в NTFS. Поддержка операционной системы необходима, потому что существуют устаревшие приложения, которые могут работать только с именами файлов 8.3. В этом случае добавляется дополнительная запись имени файла и запись каталога, но файлы 8.3 и длинное имя связываются и обновляются вместе, в отличие от обычной жесткой ссылки.

Файловая система NTFS имеет ограничение в 1024 жестких ссылок на файл.

Альтернативные потоки данных (ADS)

Альтернативные потоки данных позволяют больше чем один поток данных , связанный с именем файла (вилка ), используя формат «имя файла: имя потока» (например, «text.txt: extrastream»).

Потоки NTFS были введены в Windows NT 3.1, чтобы позволить службам для Macintosh (SFM) хранить вилки ресурсов. Хотя текущие версии Windows Server больше не включают SFM, сторонние продукты Apple Filing Protocol (AFP) (такие как GroupLogic ExtremeZ-IP ) по-прежнему используйте эту функцию файловой системы. Очень маленькие ADS (названные «Zone.Identifier») добавляются Internet Explorer, а в последнее время и другими браузерами, чтобы отмечать файлы, загруженные с внешних сайтов, как потенциально небезопасные для запуска; тогда локальная оболочка потребует подтверждения пользователя перед их открытием. Когда пользователь указывает, что он больше не хочет это диалоговое окно подтверждения, этот ADS удаляется.

Альтернативные потоки не отображаются в проводнике Windows, и их размер не входит в размер файла. Когда файл копируется или перемещается в другую файловую систему без поддержки ADS, пользователь получает предупреждение о невозможности сохранения альтернативных потоков данных. Такое предупреждение обычно не появляется, если файл прикреплен к электронному письму или загружен на веб-сайт. Таким образом, использование альтернативных потоков для критических данных может вызвать проблемы. Microsoft предоставляет инструмент под названием Streams для просмотра потоков на выбранном томе. Начиная с Windows PowerShell 3.0, можно управлять ADS изначально с помощью шести командлетов: Add-Content, Clear-Content, Get-Content, Get-Item, Remove-Item, Set-Content.

Вредоносное ПО использовало альтернативные потоки данных для сокрытия кода. В результате сканеры вредоносных программ и другие специальные инструменты теперь проверяют наличие альтернативных потоков данных.

Сжатие файлов

NTFS может сжимать файлы с использованием алгоритма LZNT1 (вариант LZ77 ). Файлы сжимаются в 16 блоков кластера. При 4 кластерах КБ файлы сжимаются блоками по 64 КБ. Алгоритмы сжатия в NTFS предназначены для поддержки кластеров размером до 4 КБ. Если размер кластера на томе NTFS превышает 4 КБ, сжатие NTFS недоступно. Если сжатие уменьшает объем данных с 64 КБ до 60 КБ или меньше, NTFS обрабатывает ненужные страницы размером 4 КБ как пустые кластеры разреженного файла — они не записываются. Это обеспечивает разумное время произвольного доступа, поскольку ОС просто должна следовать цепочке фрагментов.

Примечание: Следующий раздел относится к тестам, исследованиям и рекомендациям, выполненным и предназначенным для устройств хранения с высоким временем доступа, таких как механический жесткий диск, , где используются внутренние головки для чтения данных его необходимо физически переместить и правильно расположить, а затем подождать, пока данные на вращающихся дисках пройдут под ними. См. Ниже обновленную информацию о SSD и аналогичных устройствах с малым временем доступа.

Однако большие сжимаемые файлы становятся сильно фрагментированными, поскольку каждый кусок меньше 64 КБ становится фрагментом. Согласно исследованию группы разработчиков NTFS Microsoft, 50–60 ГБ — это разумный максимальный размер для сжатого файла на томе NTFS с размером кластера (блока) 4 КБ (по умолчанию). Этот разумный максимальный размер резко уменьшается для томов с меньшим размером кластера. Однопользовательские системы с ограниченным пространством на жестком диске могут извлечь выгоду из сжатия NTFS для небольших файлов, от 4 КБ до 64 КБ или более, в зависимости от степени сжатия. Файлы размером менее 900 байт хранятся в записи каталога флэш-памяти MFT.

, например, диски SSD не имеют задержек движения головки жестких дисков, поэтому фрагментация имеет меньший штраф. Пользователи быстрых многоядерных процессоров найдут улучшения в скорости приложений за счет сжатия своих приложений и данных, а также за счет уменьшения используемого пространства. Обратите внимание, что твердотельные накопители с контроллерами Sandforce уже сжимают данные. Однако, поскольку передается меньше данных, уменьшается количество операций ввода-вывода.

Сжатие лучше всего работает с файлами, которые имеют повторяющееся содержимое, редко записываются, обычно используются последовательно и сами не сжимаются. Файлы журнала — идеальный пример.

Если системные файлы, необходимые во время загрузки (например, драйверы, NTLDR, winload.exe или BOOTMGR), сжаты, система может не загрузиться правильно, потому что фильтры декомпрессии еще не загружены. Более поздние версии Windows не позволяют сжимать важные системные файлы.

Файлы можно сжимать или распаковывать по отдельности (путем изменения дополнительных атрибутов) для диска, каталога или дерева каталогов, становясь по умолчанию для файлов внутри.

Хотя доступ для чтения и записи к сжатым файлам прозрачен, Microsoft рекомендует избегать сжатия на серверах или общих сетевых ресурсах, содержащих перемещаемые профили, поскольку это создает значительную нагрузку на процессор.

Алгоритмы CompactOS

Начиная с Windows 10, Microsoft представила дополнительные алгоритмы, а именно XPRESS4K / 8K / 16K и LZX. Оба алгоритма основаны на LZ77 с энтропийным кодированием Хаффмана, которого не хватало в LZNT1. Эти алгоритмы были взяты из Windows Imaging Format. В основном они используются для новой функции CompactOS, которая сжимает весь системный раздел с помощью одного из этих алгоритмов. Их также можно вручную включить для каждого файла с помощью флага / exeкоманды compact. При использовании с файлами алгоритм CompactOS избегает фрагментации, записывая сжатые данные в непрерывно выделенные блоки.

Разреженные файлы

Разреженный файл: пустые байты не нужно сохранять, поэтому они могут быть представлены в виде метаданных.

Разреженные файлы — это файлы с вкраплениями пустых сегментов, для которых не используется фактическое пространство для хранения. Для приложений файл выглядит как обычный файл с пустыми областями, которые выглядят как области, заполненные нулями. Редкий файл не обязательно включает области с разреженными нулями; атрибут «разреженный файл» просто означает, что они разрешены для файла.

Приложения баз данных, например, могут использовать разреженные файлы. Как и в случае со сжатыми файлами, фактические размеры разреженных файлов не учитываются при определении пределов квот.

Теневое копирование тома

Служба теневого копирования тома (VSS) сохраняет исторические версии файлов и папок на томах NTFS путем копирования старых, недавно перезаписанных данных в теневую копию с помощью метода копирование при записи. Позже пользователь может запросить восстановление более ранней версии. Это также позволяет программам резервного копирования данных архивировать файлы, которые в настоящее время используются файловой системой. В сильно загруженных системах Microsoft рекомендует настраивать том с теневой копией на отдельном диске.

В Windows Vista также представлены постоянные теневые копии для использования с Восстановление системы и Предыдущие версии особенности. Однако постоянные теневые копии удаляются, когда более старая операционная система подключает этот том NTFS. Это происходит потому, что старая операционная система не поддерживает новый формат постоянных теневых копий.

Транзакции

Начиная с Windows Vista, приложения могут использовать Транзакционную NTFS (TxF) для объединения нескольких изменений файлов в одну транзакцию. Транзакция гарантирует, что либо все изменения произойдут, либо ни одно из них не произойдет, и что ни одно приложение за пределами транзакции не увидит изменения, пока они не будут зафиксированы.

Он использует те же методы, что и для Volume Shadow Копирование (т. Е. Копирование при записи) для обеспечения безопасного отката перезаписанных данных и журнал CLFS для отметки транзакций, которые еще не были зафиксированы, или транзакций, которые были зафиксированы, но еще не зафиксированы. применяется полностью (в случае сбоя системы во время фиксации одним из участников).

Транзакционная NTFS не ограничивает транзакции только локальным томом NTFS, но также включает другие транзакционные данные или операции в других местах, например данные, хранящиеся в отдельных томах, локальный реестр или базы данных SQL, или текущие состояния системных служб или удаленных служб. Эти транзакции координируются в масштабе всей сети со всеми участниками, использующими конкретную службу, DTC, чтобы гарантировать, что все участники получат одно и то же состояние фиксации, и для передачи изменений, которые были подтверждены любым участником (чтобы другие могут аннулировать свои локальные кеши для старых данных или откатить свои текущие незафиксированные изменения). Транзакционная NTFS позволяет, например, создавать согласованные распределенные файловые системы в масштабе всей сети, в том числе с их локальными оперативными или автономными кэшами.

Microsoft теперь не рекомендует использовать TxF: «Microsoft настоятельно рекомендует разработчикам использовать альтернативные средства», поскольку «TxF может быть недоступен в будущих версиях Microsoft Windows».

Безопасность

В NTFS каждому файлу или папке назначается дескриптор безопасности , который определяет его владельца и содержит два списка управления доступом (ACL). Первый ACL, называемый список управления дискреционным доступом (DACL), точно определяет, какие типы взаимодействий (например, чтение, запись, выполнение или удаление) разрешены или запрещены каким пользователем или группами пользователей. Например, файлы в папке C: Program Filesмогут быть прочитаны и выполнены всеми пользователями, но изменены только пользователем, имеющим административные привилегии. Windows Vista добавляет информацию об обязательном управлении доступом в списки DACL. DACL являются основным направлением Контроль учетных записей пользователей в Windows Vista и более поздних версиях.

Второй ACL, называемый системным списком управления доступом (SACL), определяет, какие взаимодействия с файлом или папкой должны проверяться и должны ли они регистрироваться в случае успешного или неудачного действия или и того, и другого. Например, аудит может быть включен для конфиденциальных файлов компании, чтобы ее менеджеры узнавали, когда кто-то пытается удалить их или сделать их копию, и удастся ли ему или ей.

Шифрование

Шифрованная файловая система (EFS) обеспечивает надежное и прозрачное для пользователя шифрование любого файла или папки на томе NTFS. EFS работает вместе со службой EFS, Microsoft CryptoAPI и библиотекой времени выполнения файловой системы EFS (FSRTL). EFS работает путем шифрования файла с помощью массового симметричного ключа (также известного как ключ шифрования файла или FEK), который используется, поскольку для шифрования и дешифрования больших объемов данных требуется относительно небольшое количество времени. чем при использовании шифра с асимметричным ключом . Симметричный ключ, который используется для шифрования файла, затем шифруется с помощью открытого ключа, связанного с пользователем, который зашифровал файл, и эти зашифрованные данные сохраняются в альтернативном потоке данных зашифрованного файла. Чтобы расшифровать файл, файловая система использует закрытый ключ пользователя для расшифровки симметричного ключа, который хранится в потоке данных. Затем он использует симметричный ключ для дешифрования файла. Поскольку это делается на уровне файловой системы, это прозрачно для пользователя. Кроме того, в случае потери пользователем доступа к своему ключу в систему EFS была встроена поддержка дополнительных ключей дешифрования, так что агент восстановления может получить доступ к файлам при необходимости. Шифрование с помощью NTFS и сжатие с помощью NTFS взаимоисключают; однако NTFS можно использовать для одного и стороннего инструмента для другого.

Поддержка EFS недоступна в версиях Windows Basic, Home и MediaCenter, и ее необходимо активировать после установки версий Windows Professional, Ultimate и Server или с помощью средств корпоративного развертывания в доменах Windows.

Квоты

Дисковые квоты были введены в NTFS v3. Они позволяют администратору компьютера с версией Windows, поддерживающей NTFS, устанавливать пороговое значение дискового пространства, которое могут использовать пользователи. Это также позволяет администраторам отслеживать, сколько дискового пространства использует каждый пользователь. Администратор может указать определенный уровень дискового пространства, который пользователь может использовать до получения предупреждения, а затем отказать пользователю в доступе, как только он достигнет своего верхнего предела пространства. Дисковые квоты не учитывают прозрачное сжатие файлов NTFS, если оно включено. Приложения, которые запрашивают количество свободного места, также будут видеть количество свободного места, оставшегося для пользователя, к которому применена квота.

Точки повторной обработки

Появившиеся в NTFS v3 точки повторной обработки NTFS используются путем связывания тега повторной обработки в атрибуте пользовательского пространства файла или каталога. Microsoft включает несколько тегов по умолчанию, включая символические ссылки, точки соединения каталогов и точки монтирования тома. Когда Диспетчер объектов анализирует поиск по имени файловой системы и обнаруживает атрибут повторной обработки, он повторно анализирует поиск по имени, передавая управляемые пользователем данные повторного анализа каждому драйверу фильтра файловой системы, загружаемому в Windows. Каждый драйвер фильтра проверяет данные повторной обработки, чтобы определить, связаны ли они с этой точкой повторной обработки, и если драйвер фильтра определяет совпадение, он перехватывает запрос файловой системы и выполняет свои специальные функции.

Изменение размера

Начиная с Windows Vista Microsoft добавила встроенную возможность сжимать или расширять раздел. Однако эта возможность не перемещает фрагменты файла подкачки или файлы, которые были помечены как неперемещаемые, поэтому для сжатия тома часто требуется перемещение или отключение любого файла страницы , индекса Windows Search, и любое теневое копирование, используемое System Restore. Различные сторонние инструменты могут изменять размер разделов NTFS.

Внутреннее устройство

Разрешения файловой системы NTFS в системе Windows Vista

Внутренне NTFS использует B-деревья для индексации данных файловой системы. Журнал файловой системы используется для гарантии целостности метаданных файловой системы, но не содержимого отдельных файлов. Известно, что системы, использующие NTFS, обладают повышенной надежностью по сравнению с файловыми системами FAT.

NTFS допускает любую последовательность 16-битных значений для кодирования имен (имена файлов, имена потоков, имена индексов и т. Д.), Кроме 0x0000. Это означает, что поддерживаются блоки кода UTF-16, но файловая система не проверяет правильность последовательности UTF-16 (допускает любую последовательность short значения, не ограниченные стандартом Unicode). В пространстве имен Win32 любые единицы кода UTF-16 нечувствительны к регистру, тогда как в пространстве имен POSIX они чувствительны к регистру. Имена файлов ограничены 255 кодовыми единицами UTF-16. Некоторые имена зарезервированы в корневом каталоге тома и не могут использоваться для файлов. Это $ MFT , $ MFTMirr, $ LogFile, $ Volume, $ AttrDef, .(точка), $ Bitmap, $ Boot, $ BadClus, $ Secure, $ UpCaseи $ Extend..(точка) и $ Extend— это каталоги; остальные — файлы. Ядро NT ограничивает полные пути до 32 767 единиц кода UTF-16. Существуют некоторые дополнительные ограничения на кодовые точки и имена файлов.

Загрузочный сектор раздела (VBR)

Этот формат загрузочного раздела примерно основан на более ранней файловой системе FAT, но поля находятся в разных местах. Некоторые из этих полей, особенно поля «секторов на дорожку», «количество головок» и «скрытых секторов» могут содержать фиктивные значения на дисках, где они либо не имеют смысла, либо не поддаются определению.

ОС сначала просматривает 8 байтов в 0x30, чтобы найти номер кластера $ MFT, затем умножает это число на количество секторов в кластере (1 байт находится в 0x0D). Это значение представляет собой смещение сектора (LBA ) относительно $ MFT, которое описано ниже.

Главная таблица файлов

В NTFS все данные файла, каталога и метафайла — имя файла, дата создания, права доступа (с использованием контроля доступа списки ), а размер — хранятся как метаданные в главной таблице файлов (MFT ). Этот абстрактный подход позволял легко добавлять функции файловой системы во время разработки Windows NT — примером является добавление полей для индексации, используемых программным обеспечением Active Directory. Это также позволяет программному обеспечению быстрого поиска файлов очень быстро находить названные локальные файлы и папки, включенные в MFT, без необходимости в каком-либо другом индексе.

Структура MFT поддерживает алгоритмы, которые минимизируют фрагментацию диска. Запись в каталоге состоит из имени файла и «идентификатора файла» (аналогично индексу с номером ), который представляет собой номер записи, представляющей файл в главной таблице файлов. Идентификатор файла также содержит счетчик повторного использования для обнаружения устаревших ссылок. Хотя это сильно напоминает W_FID Files-11, другие структуры NTFS радикально отличаются.

Две копии MFT сохраняются на случай повреждения. Если первая запись повреждена, NTFS читает вторую запись, чтобы найти файл зеркала MFT. Расположение обоих файлов хранится в загрузочном секторе.

Метафайлы

NTFS содержит несколько файлов, которые определяют и организуют файловую систему. Во всех отношениях большинство этих файлов имеют структуру, как и любой другой пользовательский файл (наиболее необычным является $ Volume), но не представляют прямого интереса для клиентов файловой системы. Эти метафайлы определяют файлы, выполняют резервное копирование критически важных данных файловой системы, буферируют изменения файловой системы, управляют распределением свободного пространства, удовлетворяют ожиданиям BIOS, отслеживают неверные единицы распределения и хранят информацию о безопасности и использовании дискового пространства. Все содержимое находится в безымянном потоке данных, если не указано иное.

Эти метафайлы обрабатываются Windows специально, обрабатываются непосредственно драйвером NTFS.SYS, и их трудно просматривать напрямую: необходимы специальные инструменты. Начиная с Windows 7 драйвер NTFS полностью запрещает доступ пользователей, что приводит к BSoD всякий раз, когда делается попытка выполнить файл метаданных. Одним из таких инструментов является nfi.exe («Утилита информации о файловом секторе NTFS»), которая свободно распространяется как часть Microsoft «OEM Support Tools». Например, для получения информации о сегменте главной таблицы файлов «$ MFT» используется следующая команда: nfi.exe c: $ MFTДругой способ обойти ограничение — использовать 7 -Zip файлового менеджера и перейдите к низкоуровневому пути NTFS \. X: (где X: соответствует любому диску / разделу). Здесь появятся 3 новые папки: $ EXTEND, [DELETED](псевдопапка, которую 7-Zip использует для прикрепления файлов, удаленных из файловой системы, для просмотра) и [SYSTEM](еще одна псевдопапка, содержащая все файлы метаданных NTFS). Этот прием можно использовать со съемными устройствами (USB флэш-накопителями, внешними жесткими дисками, SD-картами и т. Д.) Внутри Windows, но делать это на активном раздел требует автономного доступа (а именно WinRE ).

Списки атрибутов, атрибуты и потоки

Для каждого файла (или каталога), описанного в записи MFT, существует линейный репозиторий дескрипторов потоков (также именованных атрибутов), упакованных вместе в один или более записей MFT (содержащих так называемый список атрибутов) с дополнительным заполнением для заполнения фиксированного размера 1 КБ каждой записи MFT, что полностью описывает эффективные потоки, связанные с этим файлом.

Каждый атрибут имеет тип атрибута (целочисленное сопоставление фиксированного размера с определением атрибута в файле $ AttrDef), необязательное имя атрибута (например, используемое как имя для альтернативного потока данных) и значение, представленное в виде последовательности байтов. Для NTFS стандартные данные файлов, альтернативные потоки данных или данные индекса для каталогов хранятся как атрибуты.

Согласно $ AttrDef, некоторые атрибуты могут быть резидентными или нерезидентными. Атрибут $ DATA, который содержит данные файла, является таким примером. Когда атрибут является резидентным (который представлен флагом), его значение сохраняется непосредственно в записи MFT. В противном случае для данных выделяются кластеры, и информация о местоположении кластера сохраняется по мере выполнения данных в атрибуте.

  • Для каждого файла в MFT, атрибуты, идентифицированные по типу атрибута, имя атрибута должно быть уникальным. Кроме того, NTFS имеет некоторые ограничения порядка для этих атрибутов.
  • Существует предопределенный тип нулевого атрибута, используемый для обозначения конца списка атрибутов в одной записи MFT. Он должен присутствовать в качестве последнего атрибута в записи (все остальное пространство хранения, доступное после него, будет проигнорировано и просто состоит из байтов заполнения, чтобы соответствовать размеру записи в MFT).
  • Некоторые типы атрибутов требуются и должны присутствовать в каждой записи MFT, за исключением неиспользуемых записей, которые просто указаны нулевыми типами атрибутов.
    • Это относится к атрибуту $ STANDARD_INFORMATION, который хранится как запись фиксированного размера и содержит отметки времени и другие базовые однобитовые атрибуты (совместимые с атрибутами, управляемыми FAT в DOS или Windows 9x ).
  • Некоторые типы атрибутов не могут иметь имени и должны оставаться анонимными.
    • Это относится к стандартным атрибутам или для предпочтительного NTFS «имени файла» тип атрибута или тип атрибута «короткое имя файла», если он также присутствует (для совместимости с DOS-подобными приложениями см. ниже). Также возможно, чтобы файл содержал только короткое имя файла, и в этом случае он будет предпочтительный, как указано в проводнике Windows.
    • Атрибуты имени файла, хранящиеся в списке атрибутов, не делают файл сразу доступным через иерархическую файловую систему. Фактически, все имена файлов должны быть проиндексированы отдельно в по крайней мере, еще один каталог на том же томе. Он должен иметь свою собственную запись MFT и свой собственный дескрипторы безопасности и атрибуты, которые ссылаются на номер записи MFT для этого файла. Это позволяет несколько раз «жестко связать» один и тот же файл или каталог из нескольких контейнеров на одном томе, возможно, с разными именами файлов.
  • Поток данных по умолчанию для обычного файла — это поток типа $ DATA, но с анонимным именем, и ADS похожи, но должны иметь имена.
  • С другой стороны, поток данных каталогов по умолчанию имеет отдельный тип, но не анонимный: у них есть имя атрибута («$ I30» в NTFS 3+), который отражает его формат индексации.

Все атрибуты данного файла могут быть отображены с помощью nfi.exe («Утилита информации о файловом секторе NTFS»), которая свободно распространяется как часть Microsoft «OEM Support Tools».

Системные вызовы Windows могут обрабатывать альтернативные потоки данных. В зависимости от операционной системы, служебной программы и удаленной файловой системы при передаче файлов могут автоматически удаляться потоки данных. Безопасным способом копирования или перемещения файлов является использование системных вызовов BackupRead и BackupWrite, которые позволяют программам перечислять потоки, проверять, следует ли записывать каждый поток в целевой том, и сознательно пропускать нежелательные потоки.

Резидентные и нерезидентные атрибуты

Чтобы оптимизировать хранилище и уменьшить накладные расходы ввода-вывода для очень распространенного случая атрибутов с очень маленьким ассоциированным значением, NTFS предпочитает помещать значение внутри самого атрибута (если тогда размер атрибута не превышает максимального размера записи MFT) вместо использования пространства записи MFT для перечисления кластеров, содержащих данные; в этом случае атрибут не будет хранить данные напрямую, а просто сохранит карту распределения (в виде прогонов данных), указывающую на фактические данные, хранящиеся в другом месте на томе. Когда к значению можно получить доступ непосредственно из атрибута, оно называется «резидентными данными» (специалистами компьютерной криминалистики ). Количество подходящих данных сильно зависит от характеристик файла, но от 700 до 800 байт обычно используются в однопоточных файлах с короткими именами файлов и без списков контроля доступа.

  • Некоторые атрибуты (такие как предпочтительное имя файла, основные атрибуты файла) нельзя сделать нерезидентными. Для нерезидентных атрибутов их карта размещения должна соответствовать записям MFT.
  • Зашифрованные NTFS, разреженные потоки данных или сжатые потоки данных нельзя сделать резидентными.
  • Формат файла карта распределения для нерезидентных атрибутов зависит от ее способности поддерживать разреженное хранилище данных. В текущей реализации NTFS, после того, как нерезидентный поток данных был помечен и преобразован как разреженный, его нельзя изменить обратно на не разреженные данные, поэтому он не может снова стать резидентным, если эти данные не будут полностью усечены, отбрасывая разреженные данные. карта распределения полностью.
  • Когда нерезидентный атрибут настолько фрагментирован, что его эффективная карта распределения не может полностью уместиться в одной записи MFT, NTFS сохраняет атрибут в нескольких записях. Первая из них называется базовой записью, а остальные — записями расширения. NTFS создает специальный атрибут $ ATTRIBUTE_LIST для хранения информации, отображающей различные части длинного атрибута в записи MFT, что означает, что карта распределения может быть разделена на несколько записей. Сам $ ATTRIBUTE_LIST также может быть нерезидентным, но его собственная карта распределения должна соответствовать одной записи MFT.
  • Когда есть слишком много атрибутов для файла (включая ADS, расширенные атрибуты или безопасность дескрипторы ), так что они не могут вместить все в записи MFT, записи расширения также могут использоваться для хранения других атрибутов, используя тот же формат, что и в базовой записи MFT, но без ограничений по пространству одной Запись MFT.

Карта распределения хранится в виде прогонов данных со сжатым кодированием. Каждый цикл данных представляет собой непрерывную группу кластеров, в которых хранится значение атрибута. Для файлов на томе размером несколько ГБ каждая запись может быть закодирована от 5 до 7 байтов, что означает, что запись MFT размером 1 КБ может хранить около 100 таких прогонов данных. Однако, поскольку $ ATTRIBUTE_LIST также имеет ограничение по размеру, опасно иметь более 1 миллиона фрагментов одного файла на томе NTFS, что также подразумевает, что в целом не рекомендуется использовать сжатие NTFS для файла. более 10 ГБ.

Драйвер файловой системы NTFS иногда пытается переместить данные некоторых атрибутов, которые можно сделать нерезидентными, в кластеры, а также пытается переместить данные, хранящиеся в кластерах обратно к атрибуту внутри записи MFT на основе правил приоритета и предпочтительного порядка, а также ограничений по размеру.

Поскольку резидентные файлы не занимают кластеры напрямую («единицы распределения»), том NTFS может содержать больше файлов на томе, чем кластеров. Например, NTFS раздел на 74,5 ГБ форматируется с 19 543 064 кластерами по 4 КБ. Вычитание системных файлов (файл журнала размером 64 МБ, файл Bitmap размером 2442888 байт и около 25 кластеров фиксированных накладных расходов) оставляет 19 526 158 кластеров свободными для файлов и индексов. Поскольку на кластер приходится четыре записи MFT, теоретически этот том может содержать почти 4 × 19 526 158 = 78 104 632 резидентных файла.

Оппортунистические блокировки

Оппортунистические блокировки файлов (oplocks) позволяют клиентам изменять свою стратегию буферизации для данного файла или потока, чтобы повысить производительность и уменьшить использование сети. Блокировки применяются к данному открытому потоку файла и не влияют на блокировки в другом потоке.

Oplocks может использоваться для прозрачного доступа к файлам в фоновом режиме. Сетевой клиент может избегать записи информации в файл на удаленном сервере, если никакой другой процесс не обращается к данным, или он может буферизовать данные упреждающего чтения, если никакой другой процесс не записывает данные.

Windows поддерживает четыре разных типа блокировок:

  • Oplock уровня 2 (или разделяемый): несколько считывателей, без записи (например, кэширование чтения).
  • Уровень 1 (или исключительный) oplock: монопольный доступ с произвольной буферизацией (т.е. кэширование чтения и записи).
  • Пакетная блокировка (также эксклюзивная): поток открывается на сервере, но закрывается на клиентской машине (т.е. чтение, запись и кэширование обработки).
  • Неустранимая блокировка фильтра (также эксклюзивная): приложения и фильтры файловой системы могут «отступать», когда другие пытаются получить доступ к тому же потоку (например, кэширование чтения и записи) (начиная с Windows 2000)

Были установлены оппортунистические блокировки улучшено в Windows 7 и Windows Server 2008 R2 с помощью ключей дополнительной блокировки для каждого клиента.

Время

Windows NT и ее потомки сохраняют внутренние временные метки как UTC и выполняют соответствующие преобразования для демонстрационных целей; все временные метки NTFS указаны в формате UTC.

По историческим причинам все версии Windows, не поддерживающие NTFS, сохраняют внутреннее время как локальное поясное время, и, следовательно, то же самое делают все файловые системы, кроме NTFS, которые поддерживаются текущими версиями Windows. Это означает, что когда файлы копируются или перемещаются между разделами NTFS и не-NTFS, ОС должна на лету преобразовывать метки времени. Но если некоторые файлы перемещаются, когда действует летнее время (DST), а другие файлы перемещаются, когда действует стандартное время, могут возникнуть некоторые неоднозначности в преобразованиях. В результате, особенно вскоре после одного из дней, когда изменяется время локальной зоны, пользователи могут заметить, что некоторые файлы имеют временные метки с ошибкой на один час. Из-за различий в реализации DST в разных юрисдикциях это может привести к потенциальной ошибке метки времени до 4 часов в любой заданный 12 месяцев.

Совместимость

Хотя разные версии NTFS по большей части полностью вперед — и обратно совместимы, существуют технические соображения для монтирования новых томов NTFS в более старых версиях Microsoft Windows. Это влияет на двойную загрузку и внешние переносные жесткие диски. Например, попытка использовать раздел NTFS с «предыдущими версиями» (также известный как теневое копирование тома ) в операционной системе, которая его не поддерживает, приведет к потере содержимого этих предыдущих версий. Утилита командной строки Windows под названием convert.exe может преобразовывать поддерживаемые файловые системы в NTFS, включая HPFS (только в Windows NT 3.1, 3.5 и 3.51), FAT16 и FAT32 (в Windows 2000 и более поздних версиях).

Начиная с Windows 10 версии 1709, известной как Fall Creators Update, Microsoft требует, чтобы файловая структура OneDrive располагалась на диске NTFS. Это связано с тем, что тег повторной обработки для каждого файла и каталога в локальной файловой структуре OneDrive устанавливается рекурсивным образом, что делает файл или папку непригодными для использования в любой предыдущей версии Windows, с любым другим драйвером файловой системы NTFS или любой файловой системой. и утилиты резервного копирования, не обновленные для его поддержки. Неизвестно, является ли рекурсивное связывание функцией файловой системы NTFS или недокументированным обходным путем Microsoft для поддержки новой функции OneDrive «Файлы по запросу».

Реализации

FreeBSD 3.2, выпущенная в мае 1999 г., включала поддержку NTFS только для чтения, написанную Семеном Устименко. Эта реализация была перенесена на NetBSD Христосом Зуласом и Яромиром Долечеком и выпущена вместе с NetBSD 1.5 в декабре 2000 года. Реализация NTFS для FreeBSD была также перенесена на OpenBSD Жюльеном Бордетом и предлагает чтение в исходном виде. -поддержка только NTFS по умолчанию на платформах i386 и amd64 начиная с версии 4.9, выпущенной 1 мая 2011 года.

ядро ​​Linux версии 2.2.0 и более поздних версий включают возможность чтения разделов NTFS; версии ядра 2.6.0 и более поздние содержат драйвер, написанный Антоном Альтапармаковым (Кембриджский университет ) и Ричардом Руссоном, который поддерживает чтение, перезапись и изменение размера файлов. Из-за сложности внутренней структуры NTFS встроенный драйвер ядра 2.6.14 запрещает изменения тома, которые считаются небезопасными, во избежание повреждения.

Mac OS X 10.3 включала реализацию NTFS Устименко только для чтения из FreeBSD. Затем Apple наняла Антона Альтапармакова для написания новой реализации NTFS для Mac OS X 10.6. Встроенная поддержка записи NTFS была обнаружена в 10.6 и более поздних версиях, но не активирована по умолчанию, хотя существуют обходные пути для включения этой функции. Однако отчеты пользователей указывают на то, что функциональность нестабильна и имеет тенденцию вызывать «паники ядра », что, вероятно, является причиной того, что поддержка записи не была включена или объявлена.

Captive NTFS, «упаковка» драйвер, который использует собственный драйвер Windows ntfs.sys, существует для Linux. Он был построен как программа Filesystem in Userspace (FUSE) и выпущен под лицензией GPL, но работа над Captive NTFS была прекращена в 2006 году.

NTFS-3G является бесплатной GPL -лицензионная FUSE-реализация NTFS, которая изначально была разработана как драйвер ядра Linux Szabolcs Szakacsits. Он был переписан как программа FUSE для работы в других системах, поддерживаемых FUSE, таких как macOS, FreeBSD, NetBSD, OpenBSD, Solaris, QNX и <247.>Haiku и позволяет читать и записывать разделы NTFS. Коммерческая версия NTFS-3G с улучшенной производительностью, называемая «Tuxera NTFS для Mac», также доступна от разработчиков NTFS-3G.

Paragon Software Group продает драйвер чтения-записи с именем NTFS для Mac OS X, которая также включена в некоторые модели жестких дисков Seagate.

Пакет NetDrive для OS / 2 (и производные, такие как eComStation и ArcaOS ) поддерживает плагин, который обеспечивает доступ для чтения и записи к томам NTFS.

Существует бесплатный драйвер чтения / записи для MS-DOS от Avira под названием «NTFS4DOS».

Ahead Software разработала драйвер «NTFSREAD» (версия 1.200) для DR-DOS 7.0x с 2002 по 2004 год. Он был частью их программного обеспечения Nero Burning ROM.

См. Также

  • Сравнение файловых систем
  • NTFSDOS
  • ntfsresize
  • WinFS
  • ReFS

Ссылки

Дополнительная литература

Понравилась статья? Поделить с друзьями:
  • Максимальное количество символов в пути к файлу windows 10
  • Максимальное количество символов в названии файла windows
  • Максимальное количество символов в имени файла в oc windows
  • Максимальное количество процессоров в windows 10
  • Максимальное количество пользователей в windows xp