With the public beta release of Windows Server 8, Microsoft introduced an implementation of its Resiliant File System (ReFS). This page links to ReFS resources that include Microsoft documentation, forensic images of ReFS volumes, and disk structures. Please join me in reversing the on-disk layout of ReFS.
Microsoft Documentation
- Building the Next Generation File System for Windows by Surendra Verma - The initial description of ReFS and explanations of its design decisions.
- Application Compatibility with ReFS - “Provides an introduction to ReFS and an overview of changes that are relevant to developers”.
- File Directory Volume Support - The File Directory Volume Support spreadsheet documents ReFS support for existing file system APIs.
Sample Images
The archive available here [zip] contains eight forensic images created by FTK Imager Lite 2.9.0 on Window Server 8 Beta build 8250 running on VirtualBox 4.1.8. There are seven physical images and one logical image of a local volume formatted with ReFS. The size of the archive is 492 MB and the uncompressed size is approximately 8 GB. The archive MD5 sum is 2c67d770e7473a516d05ded1432432b1. You may use the contents of the archive without restriction.
I envision the sample images could be used as initial test cases by those interested in ReFS. For example, when describing an interesting structure, the images provide reference offsets (like, the “ReFS VBR starts at offset 201:0000h in Physical Image 1”). The images can also be used by those who do not have immediate access to a working instance of Windows Server 8. Grab them and get reversing!
I created the target volume on March 3, 2012 at 2:50 EST by attaching a 1024 MB VirtualBox virtual disk and formatting a 512 MB volume using the Windows Volume Management utility. I selected the default values at each prompt.
I generated the set of test images by systematically manipulating the file system and immediately acquiring an image. The file system manipulations included creating files, deleting files, creating nested directories and files, and completely filling the file system. I performed all actions using Windows Explorer. See the section Sample Image Sequence for a detailed timeline of the image acquisition sequence.
Disk Structures
“Under construction”!
Based on data gleaned from the sample images referenced in the previous section, the file system may use structures described in this section. A pseudo-C/010 Editor template formats each structure in this section. Of course, the contents of this section are subject to change pending additional research.
Boot Structures
Microsoft Windows Server 8 will not support booting from a ReFS volume when it is released. By default, Windows Server 8 partitions a disk using a standard GUID Partition Table. A description of GPT follows.
A legacy MBR table fills the first sector (Physical Image 1 offset :0000h). The GPT immediately follows the MBR (PI-1 offset :0200h). The first entry of the GPT is reserved, while the second entry points to the first usable partition (PI-1 offset :0480h). A GPT entry specifies the type of the partition using a well-defined GUID, the volume identifier as a GUID, and the first and last sectors of the partition. The final few sectors of the disk hold a backup copy of the GPT (PI-1 offset 3FFF:FE00h). A 010 Editor template is available [here][4].
GPT Header
| Offset | Size | Field | Notes |
|---|---|---|---|
| 0x00 | unsigned char[8] | signature | “EFI PART” |
| 0x08 | uint32 | revision | |
| 0x0C | uint32 | size | |
| 0x10 | uint32 | crc32 | |
| 0x14 | uint32 | reserved | |
| 0x18 | uint64 | current_sector | |
| 0x20 | uint64 | backup_sector | |
| 0x28 | uint64 | first_sector | |
| 0x30 | uint64 | last_sector | |
| 0x38 | unsigned char[16] | disk_guid | |
| 0x48 | uint64 | entries_sector | |
| 0x50 | uint32 | num_entries | |
| 0x54 | uint32 | entry_size | |
| 0x58 | uint32 | entry_crc32 | |
| 0x5C | unsigned char[SECTORSIZE - 92] | reserved |
GPT Entry
| Offset | Size | Field | Notes |
|---|---|---|---|
| 0x00 | unsigned char[16] | type | |
| 0x00 | unsigned char[16] | type GUID | |
| 0x10 | unsigned char[16] | identifier GUID | |
| 0x20 | uint64 | first_sector | |
| 0x28 | uint64 | last_sector | inclusive |
| 0x30 | uint64 | flags |
ReFS Volume Boot Record
In Physical Image 1, the ReFS Volume Boot Record (VBR) begins at offset 201:000h. The fourth through eigth bytes of the VBR contain the NULL terminated string “ReFS”. The VBR is at least 65 bytes long. The remainder of the sector is filled with zeros.
File System Metadata
File system metadata is spread throughout a ReFS formatted partition. This is in contrast to file systems like NTFS, where the majority of metadata is stored in the MFT. ReFS metadata structures follow a consistent top level layout. The contents of a ReFS metadata block are determined either implicitly (eg. the root metadata block) or via a header at a known offset.
A ReFS metadata block is 0x4000 bytes in size. The first DWORD of a ReFS metadata block equals the 0x4000 byte cluster number of the block. For example, in Physical Image 5, the root metadata block is located at volume offset 0x7:8000. In terms of 0x4000 byte clusters, this is offset 0x1E. Note that the first DWORD of this metadata structure is 0x1E:
1 2 3 | |
File Contents
Contents of small files in a ReFS volume may be stored at offsets mod 0x1:0000 (for example, 0x1:0000, 0x2:0000, etc.). The contents of a file begin at the first byte in a ReFS data cluster. Small files are not stored “resident” in a metadata structure. In Physical Image 5, the contents of “desktop.ini” are located at volume offset 0x221:0000 (0x4000 cluster 0x84):
1 2 3 4 5 6 7 8 | |
Upcase table
In Physical Image 1, volume offsets 19:0000h through 1B:0000h (0x4000 clusters 0x64 through 0x6B) list many WORD values that generally increase. Jeff Hamm suggests this may be an Upcase table similar to that found in NTFS and exFAT. For example, at volume offset 19:0060h:
1 2 3 4 5 6 7 8 9 10 | |
Misc. and Tidbits
- There are about 25 FILETIME timestamps similar to the creation date of the volume in Physical Image 1.
- There are about four instances of the volume name in Unicode in Physical Image 1.
Given that ReFS metadata blocks begin with their 0x4000 cluster number and that ReFS data blocks begin with content, the following script identifies ReFS structures:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | |
Running the script against Physical Image 5 yields the following layout.
Note that I’ve annotated the 0x4000 clusters with comments that begin with #.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | |
Sample Image Sequence
Process started: 2012/03/03 at 13:52:XX EST.
- Create new volume, using the New Volume Wizard.
Settings:
Disk 2 Capacity 1.00GB
Disk will be partitioned with GPT
Volume size 512 MB
Drive Letter F
ReFS File System
Default Allocation Unit Size
Volume Label: Willi Ballenthin Test Volume 1
Not short filenames
Physical Drive Image:
Type dd
Case Number 1
Evidence Number 1
Unique Description Physical Drive Image 1
Examiner Willi Ballenthin
Notes 1
Filename Physical_Image_1
Not Fragmented
Logical Drive Image:
Type dd
Case Number 1
Evidence Number 2
Unique Description Logical Drive Image 1
Examiner Willi Ballenthin
Notes 2
Filename Logical_Image_1
Not Fragmented
FTK creates an image of size 1019.75, similar to the Physical Drive Image. Only Physical Drive images from this point on.
- Download
eicar.com. - Download
eicar.zip. - Download
eicar2.zipfrom www.rexwain.com/eicar.html. - Copy
eicar.comtoF:\on 2012/03/03 at 14:20:xx EST.
Physical Drive Image:
Type dd
Case Number 1
Evidence Number 3
Unique Description Physical Drive Image 3
Examiner Willi Ballenthin
Notes 3
Filename Physical_Image_3
Not Fragmented
- Delete
F:\eicar.comon 2012/03/03 at 14:25:xx EST.
Physical Drive Image:
Type dd
Case Number 1
Evidence Number 4
Unique Description Physical Drive Image 4
Examiner Willi Ballenthin
Notes 4
Filename Physical_Image_4
Not Fragmented
- Copy
eicar.com,eicar.zip, andeicar2.ziptoF:\on 2012/03/03 at 14:30:xx EST. - Create directory
F:\test directoryon 2012/03/03 at 14:31:xx EST.
Physical Drive Image:
Type dd
Case Number 1
Evidence Number 5
Unique Description Physical Drive Image 5
Examiner Willi Ballenthin
Notes 5
Filename Physical_Image_5
Not Fragmented
- Download Linux Kernel 3.2.9 archive from Kernel.org.
- Delete
eicar.com,eicar.zip,eicar2.zip, andtest directoryfromF:\on 2012/03/03 at 14:38:xx EST. - Copy
linux-3.2.9.tar.bz2toF:\on 2012/03/03 at 14:39:xx EST.
Physical Drive Image:
Type dd
Case Number 1
Evidence Number 6
Unique Description Physical Drive Image 6
Examiner Willi Ballenthin
Notes 6
Filename Physical_Image_6
Not Fragmented
- Use 7zip to extract
linux-3.2.9.tar.bz2to directorylinux-3.2.9.taron 2012/03/03 at 14:46:xx EST. - Ran out of space after 304 MB at 2012/03/03 at 14:48:xx EST.
Physical Drive Image:
Type dd
Case Number 1
Evidence Number 7
Unique Description Physical Drive Image 7
Examiner Willi Ballenthin
Notes 7
Filename Physical_Image_7
Not Fragmented
- Download python-registry v0.2.4.1.
- Delete
linux-3.2.9.tar.bz2andlinux.3.2.9.tar/fromF:\on 2012/03/03 at 14:59:xx EST. - Copy
williballenthin-python-registry-v0.2.4.1-1-g1e78a95.ziptoF:\on 2012/03/03 at 15:00:xx EST. - Extract
williballenthin-python-registry-v0.2.4.1-1-g1e78a95.ziptoF:\williballenthin-python-registry-v0.2.4.1-1-g1e78a95\on 2012/03/03 at 15:00:xx EST.
Physical Drive Image:
Type dd
Case Number 1
Evidence Number 8
Unique Description Physical Drive Image 8
Examiner Willi Ballenthin
Notes 8
Filename Physical_Image_8
Not Fragmented
- Delete
F:\williballenthin-python-registry-v0.2.4.1-1-g1e78a95.zipandF:\williballenthin-python-registry-v0.2.4.1-1-g1e78a95\on 2012/03/03 at 15:12:xx EST.
Physical Drive Image:
Type dd
Case Number 1
Evidence Number 9
Unique Description Physical Drive Image 9
Examiner Willi Ballenthin
Notes 9
Filename Physical_Image_9
Not Fragmented