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

No support for logical partitions within extended partitions #1

Closed
abresas opened this issue Feb 24, 2015 · 1 comment
Closed

No support for logical partitions within extended partitions #1

abresas opened this issue Feb 24, 2015 · 1 comment

Comments

@abresas
Copy link

abresas commented Feb 24, 2015

There is currently no support for displaying information about logical partitions within extended partitions.

For example, on a disk image that has 3 primary partitions and two logical contained within an extended partition, parted has the following output:

Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type      File system  Flags
 1      4194kB  25.2MB  21.0MB  primary   fat16        boot, lba
 2      25.2MB  554MB   528MB   primary   ext3
 3      554MB   1082MB  528MB   primary
 4      1082MB  1103MB  21.0MB  extended               lba
 5      1086MB  1095MB  8389kB  logical
 6      1099MB  1103MB  4194kB  logical
@jhermsmeier
Copy link
Owner

Hey, thanks for bringing this up!

Logical partitions are not entries in the MBR though. They're constructed from the contents of the extended partition's Extended Boot Records (EBR), which are essentially the same in structure as an MBR and can be parsed with this module as well.

So to read logical partitions, you'd have to read the disk's MBR, then look for a partition entry that's marked as an extended partition container (it's type is 0x05, see lib/partition-types.js), then read that partition's first 512 bytes (the EBR), parse that, then look for additional EBRs in the extended partition. For more detail on how extended / logical partitions work: https://en.wikipedia.org/wiki/Extended_boot_record

I'll add a section about how to do this to the README.

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