Skip to content

Latest commit

 

History

History
38 lines (27 loc) · 1.41 KB

README.md

File metadata and controls

38 lines (27 loc) · 1.41 KB

Disk Partition Info

Disk Partition Info is a C#/.NET class library that allows you to read various low-level physical disk information such as the Master Boot Record (MBR), GUID Partition Table (GPT) and different filesystem headers like NTFS, FAT32, exFAT, ext2/ext3/ext4, etc.

It should work on both Windows, Linux and macOS although only Windows was tested.

Build

  • Install .NET 5 SDK on your system
  • Run dotnet build

Usage

Master Boot Record (MBR)

var mbr = DiskPartitionInfo.ReadMbr()
    .FromPath("disk.img");
    // or .FromStream(memoryStream);
    // or .FromPhysicalDriveNumber(0); (Windows only)
    // or .FromVolumeLetter("C:");     (Windows only)

GUID Partition Table (GPT)

var gpt = DiskPartitionInfo.ReadGpt()
    .Primary()
    // or .Secondary()
    .FromPath("disk.img");
    // or .FromStream(memoryStream);
    // or .FromPhysicalDriveNumber(0); (Windows only)
    // or .FromVolumeLetter("C:");     (Windows only)

Filesystem headers

Not implemented yet