-
Notifications
You must be signed in to change notification settings - Fork 14
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
122 partitions detected on FreeNAS iso #6
Comments
At a guess, I wonder if Although it does seem weird to see GPT used inside an ISO - maybe this is another weird hybrid ISO format? 🤷 |
A mixture of curiosity and boredom led me to try and match up parts of https://github.com/jhermsmeier/node-gpt/blob/master/lib/gpt.js with https://en.wikipedia.org/wiki/GUID_Partition_Table 😉
and then |
Oooh, if I change https://github.com/jhermsmeier/node-gpt/blob/master/lib/gpt.js#L162 to use |
Hmmm.... after a bit more background-reading, maybe a this is a "better" fix: --- a/lib/gpt.js
+++ b/lib/gpt.js
@@ -264,8 +264,9 @@ GPT.prototype = {
var tableOffset = ( this.tableOffset - this.currentLBA ) * this.blockSize
// Parse partition tables
- this.parseTable( buffer, offset + tableOffset, offset + tableOffset + this.blockSize )
- this.parseTable( buffer, offset + tableOffset + this.blockSize, offset + tableOffset + this.tableSize )
+ var tableStart = offset + tableOffset
+ var tableEnd = tableStart + ( this.entries * this.entrySize )
+ this.parseTable( buffer, tableStart, tableEnd )
return this 🤷♂️ |
More curiosity led me to do a bit more research... 😉
I see there's a comment in the README which says:
However I wonder if this is simply @jhermsmeier misinterpreting the diagram on the Wikipedia page ? The diagram shows LBA0 as the "Protective MBR", LBA1 as the "Primary GPT Header", LBA2 as "Entry1, Entry2, Entry3, Entry4", and LBAs up to 33 as "Entries5-128". Reading the comment above, I wonder if Jonas has assumed that LBA3 is Entry5, LBA4 is Entry6, etc.? I.e. There's nothing "special" about the first 4 partition entries, so the two separate calls to |
Fixed in |
node-gpt
detects 122 partitions with incoherent sizes, offsets and names on this iso: https://download.freenas.org/11.3/STABLE/U3.2/x64/FreeNAS-11.3-U3.2.isofdisk
sees this:The text was updated successfully, but these errors were encountered: