Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing fdisk-like utility #17

Open
i4ki opened this issue Oct 13, 2016 · 3 comments
Open

missing fdisk-like utility #17

i4ki opened this issue Oct 13, 2016 · 3 comments

Comments

@i4ki
Copy link
Collaborator

i4ki commented Oct 13, 2016

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..

@geyslan
Copy link
Member

geyslan commented Jan 10, 2017

I may be foolish by pointing this, however, what do you think of change the name to something that resemble partition, like the gnu parted. fdisk is from the time when we only had proper disks.

@i4ki
Copy link
Collaborator Author

i4ki commented Jan 11, 2017

This might be a good idea. What do you think of part ?

@geyslan
Copy link
Member

geyslan commented Jan 11, 2017

part is nice. The f prefix is from fixed and I didn't know that. 😄 I always thought it was from format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants