• The fat file system supports the following file types. File systems FAT32, exFAT and NTFS - what is the main difference. Organization of the fat file system

    Many users are faced with a lack of understanding of the basics of Windows file systems. It would seem, why an unnecessary theory? In fact, it is knowledge of the deep functioning of various file systems that allows you to correctly select one or another file system for a particular storage medium. Sometimes an error in choice can become critical later when solving the problem of information recovery or premature wear of the media.

    The file system consists of a file management system and a collection of files on a specific type of media (CD, DVD, FDD, HDD, Flash, etc.). A file management system enables users and applications to access files, save them, and maintain the integrity of their contents. The most common long-term storage medium in modern computing systems is the hard drive – “Winchester”. This term applies to any sealed disk with aerodynamically designed magnetic read heads.

    File systems of modern operating systems are installed on hard disk partitions.

    FAT 32. Simplicity and reliability.

    There are three FAT file systems: FAT12 (for FDD floppy disks), FAT16, FAT32. They differ in the number of bits (12, 16, 32) to indicate the cluster number in the file management system. In FAT file systems, the logical disk space of any logical drive is divided into a system area and a data area. BR – Boot Record; RS – reserved sectors; FAT1, FAT2 – file allocation tables 1 and 2; RDir (Root directory, ROOT) – root directory. The data area is divided into clusters, which represent 1 or more adjacent sectors. In a FAT table, clusters belonging to the same file are linked in a chain. The map of the data area is, in fact, the File Allocation Table (FAT). Each element of the FAT table (12, 16 or 32 bits) corresponds to one disk cluster and characterizes its state: free, busy, or a bad cluster. . To indicate the cluster number in the FAT16 file management system, a 16-bit word is used, and 65536 clusters can be addressed.

    A cluster is a minimally addressable unit of disk memory allocated to a file. A file or directory occupies an integer number of clusters. Dividing the data area into clusters instead of using sectors allows you to: reduce the size of the FAT table, reduce file fragmentation, reduce the length of file chains, speed up file access. The last cluster may not be fully used, which will lead to a noticeable loss of disk space if the cluster size is large. On a floppy disk, the cluster occupies 1 or 2 sectors. The hard drive has 4, 8, 16, 32, 64 sectors in one cluster. Each element has the following structure: file name, file attribute, reserve field, creation time, creation date, last access date, reserve, last modification date, last modification time, Fat initial cluster number, file size.

    In this example, a file named MyFile.txt is placed starting from the 8th cluster and occupies 12 clusters. The chain of clusters for this case: 8,9,A,B,15,16,17,19,1A,1B,1C,1D. Cluster number 18 is marked with code F7 as bad. It cannot be used to host data. This code is set by disk formatting and checking utilities. Cluster 1D is marked with the FF code as the final one belonging to this file. Free clusters are marked with code 0. When a new cluster is allocated, the first free cluster is taken for writing to a file. As files on the disk are changed, deleted, moved, grown and shrunk, this placement rule leads to fragmentation, i.e. the data of one file is not located in adjacent clusters, but sometimes very distant from each other. A complex chain is formed. This leads to slower work with files. Since Fat is used very intensively during disk access, it is loaded into RAM. The Fat32 system is much more efficient at using disk space because it uses smaller clusters compared to previous versions of Fat. Compared to Fat16, this gives a savings of 10-16%.

    A directory item's attribute field can store the following values:

    1) archive (installed when a file is changed and removed by a program that backs up files to another medium);

    2) directory;

    3) volume label;

    4) systemic;

    5) hidden;

    6) read-only.

    Long names in FAT32 are provided by using multiple directory entry entries: for one file (one entry is one entry for the 8.3 name, and 24 entries for the longest name, which can be up to 256 characters. Therefore, long names are not recommended.

    The main disadvantage of FAT is its slow processing of files. When creating a file, the rule is that the first free cluster is allocated. This leads to disk fragmentation and complex file chains. This results in slower work with files.

    Basically, the FAT file system is something to be avoided today. Therefore, it is vital to choose a suitable one that will allow you to avoid this file system.

    NTFS: convenience and high speed.

    One of the main concepts used when working with NTFS is the concept of volume. It is possible to create a fault-tolerant volume that occupies several partitions, that is, use RAID technology. NTFS divides all of the usable disk space on a volume into clusters—blocks of data that are addressed as data units. NTFS supports cluster sizes from 512 bytes to 64 KB; 2 or 4 KB of disk are allocated for the MFT zone - space that can be occupied by the main service metafile MFT, increasing in size. It is not possible to write data to this area. The MFT zone is empty so that the service file (MFT) does not become fragmented as it grows.

    MFT (common file table) is a centralized directory of all other files on the disk, including itself. MFT is divided into fixed size records of 1 KB, each record corresponding to a file. The first 16 files are of a service nature and are inaccessible to the operating system - they are called metafiles, with the very first metafile being the MFT itself. These first 16 MFT elements are the only part of the disk that has a strictly fixed position. A copy of these same 16 entries is kept in the middle of the volume for safety as they are very important. The remaining parts of the MFT file can be located in arbitrary places on the disk - you can restore its position using the file itself, “catching” on the very basis - on the first MFT element. Each file in NTFS is represented using streams; it does not have data, but rather "streams". One of the streams is file data. You can define multiple data streams for one file.

    Main features of NTFS:

    Work on large disks occurs efficiently (much more efficiently than in FAT);

    There are tools to restrict access to files and directories;

    NTFS partitions provide local security for both files and directories;

    A transaction mechanism has been introduced, in which file operations are logged;

    Significant increase in reliability;

    Many restrictions on the maximum number of disk sectors and/or clusters have been removed;

    A file name in NTFS, unlike the FAT and HPFS file systems, can contain any characters, including the full set of national alphabets, since the data is represented in Unicode - a 16-bit representation that gives 65535 different characters. The maximum length of a file name in NTFS is 255 characters.

    NTFS also has built-in compression capabilities that you can apply to individual files, entire directories, and even volumes (and then undo or reassign them as you see fit). A directory in NTFS is a special file that stores links to other files and directories.

    NTFS provides file-level security; this means that access rights to volumes, directories, and files may depend on the user account and the groups to which the user belongs. Every time a user accesses a file system object, his access rights are checked against the permission list of that object. If the user has sufficient rights, his request is granted; otherwise the request is rejected. This security model applies to both local user registration on NT computers and remote network requests.

    The NTFS system also has certain self-healing capabilities. NTFS supports various mechanisms for verifying system integrity, including transaction logging, which allows file write operations to be replayed against a special system log.

    The main disadvantage of the NTFS file system is that service data takes up a lot of space (for example, each directory element takes up 2 KB) - for small partitions, service data can take up to 25% of the media volume.

    Thus, when choosing a file system type, we are not choosing some abstract action, we are making a set of decisions that affect the entire system as a whole. Why know all the ins and outs of the file system in such detail? This is necessary for its possible restoration, which we will discuss in one of the following articles =)

    Each of us has formatted a flash drive, SD card, external or internal hard drive at least once in our lives and probably remembers that before formatting any of the above devices, the Windows operating system always asks what file system you want to format your device into: FAT32 , NTFS or exFAT?

    Of course, most users do not know the difference between them, and usually choose the default option. And all because Windows, asking this question, does not explain the difference between them. In this article we will try to explain it to you in a clear language and tell you how the FAT32 file system differs from NTFS and exFAT.

    FAT32 is the oldest of the file systems under consideration and is most often used on portable flash drives - flash drives or SD cards.

    NTFS is used by Windows as the primary file system for the drive on which the operating system is installed, and it also works well for other built-in drives and partitions on the hard drive of a Windows-based computer.

    exFAT is a more modern analogue of the outdated FAT32 system and is supported by more devices than NTFS, but still not as many as the “classic” FAT32.

    Now let's take a closer look at each of these file systems.

    File system FAT32

    FAT32 is the oldest file system discussed in this article. It began to be actively used starting from Windows 95 and replaced an even more outdated system - FAT16.

    The great age of this file system has its advantages and disadvantages.

    The advantages in this case include the fact that FAT32 has become a kind of standard and is still used by default in all removable media. If you buy a flash drive or SD card today, the FAT32 file system will be installed on it from the factory. This was done primarily so that your removable media could be supported not only by modern computers and gadgets, but also by old devices and game consoles that have a USB port and can only work with the FAT32 file system.

    However, due to the age of this system, it also has some disadvantages, the main of which is the limitation on the size of the file and the entire volume. Each individual file on this file system cannot be larger than 4 gigabytes, and the entire FAT32 partition cannot be larger than 8 terabytes.

    And if you can still come to terms with the second disadvantage (so far few people use drives larger than 8TB), then the limitation on file size is a rather serious disadvantage - most high-quality videos now no longer fit into the 4GB size, especially if they are in a modern format 4K.

    However, for now, this file system is still quite suitable for portable devices (like flash drives and SD cards, which contain many small files), but it is no longer suitable for a computer hard drive. First of all, it lacks some of the security features found in the more modern NTFS file system, and partly because of this, you can no longer install a modern version of Windows on a FAT32 drive; you will need to reformat it to NTFS.

    FAT32 compatible

    Devices with the FAT32 file system are the most universal and compatible with all versions of Windows, Mac OS, Linux operating systems, any game consoles and, in general, almost everything that has a USB port.

    Limitations of FAT32

    The main disadvantage of this file system is the limitations on file and volume sizes - the maximum file size cannot exceed 4 GB, and the maximum partition size is limited to 8 TB.

    Application of FAT32

    The main area of ​​use of this file system is external data storage devices, which are not intended to store large files and which require maximum compatibility with as many different devices as possible.

    File system NTFS

    NTFS- this is a more modern and technological file system, as evidenced by even the decoding of the abbreviation of its name -" new technology file system". Most of all, the Windows operating system loves it, which in general is not surprising - after all, both of them were developed by Microsoft.

    Starting with the version of Microsoft's operating system called XP, in which the NTFS system became standard for the first time, when installing Windows, a dialog box will definitely ask you to format the system partition with this particular file system. At this point, it's believed that you theoretically won't have to worry about the limitations of the NTFS file system for many years to come.

    In addition to the absence of serious restrictions on file and partition size, NTFS has several additional advantages, such as: support for file access rights (to increase data security), change logging (to restore the file structure in case of failure), encryption, disk quotas, hard links , and other modern features that make NTFS ideal for a system drive.

    That is why the partition of your disk on which the Windows operating system is installed must be formatted in NTFS. If you are going to install programs on other partitions of the same disk or other hard drives, they must also have the appropriate file system.

    Unfortunately, NTFS is not compatible with most other operating systems, as it was designed to meet the requirements of Windows OS. All versions of Microsoft's operating system, from XP to today's latest Windows 10, work perfectly with it, but other operating systems have significant limitations when working with it.

    For example, Mac OS can only read data from NTFS drives, but cannot write to them. Some rare Linux distributions may have the ability to write to NTFS disks, but most are still limited to reading information only. Neither version of the Playstation can handle NTFS, nor can Microsoft's Xbox 360, and only the new Xbox One supports this file system.

    NTFS Compatibility

    This file system works perfectly with all the latest versions of the Windows operating system since XP, has write restrictions on Mac OS and Linux, and does not work with most other devices, with the possible exception of the Xbox One.

    NTFS Limitations

    Limitations on the size of files or partitions in NTFS should not be limited for a long time, so we can say that at the moment there are none.

    Using NTFS

    The use of this file system is reasonable only on hard drives and SSDs on which the Windows operating system is installed, since only with it this format reveals all its advantages.

    exFAT file system

    exFAT was first introduced in 2008 and is the most modern of the file systems discussed in this article; its support was added to Windows starting with version XP through OS updates.

    The exFAT file system was created and optimized for use on external drives - flash drives, SD cards and external hard drives, and is designed to replace the outdated FAT32 system. It is the lightest and simplest file system due to the absence of various specialized features inherent in NTFS, as well as the almost complete absence of file and partition size restrictions that FAT32 has.

    Also, exFAT has better compatibility with various operating systems than NTFS, and devices with it are perfectly readable and rewritten on both Windows and Mac OS, and on Linux (provided that some software is installed).

    Since exFAT is supported by Mac OS by default, it will likely be supported by most other modern devices that Apple devices work with, such as digital cameras.

    Modern versions of gaming consoles such as Xbox One and Playstation 4 also support exFAT devices, unlike their previous versions (Xbox 360 and Playstation 3).

    exFAT compatible

    exFAT works perfectly with all modern versions of Windows (starting from XP) and Mac OS. To work with Linux, you will need to install additional software. This file system supports many more different devices than NTFS, but some of them (mostly older versions) can still only work with FAT32.

    exFAT Limitations

    Also, as in the case of NTFS, there are still no realistic restrictions on the size of a file or partition in the exFAT system.

    Application of exFAT

    This file system is perfect for use on various removable media, the file size of which can exceed 4 GB (external hard drives, large flash drives). If all the devices you work with are modern, you can easily abandon FAT32 on removable drives in favor of exFAT.

    To summarize, we can draw the following conclusions: NTFS is great for a Windows system hard drive, exFAT is better used on removable storage media, and FAT32 should only be used if you want to achieve maximum compatibility with the wide variety of your devices.

    Formatting a flash drive is not only a quick way to clean it of unnecessary files, but also choosing a specific file system that will allow a wide variety of devices to easily read information from this media: PCs, laptops, radios, TVs, DVD players, game consoles etc. Therefore, first, let’s look at which system is best for formatting a flash drive for you, touching on the features of each. Then we will dwell in detail on formatting algorithms for the popular FAT32 and NTFS.

    What is a file system

    A file system is a variant of organizing data on a particular medium. Each OS (and even a music player has one) has its own system that is harmoniously compatible with it. Or even several. Thus, when formatting an external or hard drive with a specific file system, you first of all determine which OS will be able to read it.

    Many people believe that it is only possible to format a flash drive in FAT32 or NTFS, but this is a misconception. There are many more file systems. Let's list the most famous:

    • On Windows: FAT32, exFAT, NTFS.
    • On Mac OS: HFS+.
    • On Linux: EXT2, EXT3.

    Let's get to know each of them in more detail.

    FAT32

    This file system is the oldest, most widespread and most reliable - it is the one that replaced FAT16. Therefore, many people, when deciding to format a flash drive in FAT32 or NTFS, traditionally choose the first option.

    This is a rare format that is supported by all operating systems and almost all game consoles and other devices with USB. But FAT32 imposes the following restrictions: the size of one file on the disk should not be more than 4 GB, and one partition should not be more than 8 TB.

    Many flash drives sold in stores are set to good old FAT by default, so that these drives can be read by both modern and legacy devices. This system is not at all suitable for hard drives today - to install modern Windows, the drive must be formatted in at least NTFS.

    Your choice is FAT32 if you want to get a flash drive on which you are supposed to write light-weight information, and with which the maximum number of different devices can work.

    NTFS

    Another Microsoft product. A flash drive formatted in this system can work mainly with Windows, sometimes with Linux. Apple technology can only read it, and game consoles do not support it at all (Xbox, PS). NTFS allows a single file size on media larger than flash media available today, and the partition limit is 16 Eb!

    In addition, the file system includes the following capabilities:

    • recording changes to restore the system in case of a crash;
    • establishing access rights to stored files;
    • disk quotas;
    • encryption, etc.

    Thus, formatting a removable drive on this system is not practical because... it is more tailored for hard drives and to work with Windows, rather than with other operating systems.

    exFAT

    When figuring out where it is better to format a flash drive - in FAT32 or NTFS, many ignore the more modern exFAT, also the brainchild of Windows. And it allows you to write files of almost unlimited size, setting the limit for one partition to a cosmic 64 Zb! Windows, the latest versions of Apple OS and Linux work well with it when installing additional packages. Modern versions of game consoles also support exFAT, which cannot be said about the Xbox 360 and Playstation 3.

    So, exFAT is the most modern file system from Windows, incorporating the compatibility capabilities of FAT32 and the broader functionality of NTFS. One drawback is that it only works with the latest versions of existing OSes and is useless on devices with outdated hardware.

    EXT2, 3 and HFS+

    HFS+ is a file system developed by Mac OS. Linux and Xbox also work with it; Windows is not supported. There are practically no restrictions on the size of one file; for a section - 8 Eb.

    EXT2, 3 is a Linux product. The maximum file size on a flash drive formatted in this system is 16 GB, for a partition - 32 TB. Among third-party OSes, only Xbox works with this format.

    How to format a flash drive to FAT32

    The algorithm is very simple:

    1. Connect the external drive to your computer, after the system sees it, go to “My Computer”. No formatting software is required for this system.
    2. RMB on the desired flash drive - “Format”.
    3. The desired system, as a rule, is already selected by default - all you have to do is click on “Start”.
    4. After a while, the computer will notify you that formatting is complete. That's it!

    How to format a flash drive to NTFS

    Formatting in this file system is more difficult, since it, in fact, is not intended for For the procedure, you will need the flash drive itself and a PC:

    1. In the "Control Panel" go to "System".
    2. In "Properties" you need the "Hardware" tab, and then "Device Manager".
    3. Next - “Disk devices” - double click on the desired flash drive to open its properties.
    4. Then "Policy" and "Optimize for Execution". Confirm the action and close the windows.
    5. Now go to "My Computer", select the desired removable drive.
    6. RMB by its name, then “Format”.
    7. How to format a flash drive to NTFS? The name you are looking for now appears in the "File system" drop-down menu - select it.
    8. Format the drive by clicking on "Start".
    9. In "My Computer" go to "Systems".
    10. Next - "Hardware", "Device Manager" - "Disk".
    11. Select the formatted removable drive, then go to its Properties.
    12. In the "Policy" check "Optimize for quick removal", confirm your choice.

    What's easier: format a flash drive in FAT32 or NTFS? The answer is obvious.

    Support programs

    To format a drive in a rare file system, sometimes the capabilities of one OS are not enough. Let's introduce some helper programs for formatting:

    • In NTFS - convert.exe (built-in Windows utility), HP USB Disk Storage Format Tool, Format USB Or Flash Drive Software.
    • In HFS+ and for SD, SHDC, SDXC, SD-C, LLC cards - SD Formatter.
    • For JetFlash, Transcend and A-DATA - JetFlash Recovery Tool.
    • Support for all file systems - MiniTool Partition Wizard.

    When thinking about whether to format a flash drive in FAT32 or NTFS, first of all, note what you need this drive for - to write large files, work with a variety of devices, store secret data, etc. After familiarizing yourself with the pros and cons of these file systems, you You can easily select the desired formatting algorithm in this article.

    Before the advent of the Microsoft Windows NT operating system, personal computer users rarely had the problem of choosing a file system. All owners of operating systems (OS) MS-DOS and Microsoft Windows used one of the types of file systems called FAT (FAT-12, FAT-16 or FAT-32).

    Now the situation has changed. When installing Microsoft Windows NT/2000/XP, when formatting the disk you need to choose between three file systems - FAT-16, FAT-32 or NTFS.

    In this article we will talk about the internal structure of the listed file systems, consider their inherent disadvantages and advantages. Armed with this knowledge, you can make an informed choice in favor of a particular file system for Microsoft Windows.

    Briefly about the FAT file system

    The FAT file system appeared at the dawn of the development of personal computers and was originally intended for storing files on floppy disks.

    Information is stored on disks and floppy disks in portions, in sectors of 512 bytes. The entire diskette space was divided into fixed-length areas called clusters. A cluster may contain one or more sectors.

    Each file occupies one or more clusters, possibly non-contiguous. File names and other information about files, such as size and creation date, are located in the initial area of ​​the floppy disk allocated to the root directory.

    In addition to the root directory, other directories can be created in the FAT file system. Together with the root directory, they form a directory tree containing information about files and directories. As for the location of file clusters on the disk, this information is stored in the initial area of ​​the floppy disk, called the File Allocation Table (FAT).

    Each cluster in the FAT table has its own individual cell, which stores information about how this cluster is used. Thus, the file allocation table is an array containing information about the clusters. The size of this array is determined by the total number of clusters on the disk.

    The directory stores the number of the first cluster allocated to a file or subdirectory. The numbers of the remaining clusters can be found using the FAT file allocation table.

    When developing the FAT table format, the goal was to save space, because... The floppy disk has a very small capacity (from 180 KB to 2.44 MB). Therefore, only 12 binary digits were allocated to store cluster numbers. As a result, the FAT table was packed so tightly that it occupied only one sector of the floppy disk.

    The FAT table contains critical information about the location of directories and files. If the FAT becomes corrupted due to hardware failure, software failure, or viruses, access to files and directories will be lost. Therefore, to be on the safe side, two copies of the FAT table are usually created on the disk.

    Different versions of FAT

    After the advent of large-capacity hard drives (in those days, disks 10-20 MB in size were considered large), the number of clusters increased, and 12 bits became insufficient to store their numbers. A new 16-bit file allocation table format was developed, where two bytes were allocated to store the number of one cluster. The old file system designed for floppy disks became known as FAT-12, and the new one became known as FAT-16.

    The enlarged FAT-16 table no longer fits in one sector, but with large disk sizes this drawback did not play a significant role. As before, two copies of the FAT table were stored on the disk for insurance.

    However, when disk space began to be measured in hundreds of MB and even gigabytes, the FAT-16 file system again became ineffective. In order for cluster numbers to fit into 16 bits, when formatting large disks it is necessary to increase the cluster size to 16 KB or even more. This caused problems when large numbers of small files needed to be stored on disk. Since file storage space is allocated in clusters, even a very small file requires too much disk space.

    As a result, another, apparently final attempt to improve the FAT file system was made - the file allocation table cell size was increased to 32. This made it possible to format disks of hundreds of MB and a few GB in size using a relatively small cluster size. The new file system became known as FAT-32.

    Standard 8.3

    Before the advent of Microsoft Windows 95, personal computer users were forced to use the very inconvenient “8.3 standard” for naming files, in which the file name had to consist of 8 characters plus 3 extension characters. This limitation was imposed not only by the program interface of the MS-DOS operating system, but also by the directory entry structure of the FAT file system.

    After modifying the structure of directory entries, the limit on the number of characters in a file name was practically removed. The filename can now be up to 255 characters long, which is obviously sufficient in most cases. However, such a modified FAT file system has become incompatible with the MS-DOS operating system, as well as with the Microsoft Windows shell versions 3.1 and 3.11 running in its environment.

    You can read more about the formats of internal FAT structures in our article “Data recovery in FAT partitions” published on this site.

    Limitations of the FAT file system

    When deciding whether to use the FAT file system to format a disk, you should be aware of its inherent limitations. These restrictions primarily concern the maximum size of a FAT disk, as well as the maximum size of a file located on this disk.

    The maximum size of a FAT-16 logical drive is 4 GB, which is very small by modern standards. Microsoft, however, does not recommend creating FAT-16 disks larger than 200 MB, because... In this case, disk space will be used very inefficiently.

    Theoretically, the maximum size of a FAT-32 disk can be 8 TB, which should be enough to deploy any modern applications. This value is obtained by multiplying the maximum number of clusters (268,435,445) by the maximum cluster size allowed by FAT-32 (32 KB).

    However, in practice the situation looks a little different.

    Due to internal limitations, the ScanDisk utility in Microsoft OS 95/98 is not able to work with disks larger than 127.53 GB. A year ago, such a limitation would not have caused problems, but today inexpensive 160 GB drives have already appeared on the market, and soon their capacity will be even larger.

    As for the new Microsoft Windows 2000/XP operating systems, they are not capable of creating FAT-32 partitions with a capacity exceeding 32 GB. If you need partitions of this size or larger, Microsoft will suggest you use the NTFS file system.

    Another significant limitation of FAT-32 is the file size - it cannot exceed 4 GB. This limitation will affect, for example, when recording video fragments to disk or when creating large database files.

    A FAT-32 directory can store a maximum of 65534 files.

    Disadvantages of FAT

    In addition to the limitations discussed above, the FAT file system also has other disadvantages. The most significant, apparently, is the complete absence of access control tools, as well as the possibility of losing information about the location of all files after the destruction of a fairly compact FAT table and its copy.

    By booting the computer from the system floppy disk, an attacker can easily gain access to any files stored on disks with the FAT file system. It will be easy for him to then copy these files to a ZIP device or some other external storage medium.

    When using FAT on server disks, it is impossible to ensure reliable and flexible delimitation of user access to directories. That is why, and also due to its low resistance to failures, FAT is usually not used on servers.

    The presence of compact FAT file allocation tables makes this file system a vulnerable target for computer viruses - it is enough to destroy the initial fragment of a FAT disk, and almost all data will be lost.

    File system NTFS

    The modern NTFS file system, developed by Microsoft for its Microsoft Windows NT operating system, is devoid of the limitations and disadvantages of FAT. Since its inception, the evolving NTFS file system has undergone several improvements, the latest of which (at the time of writing this article) were made in Microsoft Windows XP.

    In the NTFS file system, all file attributes (name, size, location of file extents on disk, etc.) are stored in a hidden system file $MFT. From one to several KB are allocated for storing information about each file (and directory) in $MFT. If there are a large number of files stored on the disk, the size of the $MFT file can reach tens or even hundreds of MB.

    Small files (on the order of hundreds of bytes) are stored directly in $MFT, which significantly speeds up access to them.

    Note, however, that the overhead of NTFS for storing system information, although it exceeds the overhead of FAT, is still not very large compared to the volume of modern disks. Because the $MFT file is usually located closer to the middle of the disk, destruction of the first tracks of an NTFS disk does not lead to such fatal consequences as destruction of the initial areas of a FAT disk.

    The NTFS file system has many features that FAT does not have. They allow for much greater flexibility, reliability and security compared to FAT.

    Let's list some of the most interesting features of NTFS in modern versions.

    Access control tools

    NTFS access control tools are quite flexible and allow you to control access at the level of individual files and directories, granting (or blocking) access to individual users or groups of users.

    Although at first glance it may seem that access control tools are needed only for file servers, they will also be required if several users have access to the computer.

    File encryption

    The access control tools mentioned above will be useless if the NTFS physical disk falls into the hands of an attacker. Using modern utilities, the contents of such a disk can be read without much difficulty in any operating system - DOS, Microsoft Windows or Linux.

    In order to protect user files from unauthorized access, Microsoft Windows 2000/XP operating systems provide additional encryption of files stored in NTFS partitions. And although the strength of such encryption may not be very high, it is quite sufficient in most cases.

    Software disk RAID

    Using NTFS, you can create a so-called software RAID 1 (Mirrored set). This array, made up of two physical or logical disks of the same size, allows you to duplicate (or, as they also say, “mirror”) files.

    Such an array can protect your files in the event of a physical failure of one of the disks that make up the array; therefore, it is often used to increase the reliability of a disk system.

    Volume Sets

    The NTFS file system allows you to combine several partitions located on one or more physical disks into one logical volume. This may be required, for example, to store large database files that do not fit on one physical disk, or to create a directory with a total volume of files that exceeds the size of the physical disk.

    Sets created from multiple partitions or physical disks are called Volume Set (in Microsoft Windows NT OS terminology) or Spanned Volume (in Windows 2000/XP OS terminology).

    Packing files

    To save disk space, you can use NTFS's ability to pack (compress) files. In addition, NTFS allows you to create so-called sparse files that contain areas of zero data. Such files can be large, but take up little disk space, since only the significant bytes of the file are actually stored.

    Please note that packing files will slow things down a bit. This circumstance, however, will not always matter. For example, office documents can be packed without a noticeable decrease in work speed, but this cannot be said about database files that are simultaneously accessed by a large number of users. With the availability of relatively inexpensive, huge volume discs on the market, packaging products should only be used when they are truly needed. This, however, also applies to other NTFS features.

    Multi-threaded files

    If necessary, several streams of information can be stored in one file written on an NTFS disk. This allows, in particular, to supply document files with additional information, store several versions of documents in one file (for example, in different languages), store program code and data in separate streams of one file, etc.

    Hard connections

    Hard links allow you to assign several different names to one physical file by placing these names (i.e., links to the file) in different directories. When you delete a link, the file itself is not deleted. Only when all connections of a file are destroyed will the file itself be deleted.

    Note that such capabilities are typical for file systems used in Unix-like operating systems, for example, in Linux, FreeBSD, etc.

    Override points

    NTFS system objects such as reparse points allow you to redefine any file or directory. In this case, for example, rarely used overridden files or directories can actually be stored on magnetic tape, loaded to disk only when necessary.

    Transitions

    Using NTFS jumps, you can mount another hard drive or CD into a disk directory. This feature originally existed in file systems of Unix-like operating systems.

    Disk space quotas

    The NTFS file system, used in Microsoft Windows 2000/XP, allows you to quota, or limit the disk space available to users. This feature is especially useful when creating file servers.

    Change logging

    During its operation, the operating system performs various actions on files (creation, modification, deletion). All such changes are saved in a special journal created on the NTFS volume and can be used by backup programs, indexing systems, etc. Logging changes increases the reliability of the file system, allowing in some cases to continue operation after non-critical failures of the operating system and hardware. Although, of course, most serious failures lead to the need to restore data from a backup copy or using special data recovery utilities.

    NTFS Limitations

    Despite the abundance of possibilities, the NTFS file system also has some limitations. However, in most cases they do not play a significant role.

    The maximum size of an NTFS logical disk is approximately 18,446,744 TB, which is obviously sufficient for all modern applications as well as applications that will appear in the near future. The maximum file size is even larger, so this limitation is also insignificant.

    The number of files stored in one NTFS directory is unlimited, so this also has an advantage over FAT.

    Comparison of NTFS and FAT in terms of file access speed

    In terms of promise, functionality, security and reliability, NTFS is far ahead of FAT. However, comparing the performance of these file systems does not give a clear result, since performance depends on many different factors.

    Since the operating principles and internal structures of FAT are much simpler than NTFS, FAT will most likely be faster when working with small directories. However, if the directory's contents are so small that it fits entirely into one or more $MFT file entries, or conversely, if the directory is very large, NTFS will win.

    NTFS will most likely take the lead when searching for non-existent files or directories (since it does not require the entire contents of the directory to be scanned), when accessing small files (on the order of hundreds of bytes), and also in the case of severe disk fragmentation.

    To increase NTFS performance, you can increase the cluster size, but this can lead to wasteful use of disk space when storing a large number of files, the size of which exceeds 1-2 KB and amounts to tens of KB. By increasing the cluster size to 64 KB, you can get the maximum performance improvement, but you will have to stop packing files and using defragmentation utilities.

    When compressing files located on small disks (about 4 GB), performance may increase, but when compressing large disks, performance may decrease. In any case, packaging will result in additional load on the central processor.

    So what to choose - FAT or NTFS?

    As you can see, NTFS has numerous advantages over FAT, and its limitations are in most cases insignificant. If you are faced with choosing a file system, consider using NTFS first, and only then FAT.

    What might be the obstacles that make it difficult to replace FAT with NTFS?

    The most serious obstacle is the need to use Microsoft Windows NT/2000/XP. For normal operation of this OS, at least 64 MB of RAM and a processor with a clock frequency of at least 200-300 MHz are required. However, these requirements are not met only by very old computers that are not capable of running modern versions of Microsoft Windows.

    If your computer can work in the Microsoft Windows 2000/XP environment, and you do not have a single application designed exclusively for Microsoft Windows 95/98/ME, we recommend that you switch to a new operating system at the first opportunity, replacing This is FAT on NTFS.

    At the same time, you will also receive a noticeable increase in operational reliability, because After installing all the necessary service packs, as well as the correct versions of peripheral device drivers, Microsoft Windows 2000/XP will work very stably.

    In some cases, it is necessary to combine several file systems within one physical disk. For example, if three operating systems are installed on your computer: Microsoft Windows ME, Microsoft Windows XP and Linux, you can create three file systems - FAT, NTFS and Ext2FS. The first of them will be “visible” when working in Microsoft Windows ME and Linux, the second - only in Microsoft Windows XP, and the third - only in Linux (note that in LINUX OS it is also possible to access NTFS partitions).

    But if you are creating a server (file, database or Web) based on Microsoft Window NT/2000/XP, then NTFS is the only reasonable choice. Only in this case will it be possible to achieve the necessary stability, reliability and security of the server.

    There is also a generally accepted (and in our opinion, erroneous) opinion that home computer users do not need either the Microsoft Window NT/2000/XP OS or the NTFS file system.

    Of course, if the computer is used exclusively for gaming, for compatibility reasons it is best to install Microsoft Windows 98/ME and format the drives to FAT. However, if you work not only in the office, but also at home, it is better to use modern, professional and reliable solutions. This will allow, in particular, to organize protection against intrusion on your computer via the Internet, limit access to directories and files with critical data, and also increase the chances of successful recovery of information in the event of various types of failures.

    In FAT, file names are in 8.3 format and consist only of ASCII characters. VFAT has added support for long (up to 255 characters) file names. Long File Name, LFN) in UTF-16LE encoding, with LFNs stored concurrently with 8.3 names, retrospectively called SFNs. Short File Name). LFNs are case-insensitive when searching, however, unlike SFNs, which are stored in uppercase, LFNs preserve the case specified when the file was created.

    FAT system structure

    In the FAT file system, contiguous disk sectors are combined into units called clusters. The number of sectors in a cluster is equal to a power of two (see below). An integer number of clusters (at least one) are allocated to store file data, so, for example, if the file size is 40 bytes and the cluster size is 4 KB, only 1% of the space allocated for it will actually be occupied by file information. To avoid such situations, it is advisable to reduce the size of clusters, and to reduce the amount of address information and increase the speed of file operations, vice versa. In practice, some compromise is chosen. Since the disk capacity may not be expressed in an entire number of clusters, usually at the end of the volume there are so-called. surplus sectors - a “remainder” of less than a cluster size that cannot be allocated by the OS for storing information.

    The FAT32 volume space is logically divided into three contiguous areas:

    • Reserved area. Contains service structures that belong to the partition boot record (Partition Boot Record - PBR, to distinguish it from the Master Boot Record - the main boot record of the disk; PBR is also often incorrectly called the boot sector) and are used when initializing a volume;
    • An area of ​​a FAT table containing an array of index pointers ("cells") corresponding to the clusters of the data area. Typically there are two copies of the FAT table on the disk for reliability purposes;
    • The data area where the actual contents of the files are recorded - that is, the text of text files, the encoded image for picture files, the digitized sound for audio files, etc. - as well as the so-called. metadata - information regarding the names of files and folders, their attributes, creation and modification times, sizes and placement on disk.

    FAT12 and FAT16 also specifically allocate the root directory area. It has a fixed position (immediately after the last element of the FAT table) and a fixed size in sectors.

    If a cluster belongs to a file, then the corresponding cell contains the number of the next cluster of the same file. If the cell corresponds to the last cluster of the file, then it contains a special value (FFFF 16 for FAT16). In this way, a chain of file clusters is built. Unused clusters in the table correspond to zeros. “Bad” clusters (which are excluded from processing, for example, due to the unreadability of the corresponding area of ​​the device) also correspond to a special code.

    When a file is deleted, the first character of the name is replaced with a special code E5 16 and the chain of file clusters in the allocation table is reset to zero. Since information about the file size (which is located in the directory next to the file name) remains intact, if the file clusters were located sequentially on the disk and they were not overwritten by new information, it is possible to restore the deleted file.

    Boot entry

    The first FAT volume structure is called BPB. BIOS parameter block ) and is located in a reserved area, in sector zero. This structure contains information identifying the type of file system and the physical characteristics of the storage medium (floppy disk or hard disk partition).

    BIOS Parameter Block

    BPB was essentially absent from the FAT that served MS-DOS 1.x, since at that time there were only two different types of volumes - single-sided and double-sided five-inch 360 KB floppy disks, with the volume format determined by the first byte of the FAT area. BPB was introduced in MS-DOS 2.x in early 1983 as a mandatory boot sector structure that would henceforth determine the volume format; The old scheme of determining by the first byte of FAT has lost support. Also in MS-DOS 2.0, a hierarchy of files and folders was introduced (before this, all files were stored in the root directory).

    The BPB structure in MS-DOS 2.x contained a 16-bit “total number of sectors” field, which meant that this version of FAT was fundamentally inapplicable for volumes larger than 2 16 = 65,536 sectors, that is, more than 32 MB with a standard sector size of 512 bytes. In MS-DOS 4.0 (1988), the above BPB field was expanded to 32 bits, which meant the theoretical volume size increased to 232 = 4,294,967,296 sectors, or 2 TB with a 512-byte sector.

    The next modification of BPB appeared with Windows 95 OSR2, which introduced FAT32 (in August 1996). The two-gigabyte limit on volume size has been removed; a FAT32 volume can theoretically be up to 8 TB in size. However, the size of each individual file cannot exceed 4 GB. BIOS Parameter Block FAT32, for compatibility with earlier versions of FAT, repeats the BPB FAT16 up to and including the BPB_TotSec32 field, followed by differences.

    The FAT32 "boot sector" is actually three 512-byte sectors - sectors 0, 1 and 2. Each of them contains the 0xAA55 signature at address 0x1FE, that is, in the last two bytes if the sector size is 512 bytes. If the sector size is more than 512 bytes, then the signature is contained both at address 0x1FE and in the last two bytes of the zero sector, that is, it is duplicated.

    FSInfo

    The boot record of a FAT32 partition contains a structure called FSInfo, used to store the number of free clusters on the volume. FSInfo, as a rule, occupies sector 1 (see the BPB_FSInfo field) and has the following structure (addresses relative to the beginning of the sector):

    • FSI_LeadSig. The 4-byte signature 0x41615252 indicates that the sector is used for the FSInfo structure.
    • FSI_Reserved1. The interval from the 4th to the 483rd byte of the sector, inclusive, is reset to zero.
    • FSI_StrucSig. Another signature is located at address 0x1E4 and contains the value 0x61417272.
    • FSI_Free_Count. The four-byte field at address 0x1E8 contains the last value of the number of free clusters on the volume known to the system. A value of 0xFFFFFFFF means that the number of free clusters is unknown and must be calculated.
    • FSI_Nxt_Free. The four-byte field at address 0x1EC contains the cluster number from which the search for free clusters should begin in the table of index pointers. Typically this field contains the number of the last FAT cluster allocated to store the file. The value 0xFFFFFFFF means that the search for a free cluster should be carried out from the very beginning of the FAT table, that is, from the second cluster.
    • FSI_Reserved2. Reserved 12-byte field at address 0x1F0.
    • FSI_TrailSig. Signature 0xAA550000 - last 4 bytes of the FSInfo sector.

    The point of introducing FSInfo is to optimize system operation, since in FAT32 the table of index pointers can be significant and scanning it byte-by-byte can take considerable time. However, the values ​​of the FSI_Free_Count and FSI_Nxt_Free fields may not be correct and should be checked for adequacy. In addition, they are not even updated in the FSInfo backup, which is usually located in sector 7.

    Determining the FAT volume type

    The determination of the FAT type of a volume (that is, the choice between FAT12, FAT16 and FAT32) is made by the OS based on the number of clusters in the volume, which in turn is determined from the BPB fields. First of all, the number of sectors of the root directory is calculated:

    RootDirSectors = (BPB_RootEntCnt * 32) / BPB_BytsPerSec

    DataSec = TotSec - (BPB_ResvdSecCnt + (BPB_NumFATs * FATSz) + RootDirSectors)

    Finally, the number of data area clusters is determined:

    CountofClusters = DataSec / BPB_SecPerClus

    Based on the number of clusters, there is a clear correspondence with the file system:

    • CountofClusters< 4085 - FAT12
    • CountofClusters = 4085 ÷ 65524 - FAT16
    • CountofClusters > 65524 - FAT32

    According to the official specification, this is the only valid way to determine the FAT type. Artificially creating a volume that violates the specified compliance rules will result in Windows processing it incorrectly. However, it is recommended to avoid CountofClusters values ​​close to critical (4085 and 65525) in order to correctly determine the file system type by any, often incorrectly written, drivers.

    Over time, FAT began to be widely used in various devices for compatibility between DOS, Windows, OS/2, Linux. Microsoft has shown no intention of forcing them to license [ specify] .

    In February 2009, Microsoft sued TomTom, a manufacturer of Linux-based car navigation systems, accusing it of patent infringement.

    Notes

    1. http://cd.textfiles.com/megademo2/INFO/OS2_HPFS.TXT
    2. www.microsoft.com/mscorp/ip/tech/fathist.asp at archive.org
    3. Microsoft Extensible Firmware Initiative FAT32 File System Specification 1.03. Microsoft (December 6, 2000). - Document in Microsoft Word format, 268 Kb. Archived
    4. What About VFAT? . TechNet Archive. Microsoft (October 15, 1999). Archived from the original on August 22, 2011. Retrieved April 5, 2010.
    5. The VFAT file system extension should not be confused with the file system driver of the same name, which appeared in Windows for Workgroups 3.11 and is designed to handle MS-DOS (INT 21h) function calls in protected mode (see: KB126746: Windows for Workgroups Version History. VERSION 3.11 → Non-Network Features. Microsoft (November 14, 2003). Archived from the original on August 22, 2011. Retrieved April 5, 2010.)
    6. Federal Patent Court declares FAT patent of Microsoft null and void (English). heise online. Heise Zeitschriften Verlag (2 March 2007). Archived
    7. Brian Kahin. Microsoft Roils the World with FAT Patents. The Huffington Post (March 10, 2009). Archived from the original on August 22, 2011. Retrieved March 10, 2009.
    8. Ryan Paul. Microsoft suit over FAT patents could open OSS Pandora's Box (English). Ars Technica. Condé Nast Publications (February 25, 2009). Archived
    9. Glyn Moody.(English) . ComputerworldUK. IDG (5 March 2009). Archived from the original on August 22, 2011. Retrieved March 9, 2009.
    10. Steven J. Vaughan-Nichols. Linux companies sign Microsoft patent protection pacts (English). Computerworld Blogs. IDG (5 March 2009). Archived from the original on August 22, 2011. Retrieved March 9, 2009.
    11. Erica Ogg. TomTom countersues Microsoft in patent dispute. CNet (March 19, 2009). Archived from the original on August 22, 2011. Retrieved March 20, 2009.

    Links

    • ECMA-107 (English) FAT standard