ReFS file system. Comparison of ReFS (Resilient file system) and NTFS file systems

Windows 10 supports multiple file systems out of the box. Some of them are heritage and exist mainly for backward compatibility, others are modern and have wide application. This article describes various ways, which you can use to see what file system your drives are formatted with.

File system is a special way of storing and organizing your information on different media, including hard disks, solid state drives, USB drives and other devices. It allows you to store, modify, read files and folders for applications and the operating system installed on your computer.

When you format an internal drive or flash drive, you are preparing it for use as storage media in your operating system. During this process, a file system is created. During formatting, all information stored on the disk or partition will be deleted.

Windows 10 supports file systems FAT, FAT32, exFAT, NTFS And ReFS without using additional software.

They have different functions and properties. For example, FAT and FAT32 are legacy file systems. FAT supports a maximum capacity of 4GB, FAT32 supports 32GB. FAT file systems also have limitations on maximum size file. NTFS is the only file system that supports file compression and encryption and has advanced features.

There are several methods you can use to find the file system used on your drives.

To find out the file system on drives in Windows 10, follow these steps.

  1. Open "Conductor" and go to the folder "This computer".
  1. Right-click the drive and select from the context menu "Properties".
  1. In the Properties window, on the General tab, you will see the file system of your disk.

This method is the simplest and fastest.

Also, you can use Diskpart tool, Disk Management or PowerShell.

View disk file system using Diskpart

  1. Press the key combination Win + R.
  1. In the Run field, enter " diskpart" and press Enter.

  1. In Diskpart, enter the command list volume.

After running the command, you will see the file system for each drive connected to your computer.

Show the disk file system using Disk Management.

  1. Press Win + X or right-click on the button "Start".
  1. From the WinX menu, select
  1. See Values ​​in the File System column.

Finally, there is another way to determine the file system for each drive connected to your computer using the PowerShell scripting language.

  1. Open PowerShell on behalf of the administrator.
  1. Enter: get-volume and press the Enter key.
  1. For output see values ​​in column FileSystemType.

Now you know that it is very easy to determine the file system for your disks. You can use any method you like best.

In 1991, SanDisk sold a 20MB SSD for $1,000, but the technology has gotten a bit cheaper since then. At the same time, the SSD is much faster and quieter. Today SSD setup drives for Windows 10 are not of interest only to those who are scared by their relatively short service life. To compensate for this disadvantage, the device controller can store information about the number of rewrite cycles in order to use less loaded memory cells. To do this, the SSD is optimized for Windows 10.

You see that everything is not so bad, because the HDD often erases system sectors to holes and can no longer do anything about it. Windows 10 does not load and is very slow. And it is useless to use a tweaker; the system intelligence is not enough to cope with poor sector reading. Meanwhile, if ten could be installed in a suitable area of ​​the hard drive, it would not have a price. Optimization hard drive is impossible in this regard, but setting up an SSD is within the capabilities of the average user. Don't expect much from this review because the system did a lot for us. Ten are already maximally configured for SSD.

How to setup

Many people have already wondered whether it is cost-effective to leave the Windows page file on an SSD. The speed of memory is such that it is unclear whether this old trick with pagination and loading of previously used information is needed at all. We are sure that there is some common sense and a spoonful of nonsense in this:

  1. If there is no information in RAM, the processor cannot take it out of nowhere. Will still be involved HDD. The service life cannot be extended using this method. Another thing is that you can free up some space.
  2. The idea of ​​extending the resource is very relevant. How about we bet more? random access memory, and then there will be no need to swap pages at all? This is a more sensible approach, because the RAM will work anyway. But the more cells it has, the less wear on each one individually.

Disabling unnecessary processes

Well, and, of course, Windows optimization can reduce the number of storage accesses. This is disabling unnecessary services, processes, minimizing any activity, limiting activity through the firewall.

TRIM

However, there is also specific disk optimization. We are primarily talking about the DisableDeleteNotify parameter. Let's query its value and set it to zero if necessary.

The fsutil behavior set DisableDeleteNotify 0 operation is also applicable for systems with HDD, but the hardware does not support this. In particular, the line ReFS... not installed means that the option will be available immediately after the SSD is attached (this system unit does not have this). The command is called TRIM, it is introduced into the ATA interface, but magnetic drives do not support it at the controller level. Although we do not exclude that there may be some exceptions in nature.

From the above piece of code we can conclude that optimization of SSD drives under 10 is not required, because the option for careful handling of media is already enabled. Although you still need to check this position with the command (see above). It is impossible to optimize a magnetic HDD because there is no hardware support.

Indexing

Some experts also suggest disabling file indexing, but the essence of this measure is not entirely clear. The operating system will simply rub the table of contents instead of using the options and ready-made answers it has stored. As for hibernation, so many users like it that not everyone will decide to exclude it from the system. At the same time, the option is already disabled by system settings by default. Let us explain: in the top ten, hibernation is disabled by default, and if someone wanted to use it, they are unlikely to agree to remove it. Because it is very convenient to continue work from where it was interrupted.

Defragmentation

The only thing you can turn off is automatic defragmentation:

Why TRIM doesn't work

TRIM requires an AHCI driver. The OS must be installed on system unit where this option is supported. On new ones motherboards the way it is.

However, in some places they write that you must first install the option through the BIOS, as in this photo.

We report to our readers the following:

  1. To test the Victoria application, the setting was set to the IDE.
  2. The test passed, the computer was not used, and then suddenly it turned out that they were writing on the network about the need to set this parameter in AHCI...

In IDE mode, ten did not install on the specified PC at all. We checked it twice, in both cases an error is thrown at some stage of the wizard. Linux Ubuntu came up only with default settings; when I tried to partition the HDD manually, I got errors. Checked at least three times. The BIOS setting was adjusted to AHCI, and immediately the operating systems stopped acting up. Here is a screenshot of the activation window performed after a clean installation of ten on this very disk.

The company carried out the activation in a matter of seconds. Once upon a time, a dozen were already installed on this equipment. Please note that all events take place after July 29, 2016. So, if someone was lucky enough to put a ten on top of the IDE driver, then this is a unique person. And he really should put in BIOS settings AHCI option for TRIM to work on SSD. New motherboards do not have an IDE line at all; in old ones, with this change, the system stops loading. However, in the seven this could be recorded through the registry.

How to fix AHCI through the registry

Little is written about this, but after changing the driver type from the BIOS, the operating system stops loading. Here's what it looks like (tomshardware.co.uk).

Some things are clear from the screenshot, but we’ll explain:

  1. Someone installed seven on an SSD and suddenly noticed that TRIM was not working.
  2. I started looking into it and realized that I needed an AHCI driver.
  3. I went into the BIOS, changed it, and it stopped loading.

Here's an example blue screen after performing such actions (tnxs to askvg.com/).

The guy who posted this review (see screenshot) found a solution to the problem by fixing the registry. Here are his recommendations. We didn’t rewrite them because there are no such keys in the top ten. She (with us, according to at least) is not installed on the IDE, but produces an error over and over again.

If you do not fix the registry, you will need to completely reinstall the system. We emphasize once again: ten in our case does not work in parallel with the IDE. Most likely, this is her innovation. That's why no one writes that TRIM is disabled. We said above that this useful option already works by default. Therefore, you don't need to configure anything. But if you want to check for health, the above information is exactly what you need for this.

SSD on the market

Price analysis shows that today you need to pay 10,000 rubles for 500 GB of space. This is still expensive, but if you take a more modestly sized device for the operating system, and store the data on a regular HDD, then the situation looks much happier. It is known that Windows 10 x64 requires a minimum of 20 GB of hard drive space. Therefore, the volume SSD drive 64 GB is enough for everything about everything. There are also weaknesses here:

  1. Exactly system disk is subject to the greatest wear and tear, while valuable data is accessed much less frequently. The answer suggests itself: you should install Windows 10 on a magnetic drive, and solid-state electronics will store user data.
  2. The high price has already been announced, but today is the day when you can buy 128 GB for 3000 and try what an SSD is. Finally, remember that just 25 years ago the amount asked for such memory was astronomical.

Technology

The name itself suggests that the SSD is based on advances in solid-state electronics. These are the same flash drives that we are used to plugging into USB port, but only slightly cheaper. Think about it, a 16 GB flash drive costs about 800 rubles. It is clearly seen that this is a much more expensive type of memory than SSD drives. That's when everything falls into place. A regular flash drive with a specialized interface.

Yes, there are several SSD technologies, but the difference between them is not as striking as between HDD and SD. The first CompactFlash was released by SanDisk in 1994. Don't find any connection here with the information above? That's right - the dependence is obvious! Linux can already run from a flash drive. This is the same case of using an SSD. Of course, the Windows 10 installation media is not yet a system disk, but Billy Gates is confidently moving in this direction.

The need for the development of SSD technologies was caused by increased performance central processor, which magnetic tape could not keep up with. The disk also lagged behind. Everyone knows that the game had to be loaded into the ZX-Spectrum first, and then start hitting enemies. Despite the fact that the processor frequency there was ridiculous, more than one geek trained his reaction on old machines. Even today you can play around with special emulators.

It's no secret that programmers are producing increasingly mediocre code. They are lazy to correctly define variables and free up memory space after completing a function or procedure call. Therefore, the amount of RAM consumed is constantly growing. Not by days, but by hours. But the system still continues to freeze. This is a consequence of poor thought. There are many millions of lines of code in Windows, and, of course, there are bugs that Billy Gates has been working on with varying degrees of success.

Why is there not enough RAM?

The first computer ran with 48 KB, and this was quite enough; today the amount of RAM of 16 GB still seems too small. Even at rest, one fifth of this amount is occupied. Although formally the system is “resting”.

This is, to put it mildly, alarming. In fact, 3 GB is required only for “idle”. What will happen when a gigantic amount of information begins to be loaded by some computer game? Chasing the ghost virtual reality In accordance with reality, we have forgotten about the usefulness of applications, their moral meaning. Many ZX-Spectrum fans raved about the Elite. Who has heard about this game today? Meanwhile, a huge number of sequels to this exciting quest have been released.

One of the creators described it as “the path of the warrior of light,” although no one forbade becoming a pirate. But just like in real life, you couldn’t get many credits for civilian ships, and the police were nipping at their heels. They refused to dock planetary stations. So a person gradually got used to the fact that the path of an honest hard worker is much more fruitful than that of a bandit. Result? Thousands (if not millions) of fans around the world, despite the fact that the graphics are, to put it mildly, poor. Add to this the fact that progress could only be saved to the carrier upon landing. This meant that it took many years for many to reach the Elite class of fighters. Moreover, the criminal (if we are not mistaken) was not assigned this qualification at all.

Many were attracted by the idea itself. Although it must be admitted that with a large number of attacking spaceships, the graphics froze a little. Almost the only game where this happened. Today's gameplay bears little resemblance to fighting evil. More attention is paid to graphics, leaving enough room for meanness, where an organized flock can poison one. Of course, we can argue that this is more like real life, but we would argue that society is the way it is raised to be. Including through games.

So, there is not enough RAM for the reason that manufacturers focus on special effects. Tinsel that has nothing to do with the semantic part. They do a lot for the sake of donation:

  1. The king went hunting.
  2. Beaters - scare the bots.

The difficulty with new ideas is that it is difficult to break through. Sophisticated graphics are often beyond the capabilities of a lone developer. So, the size of the RAM increased, and it was soon noticed that the operating system was being slowed down by the hard drive. During the period of accessing the drive and reading new modules. This also applies to Linux, but to a lesser extent. Therefore, two options are possible:

  • SSD drives are promoted by Microsoft to mask minor performance defects.
  • Billy Gates foresaw this development of events n number of years ago. Actually, back in 1991 it was possible to predict something.

Memory and nanotechnology

It is unlikely that the system existing on the market today is an accident. In addition, it is suspicious that rumors about nanotechnology have been frozen. Around 2002, the industry promised to give us a new generation computer technology, and... most likely she settled in the military bins. The technological process that exists today cannot decrease because heat losses on semiconductors are increasing, which is what nanotechnology promised to give us. What? That's right - an ideal element base, where the crystal lattice is so precise that the current does not cause a large voltage drop across it. This makes it possible to increase integration, further reduce the supply voltage and, as a result, amazing performance gains. Literally thousands of times.

Look: everything is heading towards the fact that HDDs will disappear in the same way that today magnetic tape is considered archaic. Although some 15 years ago it was recommended to dump archives on it digital information. The only reliable keeper today is paper. What is written with a pen still cannot be cut out with an axe. Everything else becomes obsolete and turns into dust and decay. The most reliable devices are network devices. Like, for example, Google repositories. The HDD will soon disappear, and this has already happened in smartphones and some laptops. Today's technological process has reached a dead end, this can be seen from the fact that the characteristics of processors and HDDs have remained almost unchanged for several years.

Look at the screenshot, it’s a prototype of the mechanical transmission of the future. Rotating gears transmit momentum by interlocking individual molecules. This is just one example of nanotechnology. If we take the field of semiconductors, which includes solid state drives, then the accumulation of information occurs due to charge retention. The shelf life is long, but it is clearly not forever. Experts give approximately 10 years. Paper can carry information for thousands of years, and a nano-latch can carry information as long as the world exists!

By-effect

We saw that the required option for the HDD is not installed, but this has one advantage. Information of value may be erased by a shredder. It's not the same on SSDs. The block will be written to cells with the maximum resource, so it will be easier to find information that the user intended should be deleted. A configured hard drive will become a real treasure trove of ghost files. And not a single tweaker that exists today will help correct this situation.

3 ratings, average: 5,00 out of 5)

A public beta version was released not long ago Microsoft Windows 8 Server with support for the announced ReFS (Resilient File System) file system, previously known as “Protogon”. This file system is offered as an alternative to the NTFS file system, which has proven itself over the years, in the segment of data storage systems based on Microsoft products, with its further migration to the area of ​​client systems.

The purpose of this article is a superficial description of the structure of the file system, its advantages and disadvantages, as well as an analysis of its architecture from the point of view of maintaining data integrity and the prospects for data recovery in case of damage or deletion by the user. The article also reveals a study of the architectural features of the file system and its potential performance.

Windows Server 8 Beta

The file system option available in this version of the operating system only supports 64KB data clusters and 16KB metadata clusters. It is not yet clear whether there will be support for ReFS file systems with other cluster sizes: currently the Cluster Size parameter when creating a ReFS volume is ignored and is always set to default. When formatting the FS, the only available option to select the cluster size is 64KB. He is also the only one mentioned in the developer blogs.

This cluster size is more than sufficient to organize file systems of any practical size, but at the same time it leads to significant redundancy in data storage.

File system architecture

Despite frequent mentions of the similarities between ReFS and NTFS at a high level, we are only talking about the compatibility of some metadata structures, such as “standard information”, “file name”, compatibility in the values ​​of some attribute flags, etc. The disk implementation of ReFS structures is fundamentally different from other Microsoft file systems.

The main structural elements of the new file system are B+ trees. All elements of the file system structure are represented by single-level (lists) or multi-level B+ trees, which allows you to significantly scale almost any of the file system elements. Along with real 64-bit numbering of all system elements, this eliminates the appearance of bottlenecks during further scaling.

Apart from the root record of the B+ tree, all other records have the size of an entire metadata block (in this case, 16KB); intermediate (address) nodes have a small full size(about 60 bytes). Therefore, usually a small number of tree levels are required to describe even very large structures, which has a rather favorable effect on the overall performance of the system.

The main structural element of the file system is the “Directory”, presented in the form of a B+-tree, the key of which is the number of the folder object. Unlike other similar file systems, a file in ReFS is not a separate key element of the “Directory”, but only exists as an entry in the folder containing it. Perhaps precisely because of this architectural feature hard links to ReFS are not supported.

“Leaves of the Directory” are typed records. There are three main types of entries for a folder object: the directory handle, the index entry, and the nested object handle. All such records are packaged as a separate B+ tree with a folder ID; the root of this tree is a leaf of the B+-tree of the “Directory”, which allows you to pack almost any number of records into a folder. At the bottom level in the leaves of a folder's B+ tree is primarily a directory descriptor entry containing basic information about the folder (such as name, "standard information", file name attribute, etc.). The data structures have much in common with those adopted in NTFS, although they have a number of differences, the main one of which is the absence of a typed list of named attributes.

Next in the directory are the so-called index entries: short structures containing data about the elements contained in the folder. Compared to NTFS, these records are much shorter, which reduces the volume's burden with metadata. Last are the directory item entries. For folders, these elements contain the name of the pack, the folder identifier in the “Directory” and the structure of the “standard information”. For files there is no identifier, but instead the structure contains all the basic data about the file, including the root of the B+ tree of file fragments. Accordingly, the file can consist of almost any number of fragments.

On disk, files are located in 64KB blocks, although they are addressed in the same way as metadata blocks (in 16KB clusters). File data “residency” is not supported on ReFS, so a 1-byte file on disk will occupy an entire 64KB block, which leads to significant storage redundancy on small files; on the other hand, it simplifies the management of free space and allocating free space for a new file is much faster.

The size of an empty filesystem's metadata is about 0.1% of the size of the filesystem itself (i.e., about 2GB on a 2TB volume). Some core metadata is duplicated for better fault tolerance.

Failure proof

There was no goal to test the stability of the existing ReFS implementation. From the point of view of file system architecture, it has all the necessary tools for secure file recovery even after a serious hardware failure. Parts of metadata structures contain their own identifiers, which allows you to check the ownership of the structures; metadata links contain 64-bit checksums of the blocks being referenced, which makes it possible to evaluate the integrity of the block read from the link.

It is worth noting that checksums of user data (file contents) are not calculated. On the one hand, this disables the integrity check mechanism in the data area, on the other hand, it speeds up the system operation due to the minimum number of changes in the metadata area.

Any change in the metadata structure is carried out in two stages: first, a new (changed) copy of the metadata is created in free disk space, then, if successful, an atomic update operation transfers the link from the old (unchanged) to the new (changed) metadata area. This strategy (Copy-on-Write (CoW)) allows you to do without logging, automatically maintaining data integrity.

Confirmation of such changes on the disk may not take long enough, allowing several file system state changes to be combined into one.

This scheme does not apply to user data, so any changes to the file's contents are written directly to the file. Deleting a file is done by rebuilding the metadata structure (using CoW), which saves previous version metadata block on disk. This makes recovery of deleted files possible before they are overwritten by new user data.

Data storage redundancy

In this case, we are talking about the consumption of disk space due to the data storage scheme. For testing purposes, installed Windows Server was copied to a 580GB ReFS partition. The size of metadata on an empty file system was about 0.73GB.

When copying installed Windows Server per partition with ReFS, file data storage redundancy increased from 0.1% on NTFS to almost 30% on ReFS. At the same time, about 10% of redundancy was added due to metadata. As a result, “user data” of 11GB in size (more than 70 thousand files) on NTFS, taking into account metadata, took 11.3GB, while on ReFS the same data took 16.2GB; this means that data storage redundancy on ReFS is almost 50% for this type of data. With a small number of large files, this effect is naturally not observed.

Operation speed

Due to the fact that we are talking about Beta, no measurements of FS performance were carried out. From the point of view of the FS architecture, some conclusions can be drawn. When copying more than 70 thousand files to ReFS, this created a B+ tree of the “Directory” of 4 levels in size: “root”, intermediate level 1, intermediate level 2, “leaves”.

Thus, searching for folder attributes (assuming the tree root is cached) requires 3 reads of 16KB blocks. For comparison, on NTFS this operation will take one read of 1-4KB in size (assuming the $MFT location map is cached).

Finding file attributes by folder and file name in a folder (a small folder with several entries) on ReFS will require the same 3 reads. On NTFS, 2 reads of 1 KB each will be required, or 3-4 reads (if the file entry is in the non-resident “index” attribute). In larger packs, the number of NTFS reads grows much faster than the number of reads required by ReFS.

The situation is exactly the same for the contents of files: where an increase in the number of file fragments on NTFS leads to an enumeration of long lists spread across different $MFT fragments, on ReFS this is carried out by an effective search through the B+-tree.

conclusions

It is too early to draw final conclusions, but from the current implementation of the file system one can see confirmation of the initial focus of the file system on the server segment, and, above all, on virtualization systems, DBMS and archival data storage servers, where speed and reliability of operation are of paramount importance. The main disadvantage of the file system, such as inefficient packaging of data on disk, is negated on systems that operate with large files.

SysDev Laboratories will monitor the development of this file system and plans to include support for data recovery from this file system. Experimental ReFS support for the beta version of Microsoft Windows 8 Server has already been successfully implemented in UFS Explorer products and is available for closed beta testing among partners. The official release of tools for recovering deleted files from ReFS, as well as data recovery after file system damage as a result of hardware failures, is planned a little earlier or simultaneously with the release of Microsoft Windows 8 Server with ReFS support.

Version dated 03/16/2012.
Based on materials from SisDev Laboratories

Reprinting or quoting is permitted provided that reference to the original is maintained.

Not long ago, a new version of Windows was released, namely Windows 8. As you know, in new version Windows 8, there is support for a new file system, namely ReFS. In this article we will talk about what advantages this file system has over the same NTFS file system. Well, shall we get started?

To be honest, the NTFS file system has already outlived its usefulness (this is almost the same as comparing FAT32 with NTFS 10 years ago), from a technical point of view. File ReFS system can provide the most better protection data on high-capacity and fast hard drives.

A little about the NTFS file system

The NTFS (New Technology File System) file system appeared precisely when Microsoft presented to the public its new operating system - Windows 3.1. To this day, we mainly use only this file system to work on the computer. Over time, the basic capabilities of the NTFS file system have reached their limits: scanning storage media with a very large volume takes a sufficient amount of time, and the maximum file size has almost also been reached.

Successor to the NTFS file system

It was to eliminate the shortcomings of the NTFS file system that Microsoft introduced into the operating system Windows system 8, a completely new file system ReFS (Resilient File System), which is a fault-tolerant file system. And it demonstrates very high reliability in its work.

For the first time, this file system was used in the server operating system Windows Server 8. I would like to note that Microsoft did not develop the ReFS file system from scratch. For example, to open, close, and read files, the ReFS file system uses the same access interfaces API data, the same as the NTFS file system. The file system features that remained unchanged were Bitlocker disk encryption, as well as symbolic links for libraries. And functions such as data compression have completely disappeared.

Quite a large number of innovations in the ReFS file system lie precisely in the area of ​​creating folder and file structures, and most importantly, managing them. These changes are designed to automatically change, correct errors in file system objects and the system itself, maximize scaling, and most importantly, work in Always Online mode.

For all these innovations, Microsoft uses the concept of B+ trees, which you may be familiar with from the Database course. This concept is that folders in a given file system are structured in the form of regular tables, and files act as records in this table. Even the free space on the hard drive is organized in the form of tables in this file system.

The core of the ReFS file system is an object table called the central directory, which lists all the tables in the system.

Comparison of NTFS and ReFS file systems
From this table, you can draw conclusions about the advantages or disadvantages of a particular file system.

Built-in protection against failures in the ReFS file system

The ReFS file system gets rid of the complex journal management that is present in the NTFS file system and can now commit new file information to free space, and this is already preventing its overwriting. But, if suddenly overwriting occurs, which in principle cannot happen, then the system will be able to re-register links to records in the B+-tree structure.

Like the NTFS file system, the ReFS system, by its own principle, distinguishes between information about the file (this is metadata), as well as the contents of the file (this is user data), but ReFS provides data protection for both. For example, metadata uses checksum protection. This protection can also be provided to user data. These protected data, that is, checksums, are placed on the hard drive, which are securely accessible from each other, this is done so that if any error occurs, the data can be recovered.

Transferring data from the NTFS file system to ReFS

Surely, you have asked yourself this question: will it be possible to transfer data from a file system, for example Windows XP, to the Windows 8 file system (that is, from NTFS to ReFS) and vice versa without any problems. Microsoft itself answers this question as follows: that there will be no built-in format conversion function, but simple copying will be possible.

Today, the ReFS file system can be used as a large data manager for the server. Based on this, it will be impossible for now to run Windows 8 from a disk running the new ReFS file system.

External drives with the ReFS file system is not yet expected, there will only be internal drives. And we can look into the future that over time the ReFS file system will be supplemented with a huge number of different functions and will be able to replace the old file system. This may already be done with the release of the first large package Windows updates 8.

Comparison of NTFS and ReFS file systems using the example of file renaming

Let's see how this happens (renaming files in an operating system that has the NTFS file system).

The first point is that the NTFS file system writes to the log that the file should be renamed, and it also logs all other actions there.

Only after she writes down in the journal what needs to be renamed does she rename it.

At the end of the operation, a message appears in the log indicating that the files were renamed successfully or unsuccessfully.

Now let's see how file renaming works in the ReFS file system.

As you can see, there is a lot less action here.

Firstly, in the ReFS file system, a new name for a file or folder is written to free space, and, most importantly, the old name is not immediately erased (deleted).

As soon as the new name is written, the ReFS file system creates a link to the new name and will enter exactly the new name.

How is a file or folder renamed in NTFS and ReFS file systems when the system fails?

On the NTFS file system

Here, as standard, the system first writes its change request to the log.

After this, for example, if there is a power failure, the renaming process itself stops and note that there is no record of either the new name or the old one.

Then the system reboots and the program for fixing and finding errors - chkdisk - is launched.

And after this, with the help of the journal itself, when a rollback is applied, only the original name is restored.

Now let's see how this happens in the ReFS file system

I already announced it once on my blog, then nothing was really known about it, and now the time has come for a brief but more consistent acquaintance with the newly-made ReFS.

20 years later

However, everything has a limit, and so does the capabilities of file systems. Today, the capabilities of NTFS have reached their limits: scanning large storage media takes too much time, “Journal” slows down access, and the maximum file size has almost been reached. Realizing this, Microsoft implemented a new file system in Windows 8 - ReFS (Resilient File System - fault-tolerant file system). ReFS is said to provide better data protection on large, fast hard drives. Surely it has its drawbacks, but it’s difficult to talk about them until truly widespread use in Windows 8 begins.

So for now, let’s try to understand the internal structure and advantages of ReFS.

ReFS was originally known under the code name "Protogon". For the first time I told about it to the general public about a year ago Stephen Sinofsky- President of the Windows division at Microsoft, responsible for the development and marketing of Windows and Internet Explorer.

He told it in these words:

“NTFS is the most widely used, advanced, and feature-rich file system today. But rethinking Windows, and we're in this moment We are developing Windows 8 - we do not stop there. That's why with Windows 8 we're also introducing a completely new file system. ReFS is built on top of NTFS, so it retains critical compatibility capabilities while being designed and engineered to meet the needs of the next generation of storage technologies and scenarios.

In Windows 8, ReFS will only be introduced as part of Windows Server 8, the same approach we took to introduce all previous file systems. Of course, at the application level, clients will be given access to ReFS data in the same way as NTFS data. "We must not forget that NTFS is still the industry's leading file system technology for PCs."

Indeed, we first saw ReFS in the server OS Windows Server 8. The new file system was not developed from scratch. For example, ReFS uses the same API access interfaces as NTFS to open, close, read and write files. Also, many well-known features have migrated from NTFS - for example, disk encryption Bitlocker And symbolic links for libraries. But it disappeared, for example, data compression and a number of other functions.

ReFS's main innovations focus on creating and managing file and folder structures. Their task is to ensure automatic error correction, maximum scaling and operation in Always Online mode.

ReFS architecture

The disk implementation of ReFS structures is fundamentally different from other Microsoft file systems. Microsoft developers were able to implement their ideas by using the concept of B±trees in ReFS, which is well known from databases. Folders in a file system are structured as tables with files as records. These in turn receive specific attributes that are added as subtables, creating a hierarchical tree structure. Even free disk space is organized in the form of tables.

Along with real 64-bit numbering of all system elements, this eliminates the appearance of bottlenecks during further scaling

As a result, the core of the system in ReFS became the object table - a central directory that lists all the tables in the system. This approach has an important advantage: ReFS has abandoned complex log management and records new information about the file in free space - this prevents it from being overwritten.

« Leaves of the Catalog" are typed records. There are three main types of entries for a folder object: the directory handle, the index entry, and the nested object handle. All such records are packaged in the form of a separate B±tree, which has a folder identifier; the root of this tree is a leaf of the B±tree of the “Directory”, which allows you to pack almost any number of records into a folder. At the bottom level in the leaves of the B±tree of a folder there is, first of all, a directory descriptor record containing basic data about the folder (name, “standard information”, file name attribute, etc.).

Further in the catalog are placed index entries: short structures containing data about the items contained in the folder. These records are much shorter than in NTFS, which means they are less likely to overload the volume with metadata.

At the end are the catalog entries. For folders, these elements contain the name of the pack, the folder identifier in the “Directory” and the structure of the “standard information”. There is no identifier for files - instead, the structure contains all the basic data about the file, including the root of the B±tree of file fragments. Accordingly, the file can consist of almost any number of fragments.

Like NTFS, ReFS makes a fundamental difference between file information (metadata) and file content (user data). However, protective functions are provided to both equally. Metadata is protected by default using checksums - the same protection (optional) can be given to user data. These checksums are located on the disk at a safe distance from each other - this will make it easier to recover data in the event of an error.

The size of an empty filesystem's metadata is about 0.1% of the size of the filesystem itself (i.e., about 2 GB on a 2 TB volume). Some core metadata is duplicated for greater robustness against failures

The ReFS option we saw in Windows Server 8 Beta, has support for only 64 KB data clusters and 16 KB metadata clusters. For now, the “Cluster Size” parameter is ignored when creating a ReFS volume and is always set to default. When formatting the file system, the only available option for selecting the cluster size is also 64 KB.

Let's face it: this cluster size is more than enough to organize file systems of any size. A side effect, however, is noticeable redundancy in data storage (a 1-byte file on disk will take up a full 64 KB block).

ReFS security

From a file system architecture perspective, ReFS has all the tools you need to safely recover files even after a major hardware failure. The main disadvantage of the journal system in the NTFS file system and similar ones is that updating the disk can damage previously recorded metadata if there is a power failure during recording - this effect has already received a stable name: the so-called. " broken record».

To prevent broken records, developers from Microsoft have chosen a new approach in which parts of metadata structures contain their own identifiers, which makes it possible to verify the ownership of the structures; metadata links contain 64-bit checksums of the blocks being referenced.

Any change in the metadata structure occurs in two stages. First, a new (changed) copy of the metadata is created in free disk space, and only after that, if successful, an atomic update operation moves the link from the old (unchanged) to the new (changed) metadata area. Here it allows you to do without logging, automatically maintaining data integrity.

However, the described scheme does not apply to user data, so any changes to the contents of the file are written directly to the file. Deleting a file is done by rebuilding the metadata structure, which preserves the previous version of the metadata block on disk. This approach allows you to restore deleted files up to their overwriting with new user data.

A separate topic is ReFS fault tolerance in case of disk damage. The system is able to detect all forms of disk damage, including lost or stored in the wrong place records, as well as the so-called. bit decay(deterioration of data on the media)

When the "integer streams" option is enabled, ReFS also checksums the contents of files and always writes file changes to a third-party location. This ensures that pre-existing data will not be lost when overwritten. Checksums are updated automatically when data is written, so if a failure occurs during writing, the user will still have a verifiable version of the file.


Another interesting topic regarding ReFS security is interaction with Storage Spaces. ReFS and Storage Spaces designed to complement each other as two components unified system data storage. In addition to improving performance Storage Spaces protect data from partial and complete disk failures by storing copies on multiple disks. During read failures Storage Spaces can read copies, and in case of write failures (even if the media data is completely lost during reading/writing), it is possible to “transparently” redistribute the data. As practice shows, most often such a failure has nothing to do with the media - it occurs due to data corruption, or due to the loss of data or saving it in the wrong place.

These are exactly the types of failures that ReFS can detect using checksums. Having detected a failure, ReFS contacts Storage Spaces in order to read all possible copies of the data, and selects the desired copy based on checking the checksums. After this the system gives Storage Spaces command to restore damaged copies based on correct copies. All this happens transparently from an application point of view.

As stated on the Microsoft website dedicated to Windows Server 8, checksums are always enabled for ReFS metadata, and provided the volume is hosted on mirrored Storage Spaces, automatic correction is also enabled. All intact streams are protected in the same way. This creates an end-to-end solution with high integrity for the user, whereby relatively unreliable storage can be made highly reliable.

The said integrity streams protect the file contents from all types of data corruption. However, this characteristic is not applicable in some cases.

For example, some applications prefer careful management of file storage with a specific sorting of files on disk. Because integral threads reallocate blocks every time the contents of a file change, file layout is too unpredictable for these applications. Database systems are a prime example of this. As a rule, such applications independently keep track of checksums of file contents and have the ability to check and correct data by directly interacting with API interfaces.


I think it’s clear how ReFS acts in the event of disk damage or storage failure. It can be more difficult to identify and overcome data losses associated with “ bit decay“when undetected damage to rarely readable parts of the disk begins to grow rapidly. By the time such corruption is read and detected, it may have already affected the copies, or the data may have been lost due to other failures.

To overcome the process bit decay, Microsoft has added a background system task that periodically cleans up metadata and integrity stream data on a ReFS volume located on a mirrored storage space. Cleaning occurs by reading all extra copies and checking them for correctness using ReFS checksums. If the checksums do not match, the copies with errors are corrected using good copies.

There remains a threat that can be roughly called “a system administrator’s nightmare.” There are cases, albeit rare, when even a volume on a mirrored space can be damaged. For example, a faulty system's memory can corrupt data, which can then end up on disk and corrupt redundant copies. Additionally, many users may decide not to use mirrored storage spaces under ReFS.

For such cases, when a volume becomes corrupted, ReFS performs a “recovery,” a function that removes data from the namespace on the working volume. Its purpose is to prevent irreparable damage that could affect the availability of correct data. For example, if a single file in a directory becomes corrupted and cannot be automatically recovered, ReFS will remove that file from the file system namespace, recovering the remainder of the volume.

We are used to the fact that the file system cannot open or delete a corrupted file, and the administrator cannot do anything about it.

But since ReFS can recover corrupted data, the administrator will be able to recover this file from backup copy, or use the application to create it again, avoiding the need to turn off the system. This means that the user or administrator will no longer need to perform offline disk verification and repair. For servers, this makes it possible to deploy large volumes of data without the risk of long periods battery life due to damage.


ReFS in practice

Of course, the practicality and convenience (or the opposite qualities) of ReFS can only be judged after computers with Windows 8 become widespread and at least six months of active work with them have passed. In the meantime, potential G8 users have more questions than answers.

For example, this: will it be possible in Windows 8 to easily and simply convert data from the NTFS system to ReFS and vice versa? Microsoft representatives say that there is no built-in function for converting formats, but information can still be copied. The scope of ReFS is obvious: at first it can only be used as a large data manager for the server (in fact, it is already being used). There will be no external drives with ReFS yet - only internal ones. Obviously, over time ReFS will be equipped big amount functions and will be able to replace the outdated system.

Microsoft says that most likely this will happen with the release of the first update package for Windows 8

Microsoft also claims to have tested ReFS:

“using a complex, extensive set of tens of thousands of tests that have been created for NTFS over more than two decades. These tests recreate the complex deployment conditions we think the system might encounter, such as power failure, issues often related to scalability and performance. Therefore, we can say that the ReFS system is ready for test deployment in a managed environment.”

At the same time, however, the developers admit that being the first version of a large file system, ReFS will probably require caution when handling:

“We do not characterize ReFS for Windows 8 as a beta version. The new file system will be ready for release when Windows 8 leaves beta, because nothing is more important than data reliability. So, unlike any other aspect of the system, it requires a conservative approach to initial use and testing.”

Largely for this reason, ReFS will be introduced according to a phased plan. First - as a storage system for Windows Server, then - as storage for users, and finally - as a boot volume. However, a similar “cautious approach” to the release of new file systems has been used before.