Skip to content

Add fdisk utility#18

Open
i4ki wants to merge 9 commits intomasterfrom
feat/fdisk
Open

Add fdisk utility#18
i4ki wants to merge 9 commits intomasterfrom
feat/fdisk

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.

1 participant