DiscUtils

repository·LTRData.DiscUtils-initial·Indexed 41 days ago

https://github.com/ltrdata/discutils

A modular .NET library for working with disk images, virtual disks, filesystems, and storage protocols without OS mounting. It provides support for various formats including VHD, VHDX, VMDK, VDI, DMG, XVA, ISO 9660, Btrfs, and Windows BCD stores. The library includes integrations for exposing filesystems via Dokan on Windows and FUSE, as well as a Containers meta-package for streamlined discovery of multiple disk image formats.

Tokens
25.5K
Snippets
114
Records
155
Agent score
51%

What's inside DiscUtils

  1. Overview of LTRData.DiscUtils.Net capabilities

    LTRData.DiscUtils-initial

    LTRData.DiscUtils.Net provides networking helpers for DiscUtils integrations, specifically focusing on:

    • DNS record types
    • Unicast and multicast clients
    • ServiceDiscoveryClient for DNS-SD

    Note: This package is used by OpticalDiscSharing; it is not the iSCSI or NFS implementation. Unlike other DiscUtils packages, no DiscUtils format registration is required when using this library.

  2. Overview of DiscUtils

    LTRData.DiscUtils-initial

    DiscUtils is a modular .NET library designed for working with disk images, virtual disks, filesystems, storage protocols, and related storage formats. It allows applications to open, inspect, create, and modify storage images without requiring the operating system to mount them.

    Key capabilities include:

    • Working with complete disks, partitions, filesystems, files, and directories using standard .NET streams.
    • Support for various disk/image formats (VHD, VMDK, RAW, etc.), filesystems (NTFS, FAT, ext4, etc.), and network protocols (iSCSI, NFS).
    • High-performance implementation using modern .NET APIs like Span<T>, asynchronous I/O, and memory-oriented patterns.
    • Optional platform integrations for mounting filesystems via Dokan or FUSE.
  3. Capabilities of LTRData.DiscUtils.Ntfs

    LTRData.DiscUtils-initial

    The LTRData.DiscUtils.Ntfs package provides a managed .NET implementation for NTFS filesystems with the following capabilities:

    CapabilitySupport
    Read files and directoriesYes
    Create / format a filesystemYes
    Modify files and directoriesYes, with a writable backing stream

    It supports NTFS-specific features including:

    • Alternate data streams
    • Security descriptors
    • Reparse points
    • Hard links
    • Allocation metadata

    Formatting is performed via NtfsFileSystem.Format.

  4. Use LTRData.DiscUtils.Streams primitives directly

    LTRData.DiscUtils-initial

    You can use this package independently of DiscUtils.Core or specific filesystem implementations. It provides low-level primitives such as:

    • Sparse memory streams: Streams that only consume memory for the parts of the stream that are actually written to.
    • Stream composition: Tools to build complex streams from simpler ones.
    • Allocation extents: Managing non-contiguous memory/storage allocations.
    • Buffers and stream builders.

    Note on Ownership: When using stream wrappers provided by this library, pay attention to ownership settings; ownership determines whether the wrapper will automatically dispose of the underlying stream it wraps.

  5. Capabilities and limitations of LTRData.DiscUtils.HfsPlus

    LTRData.DiscUtils-initial

    The LTRData.DiscUtils.HfsPlus package provides managed .NET support for reading HFS+ filesystems.

    Supported:

    • Reading files and directories.
    • Accessing Unix metadata and file allocation extents.

    Not Supported:

    • Creating a new filesystem.
    • Modifying an existing filesystem.
    • APFS (this package is strictly for HFS+).

    Important Note: The package reads HFS+ volumes; it is not an APFS implementation.

  6. Capabilities and limitations of LTRData.DiscUtils.Lvm

    LTRData.DiscUtils-initial

    This package provides managed .NET discovery and stream mapping for specific Linux storage configurations.

    Supported

    • LVM Discovery: Discovering LVM physical and logical volumes.
    • LVM Reading: Reading supported logical volumes (specifically single-stripe/linear segments).
    • MD Discovery: Discovering Linux MD arrays (specifically RAID 1 partition members).

    Not Supported

    • Metadata: Creating or editing LVM or MD metadata.
    • Complex LVM Layouts: Multi-stripe, thin, snapshot, and RAID segment layouts are not implemented.

    Important Usage Notes

    • Mapping vs. Management: These are mapping APIs for stream access, not volume-management or array-repair tools.
    • Write Access: Mapped streams may forward writes to writable storage; open-source disks are typically read-only for inspection.
  7. Capabilities of LTRData.DiscUtils.Iso9660

    LTRData.DiscUtils-initial

    The LTRData.DiscUtils.Iso9660 package provides the following filesystem capabilities:

    • Read ISO filesystems: Supported, including Joliet and Rock Ridge views.
    • Create ISO images: Supported using the CDBuilder class.
    • Modify existing ISO filesystems: Not supported. You cannot edit an existing ISO image directly; you must build a new one from scratch.
  8. Capabilities of LTRData.DiscUtils.Iscsi

    LTRData.DiscUtils-initial

    The LTRData.DiscUtils.Iscsi package provides the following capabilities:

    CapabilitySupport
    Discover targets and LUNsYes
    Read remote block devicesYes
    Write remote block devicesYes, subject to target permissions

    Important Note: This is a client library for target discovery, sessions, and read/write access. It is not an iSCSI server or an operating-system initiator driver.

  9. DiscUtils Utilities overview

    LTRData.DiscUtils-initial

    The Utilities directory contains standalone applications for image manipulation. Note that these may have specific platform requirements (e.g., Windows/Administrator) that differ from the core libraries.

    UtilityPurposeRequirements / scope
    DiskCloneClone a live physical Windows disk or selected NTFS volumes into a virtual disk imageWindows, administrator privileges and VSS; NTFS source volumes on conventional BIOS/MBR-partitioned disks
    VirtualDiskConvertConvert virtual disks between supported input/output formatsOutput is limited to formats/layouts with builders
    DiskDumpInspect disks, partitioning and detected filesystemsDepends on the selected format and transport
    FileExtractExtract files from supported disk/filesystem imagesDepends on the selected format and transport
    ISOCreateBuild an ISO image from source filesUses the ISO 9660 builder
  10. VHDX Capabilities and Usage Notes

    LTRData.DiscUtils-initial

    The LTRData.DiscUtils.Vhdx package provides the following capabilities:

    • Read existing images: Yes
    • Create fixed / dynamic images: Yes
    • Create differencing images: Yes
    • Write virtual disk content: Yes (for writable images)
    • Parent chains: Yes

    Important Usage Notes:

    • Layered Architecture: A disk image and a filesystem are separate layers. To work with files inside a disk, you must add partitioning and filesystem packages.
    • Differencing Disks: Parent images must be accessible when opening differencing disks.
    • Driver Requirement: This package does not install a Windows virtual-disk driver.
  11. Understand the LTRData.DiscUtils.Transports package composition

    LTRData.DiscUtils-initial

    The LTRData.DiscUtils.Transports package is a meta-package that includes several specialized packages. If you require a smaller footprint, you can install these individual packages instead of the meta-package:

    PackagePurpose
    LTRData.DiscUtils.CoreCommon .NET disk, filesystem, partition and volume abstractions, including raw disks and format-discovery infrastructure.
    LTRData.DiscUtils.IscsiManaged .NET iSCSI initiator for target discovery, sessions and read/write access to remote block devices.
    LTRData.DiscUtils.NfsManaged .NET NFS v3 client for remote file and directory operations and NFS-backed DiscUtils disk access.
    LTRData.DiscUtils.OpticalDiskManaged .NET optical-disc image access and automatic detection of ISO 9660 and UDF filesystems.