625 字
3 分钟
Experience Rescuing a ReFS Volume That Turned Into RAW

Cause#

I had heard that the ReFS filesystem has special optimizations for NVMe and SMR HDDs, offers better data safety, and is the filesystem that will replace NTFS in the future. So a year ago I formatted two partitions to ReFS to test the waters. It really did work well, except that OneDrive can’t be used on a ReFS partition.

A few days ago, the built-in SMR HDD suddenly became a RAW partition after a system update. At first I tried opening it in File Explorer, which showed a parameter error. Later, Disk Management showed it as a RAW partition. At first I thought it was a problem with the system update, but then I found that another ReFS partition could be opened. On a whim, I checked the Event Viewer and found that the partition had actually failed. 无法打开

Then I noticed the computer was very laggy. In Task Manager, the failed disk showed continuous read/write usage at 90%+, and I was curious what it was doing. Then I found this hint in the Event Viewer.

自动修复不成功 无法纠正

So I had to go the data recovery route. Initially I planned to use R-Studio. But I found that although R-Studio can handle ReFS partitions now, the ReFS filesystem is iterating rapidly, and that software’s update speed can’t keep up with Microsoft’s. So the files I recovered with it had no directory structure. In the end, I used Microsoft’s own data recovery tool, refsutil.

The ReFS Data Recovery Tool refsutil#

What is refsutil#

It is used to diagnose severely corrupted ReFS volumes (those that have turned into RAW), identify the remaining files, and copy those files to another volume. The tool is located in the %SystemRoot%\Windows\System32 folder. Unless the volume is RAW, there’s no need to use the ReFSutil tool. If it’s read-only, the data can still be accessed.

Microsoft’s introduction to refsutil

How to Use It#

ReFS Salvage has two phases: the scan phase and the copy phase. In automatic mode, the scan and copy phases run sequentially. In manual mode, each phase can be run separately. Progress and logs are saved in the working directory to allow each phase to run separately, as well as to pause and resume the scan phase.

  1. Determine why the volume can’t be mounted
  2. Quick scan phase
  3. Full scan phase
  4. Review in the interactive console (because you can see which files are unneeded, then delete them from the txt file)
  5. Copy phase using the list, copying out the selected files

Determine whether the target volume is a refs volume, and whether the volume can be mounted. If it can’t be mounted, a reason will be provided. 诊断扫描

快速扫描阶段

完全扫描阶段

Later Ideas#

Enabling the ReFS Integrity Streams Feature#

Enabling integrity streams may help. Integrity streams are an optional ReFS feature that guarantees the data obtained is original and error-free.

Integrity streams are an optional feature in ReFS that uses checksums to validate and maintain data integrity. While ReFS always uses checksums for metadata, by default ReFS doesn’t generate or validate checksums for file data. Integrity streams are an optional feature that allows users to use checksums for file data. When integrity streams are enabled, ReFS can clearly determine whether data is valid or corrupted. Additionally, ReFS and Storage Spaces can jointly and automatically correct corrupted metadata and data.

!!! There’s a negative impact on performance though!!!

Terminal window
Get-Item -Path 'C:\*' | Set-FileIntegrity -Enable $True
Set-FileIntegrity C:\ -Enable $True
Get-Item -Path 'C:\*' | Set-FileIntegrity -Enable $False
Set-FileIntegrity C:\ -Enable $False
Get-Item -Path 'C:\*' | Get-FileIntegrity
Get-Item -Path 'C:\' | Get-FileIntegrity

Using a Software RAID Array#

Use VHDX virtual disks and Windows’ Storage Spaces feature to build a software RAID1. Distribute it across two hard drives to improve reliability.

Experience Rescuing a ReFS Volume That Turned Into RAW
https://tski.uk/blog/en/refs-salvage-experience/
作者
Tokisaki Galaxy
发布于
2023-10-16
许可协议
CC BY