LTRData.DiscUtils.Ntfs
1.0.92
dotnet add package LTRData.DiscUtils.Ntfs --version 1.0.92
NuGet\Install-Package LTRData.DiscUtils.Ntfs -Version 1.0.92
<PackageReference Include="LTRData.DiscUtils.Ntfs" Version="1.0.92" />
<PackageVersion Include="LTRData.DiscUtils.Ntfs" Version="1.0.92" />
<PackageReference Include="LTRData.DiscUtils.Ntfs" />
paket add LTRData.DiscUtils.Ntfs --version 1.0.92
#r "nuget: LTRData.DiscUtils.Ntfs, 1.0.92"
#:package LTRData.DiscUtils.Ntfs@1.0.92
#addin nuget:?package=LTRData.DiscUtils.Ntfs&version=1.0.92
#tool nuget:?package=LTRData.DiscUtils.Ntfs&version=1.0.92
LTRData.DiscUtils.Ntfs
Managed .NET implementation for reading, formatting and modifying NTFS filesystems, including NTFS-specific file metadata.
Part of the LTRData DiscUtils fork. Package IDs use LTRData.DiscUtils; C# namespaces remain DiscUtils.
Installation
dotnet add package LTRData.DiscUtils.Ntfs
Capabilities
| Capability | Support |
|---|---|
| Read files and directories | Yes |
| Create / format a filesystem | Yes |
| Modify files and directories | Yes, with a writable backing stream |
NTFS $LogFile journal analysis and recovery |
Yes, for supported records and safe recovery states |
WOF-compressed files (compact /exe: XPRESS 4K/8K/16K, LZX) |
Read, decompressed transparently; WIM-backed (WIMBoot) files read as their stubs |
| Files optimized by Windows Server Data Deduplication | Transparent read-only access to the unnamed stream through LTRData.DiscUtils.DeduplicationRole. Set NtfsOptions.ReadDeduplicatedFiles to false for raw stub access |
Usage notes
Supports alternate data streams, security descriptors, reparse points, hard links and allocation metadata through NTFS-specific APIs. Formatting is available through NtfsFileSystem.Format. Support for these APIs does not imply support for every Windows NTFS feature.
Files optimized by Data Deduplication
| Operation on an existing optimized file | Default NTFS behavior |
|---|---|
| Open or open-or-create the unnamed stream for reading | Read reconstructed data |
| Open the unnamed stream for write or read/write, create, truncate or append | Reject before changing the file |
| Create a new file at the same name | Report that the file exists |
| Open a named data stream | Apply ordinary NTFS access and mode rules |
Copy an optimized source with CopyFile, or overwrite an optimized destination with a copy or move |
Reject before copying physical attributes or replacing the destination |
| Delete an optimized file, including through recursive directory deletion | Reject while transparent handling is enabled |
| Change the sparse or compressed attribute of an optimized file | Reject the representation change |
ReadDeduplicatedFiles = false exposes the physical stub, including locally stored or recalled ranges. Raw reads of holes return zeros. Raw writes, edits to reparse points, and direct access to the chunk store require the caller to manage consistency. DiscUtils does not implement rehydration, chunk reference-count maintenance or garbage collection. Rename and hard-link APIs use ordinary NTFS namespace semantics. Their interaction with the Windows deduplication service has not been qualified.
The Windows Server 2025 NTFS fixture provides independent checks of ten optimized unnamed streams and an alternate stream against Windows lengths and SHA-256 hashes. The transplanted chunk-store test is additional coverage.
NTFS journal recovery
DiscUtils can inspect the NTFS $LogFile journal after an unclean shutdown and replay supported metadata changes. NtfsJournal.Analyze(volumeStream) reports the recovery state without writing; NtfsFileSystem.JournalInfo describes what happened when opening a filesystem.
- Default writable open:
new NtfsFileSystem(stream)refuses a journal requiring recovery or reset, or one it cannot safely interpret. It does not automatically change the volume. - Default read-only open: supported journal changes are replayed in memory, leaving the source unchanged. If recovery is unsupported, the filesystem opens without replay and
JournalInfo.StatusreportsUnsupported; callers must not assume its metadata is current. - Explicit recovery:
new NtfsFileSystem(stream, NtfsJournalMode.Replay)orNtfsJournal.Replay(stream)performs supported persistent recovery on a writable stream.NtfsJournalMode.Refuserejects volumes requiring recovery;Ignorebypasses journal handling and can expose stale metadata.
Limitations: Persistent replay is not atomic and is refused when metadata undo is required; such undo is supported only in memory. The hibernation check covers local evidence, not suspended Windows installations holding the volume from elsewhere. Before persistent replay, ensure the volume is offline and exclusively owned. The SparseStream.Flush(true) durability barriers depend on the runtime, all stream wrappers and the underlying storage honoring them.
See recovery and undo qualification, hibernation safeguards and replay durability.
Registration
For automatic discovery, register the providers implemented by this package:
DiscUtils.Ntfs.Formats.Register();
Direct use of the concrete APIs in this package does not require discovery registration. Each registration call covers only its own assembly. Register DiscUtils.Core.Formats.Register() as well when using generic disk opening through the local-file transport, and register other disk/filesystem providers as needed. These registration calls support trimming and Native AOT; this is not a guarantee for every operation in the package.
Example
using System.IO;
using DiscUtils.Ntfs;
// An existing NTFS volume image, starting at the filesystem boot sector.
using var image = File.Open("ntfs.img", FileMode.Open, FileAccess.ReadWrite);
// A writable open requires a clean journal by default; recovery needs explicit opt-in.
using var fs = new NtfsFileSystem(image);
fs.CreateDirectory("Reports");
using var file = fs.OpenFile(@"Reports\hello.txt", FileMode.Create, FileAccess.Write);
using var writer = new StreamWriter(file);
writer.WriteLine("Hello from DiscUtils!");
Related packages
Documentation
Repository and capability matrix · Wiki · Migration guide · Format registration and Native AOT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. net11.0 is compatible. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net46 is compatible. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6
- LTRData.DiscUtils.Core (>= 1.0.92)
- LTRData.DiscUtils.DeduplicationRole (>= 1.0.92)
-
.NETFramework 4.8
- LTRData.DiscUtils.Core (>= 1.0.92)
- LTRData.DiscUtils.DeduplicationRole (>= 1.0.92)
-
.NETStandard 2.0
- LTRData.DiscUtils.Core (>= 1.0.92)
- LTRData.DiscUtils.DeduplicationRole (>= 1.0.92)
-
.NETStandard 2.1
- LTRData.DiscUtils.Core (>= 1.0.92)
- LTRData.DiscUtils.DeduplicationRole (>= 1.0.92)
-
net10.0
- LTRData.DiscUtils.Core (>= 1.0.92)
- LTRData.DiscUtils.DeduplicationRole (>= 1.0.92)
-
net11.0
- LTRData.DiscUtils.Core (>= 1.0.92)
- LTRData.DiscUtils.DeduplicationRole (>= 1.0.92)
-
net8.0
- LTRData.DiscUtils.Core (>= 1.0.92)
- LTRData.DiscUtils.DeduplicationRole (>= 1.0.92)
-
net9.0
- LTRData.DiscUtils.Core (>= 1.0.92)
- LTRData.DiscUtils.DeduplicationRole (>= 1.0.92)
NuGet packages (8)
Showing the top 5 NuGet packages that depend on LTRData.DiscUtils.Ntfs:
| Package | Downloads |
|---|---|
|
Microsoft.CST.RecursiveExtractor
RecursiveExtractor is able to process the following formats: ar, bzip2, deb, gzip, iso, tar, vhd, vhdx, vmdk, wim, xzip, and zip. RecursiveExtractor automatically detects the archive type and fails gracefully when attempting to process malformed content. |
|
|
LTRData.DiscUtils.FileSystems
DiscUtils meta-package for filesystem readers, supported filesystem writers and virtual filesystem abstractions. |
|
|
LTRData.DiscUtils
Broad DiscUtils meta-package for managed .NET disk images, filesystems, storage protocols and related storage formats. |
|
|
ERZHelpers
Raw NTFS reads of locked files, and listing and mounting of Volume Shadow Copies, for Eric Zimmerman's tools |
|
|
LTRData.DiscUtils.Dokan
Mounts DiscUtils IFileSystem implementations using Dokan file system driver |
GitHub repositories (2)
Showing the top 2 popular GitHub repositories that depend on LTRData.DiscUtils.Ntfs:
| Repository | Stars |
|---|---|
|
ArsenalRecon/Arsenal-Image-Mounter
Arsenal Image Mounter mounts the contents of disk images as complete disks in Microsoft Windows.
|
|
|
microsoft/RecursiveExtractor
RecursiveExtractor is a .NET Standard 2.0 archive extraction Library, and Command Line Tool which can process 7zip, ar, bzip2, deb, gzip, iso, rar, tar, vhd, vhdx, vmdk, wim, xzip, and zip archives and any nested combination of the supported formats.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.92 | 0 | 12/5/2026 |
| 1.0.91 | 2,066 | 11/14/2026 |
| 1.0.90 | 9,720 | 10/11/2026 |
| 1.0.89 | 1,912 | 9/22/2026 |
| 1.0.88 | 6,965 | 8/3/2026 |
| 1.0.87 | 841 | 7/20/2026 |
| 1.0.86 | 1,908 | 7/4/2026 |
| 1.0.85 | 552 | 6/30/2026 |
| 1.0.84 | 318 | 6/27/2026 |
| 1.0.83 | 721 | 6/18/2026 |
| 1.0.82 | 27,615 | 5/26/2026 |
| 1.0.81 | 1,235 | 5/14/2026 |
| 1.0.80 | 4,396 | 4/24/2026 |
| 1.0.77 | 8,438 | 3/13/2026 |
| 1.0.76 | 373 | 3/10/2026 |
| 1.0.75 | 1,076 | 2/20/2026 |
| 1.0.74 | 289 | 2/18/2026 |
| 1.0.73 | 3,074 | 1/5/2026 |
| 1.0.72 | 2,275 | 11/25/2025 |
| 1.0.71 | 621 | 11/19/2025 |