c0defellas / enzo

core utilities
11 stars 2 forks source link

missing fdisk-like utility #17

Open i4ki opened 7 years ago

i4ki commented 7 years ago

I miss a fdisk-like utility with features below:

Features below could arrive in the future.

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 commented 7 years ago

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 commented 7 years ago

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

geyslan commented 7 years ago

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