Skip to content

C#/.NET class library to retrieve MBR/GPT/FS information from physical drives

License

Notifications You must be signed in to change notification settings

f1x3d/DiskPartitionInfo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

C#/.NET class library to retrieve MBR/GPT/FS information from physical drives

Topics

Resources

License

Stars

Watchers

Forks

Languages