-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add fdisk utility #18
base: master
Are you sure you want to change the base?
Conversation
return err | ||
} | ||
|
||
var mbr [512]byte |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MBR resides in the first 512 bytes of disk. For compatibility, GPT has a MBR-compatible structure in the first sector too.
|
||
const ( | ||
// Classical MBR structure | ||
CPart1 = 0x1be // 16 bytes each |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
offset of first partition entry info.
WIP
Early port of my old diskmagic attempt in C.
Why create something like that in 2016?
Well, I tried to not, but the simplicity of this is dope... When you see the fdisk parameters and read the docs behind MBR/GPT it looks like dark magic at first glance. But then, when you understand that it's super simple and you can exploit this to make nice things, you discover that the tooling around it is not nice...
Closes #18