Skip to content

missing fdisk-like utility #17

@i4ki

Description

@i4ki

I miss a fdisk-like utility with features below:

  • Non-interactive;
  • Able to create MBR/GPT;
  • Able to create/update MBR bootsector (do not touch partition table);

Features below could arrive in the future.

  • add/update/delete partition entries;
  • Restore partition entries;

Usage examples:

λ> fdisk somefile.txt
ERROR: MBR/GPT not found
λ> dd "if=/dev/zero" "of=disk.raw" "bs=1M" "count=1"
1+0 records in
1+0 records out
1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.00338425 s, 310 MB/s
λ> fdisk mbr -create ./disk.raw
ERROR: missing -bootsect argument
λ> fdisk mbr -create -bootsect boot.bin ./disk.raw
λ> fdisk ./disk.raw 
MBR Found, but no partitions.
λ> fdisk mbr -add-part 1 -primary -start-sect 2 -last-sect "+500k"
Partition #0
Status: inactive
FS type: 83 (Linux)
First C/H/S: 0/0/2
Last C/H/S: 0/15/57
LBA: 1
Number of sectors: 1001
λ> # now, the command below do not touch partition entries
λ> fdisk mbr -update -bootsect malware.bin

It should not be distributed with enzo docker/tar image. It'll be used on my experiments with osdev. I'm only putting it here to avoid fetch lots of repos on my scripts..

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions