Notes on Using ReFS

什么是ReFS

浏览本文的时候,默认你已经了解了ReFS的基本概念以及优劣。如果不了解,可以参考ReFS概述
本文只讨论自己使用ReFS的注意事项,若有命令参数等请自行参考本文的超链接官方文档。
并且本文对ReFS的归纳并不完整,请参阅官方文档。

ReFS注意事项

下面只讨论作为数据盘的情况,不太建议用作系统盘。虽然新版本的Windows支持从REFS引导,但是社区依然发现在系统还原这种基础问题上依然有问题。

强烈建议在使用前,禁止自动升级REFS版本。不然在回撤Windows版本的时候,你会无法访问数据盘,变成RAW分区。
REFS的版本升级是不可逆的,升级后无法降级!!!

日常维护

禁止自动升级(推荐)

1
2
3
4
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem]
"RefsDisableLastAccessUpdate"=dword:00000001
;"RefsDisableVolumeUpgrade"=dword:00000001 不用这种方法,似乎会阻止手动升级

手动升级(推荐)

在你确认你不需要降级的情况下,手动升级ReFS版本。高版本的ReFS会有更好的性能和稳定性。

1
2
3
4
5
# 查看版本
fsutil fsinfo refsinfo z:

# 升级文件系统版本
fsutil Volume Upgrade <C:>

数据压缩(推荐)

这个挺好用的。
数据压缩文档

重复数据删除(推荐)

重复数据删除文档

数据修复(必看)

分析和解决文件系统损坏问题
对于变成RAW(损坏的卷)执行恢复作以检索数据。

高级功能

ReFS完整性流(推荐)

完整性流是 ReFS 的一项功能,它可以确保文件数据的完整性。它使用 CRC32 校验和来验证文件数据的完整性。启用完整性流后,ReFS 会在每次读取文件时计算 CRC32 校验和,并将其与存储在文件中的校验和进行比较。如果校验和不匹配,则 ReFS 会尝试修复文件。
完整性流文档

Get-FileIntegrity

若要查看是否为文件数据启用了完整性流,请使用 Get-FileIntegrity cmdlet。

1
Get-FileIntegrity -FileName 'C:\Docs\TextDocument.txt'
1
Get-Item -Path 'C:\Docs\*' | Get-FileIntegrity

也可以使用 Get-Item cmdlet 获取指定目录中所有文件的完整性流设置。

Set-FileIntegrity

若要对文件数据启用/禁用完整性流,请使用 Set-FileIntegrity cmdlet。

1
Set-FileIntegrity -FileName 'H:\Docs\TextDocument.txt' -Enable $True

也可以使用 Get-Item cmdlet 设置指定文件夹中所有文件的完整性流设置。

1
Get-Item -Path 'H\Docs\*' | Set-FileIntegrity -Enable $True

Set-FileIntegrity cmdlet 也可直接用于卷和目录。

1
2
Set-FileIntegrity H:\ -Enable $True
Set-FileIntegrity H:\Docs -Enable $True

高级重复数据删除

高级重复数据删除指令
我一直分不清ReFSDedupSchedule和ReFSDedupScrubSchedule区别。总之我一直用ReFSDedupScrubSchedule。

不过基本上常用的下面这些

1
2
3
4
5
6
Disable-ReFSDedup Z:
refsutil dedup z: /d
Enable-ReFSDedup -Volume "Z:" -Type DedupAndCompress
Set-ReFSDedupScrubSchedule -Volume: Z: -Start 2025/4/29 19:0:0 -WeeksInterval 2
Start-ReFSDedupJob -Volume Z: -CompressionFormat LZ4
Stop-ReFSDedupJob Z:

What is ReFS

While reading this article, it is assumed that you already understand the basic concepts, advantages, and disadvantages of ReFS. If not, you can refer to the ReFS Overview.
This article only discusses considerations for personal use of ReFS. For command parameters and other details, please refer to the official document hyperlinks within this text.
Also, this article is not a complete summary of ReFS; please consult the official documentation.

Notes on ReFS

The following only discusses the scenario of using ReFS as a data drive. It is not strongly recommended for use as a system drive. Although newer versions of Windows support booting from ReFS, the community has still found issues with basic functionalities like system restore.

It is highly recommended to disable automatic ReFS version upgrades before use. Otherwise, when rolling back the Windows version, you may be unable to access the data drive, and it might become a RAW partition.
ReFS version upgrades are irreversible; once upgraded, it cannot be downgraded!!!

Daily Maintenance

1
2
3
4
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem]
"RefsDisableLastAccessUpdate"=dword:00000001
;"RefsDisableVolumeUpgrade"=dword:00000001 Not using this method, as it seems to prevent manual upgrades

Manually upgrade the ReFS version when you are certain you will not need to downgrade. Higher versions of ReFS offer better performance and stability.

1
2
3
4
5
# Check version
fsutil fsinfo refsinfo z:

# Upgrade filesystem version
fsutil Volume Upgrade <C:>

This feature is quite useful.
Data Compression Documentation

Data Deduplication Documentation

Data Recovery (Must Read)

Analyze and Resolve Filesystem Corruption Issues
Perform Recovery on a RAW (Corrupted) Volume to Retrieve Data.

Advanced Features

Integrity Streams is a feature of ReFS that ensures the integrity of file data. It uses CRC32 checksums to verify the integrity of file data. When Integrity Streams is enabled, ReFS calculates a CRC32 checksum each time a file is read and compares it with the checksum stored in the file. If the checksums do not match, ReFS attempts to repair the file.
Integrity Streams Documentation

Get-FileIntegrity

To check whether Integrity Streams is enabled for file data, use the Get-FileIntegrity cmdlet.

1
Get-FileIntegrity -FileName 'C:\Docs\TextDocument.txt'
1
Get-Item -Path 'C:\Docs\*' | Get-FileIntegrity

You can also use the Get-Item cmdlet to retrieve the Integrity Streams settings for all files in a specified directory.

Set-FileIntegrity

To enable/disable Integrity Streams for file data, use the Set-FileIntegrity cmdlet.

1
Set-FileIntegrity -FileName 'H:\Docs\TextDocument.txt' -Enable $True

You can also use the Get-Item cmdlet to set the Integrity Streams settings for all files in a specified folder.

1
Get-Item -Path 'H\Docs\*' | Set-FileIntegrity -Enable $True

The Set-FileIntegrity cmdlet can also be applied directly to volumes and directories.

1
2
Set-FileIntegrity H:\ -Enable $True
Set-FileIntegrity H:\Docs -Enable $True

Advanced Deduplication

Advanced Deduplication Commands
I have always been unclear about the difference between ReFSDedupSchedule and ReFSDedupScrubSchedule. In any case, I always use ReFSDedupScrubSchedule.

However, the commonly used ones are basically the following:

1
2
3
4
5
6
Disable-ReFSDedup Z:
refsutil dedup z: /d
Enable-ReFSDedup -Volume "Z:" -Type DedupAndCompress
Set-ReFSDedupScrubSchedule -Volume: Z: -Start 2025/4/29 19:0:0 -WeeksInterval 2
Start-ReFSDedupJob -Volume Z: -CompressionFormat LZ4
Stop-ReFSDedupJob Z:

Notes on Using ReFS
https://tokisaki.top/blog/refs-attention/
作者
Tokisaki Galaxy
发布于
2025年4月21日
许可协议