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

Add fdisk utility #18

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Add fdisk utility #18

wants to merge 9 commits into from

Conversation

i4ki
Copy link
Collaborator

@i4ki i4ki commented Oct 13, 2016

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

return err
}

var mbr [512]byte
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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.

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

Successfully merging this pull request may close these issues.

None yet

1 participant