Create a user-space diskpart utility that can view and modify MBR
partition tables on block devices accessible through /dev.
Features:
- list: displays all 4 partition slots with type, LBA start, size
- create <slot> <type> <start> <sectors>: creates a new partition
- delete <slot>: removes a partition entry
- activate/deactivate <slot>: sets or clears the bootable flag
The tool reads sector 0 (MBR) via VFS open/read, modifies the
partition table in memory, then writes it back via open/write.
Supports hex type codes and provides human-readable type names
for common partition types (FAT12/16/32, Linux, NTFS, etc.).
Usage: diskpart hdd1 create 1 0C 2048 14336
diskpart hdd1 list
diskpart hdd1 delete 2
2.1 KiB
2.1 KiB