From: "Grégoire Sutre" <gregoire.sutre@labri.fr>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: Improperly nested partitions, help needed!
Date: Wed, 22 Sep 2010 00:54:10 +0200 [thread overview]
Message-ID: <4C993792.1050908@labri.fr> (raw)
In-Reply-To: <1285098134.10425.88.camel@hp.my.own.domain>
On 09/21/2010 09:42 PM, Svante Signell wrote:
> # file /tmp/sda3.mbr /tmp/sda3.mbr: x86 boot sector; GRand Unified
> Bootloader, stage1 version 0x3, 1st sector stage2 0xdd29b38;
> partition 1: ID=0x83, starthead 239, startsector 63, 35153937
> sectors, extended partition table (last)\011, code offset 0x48
I'm surprised that file is able to tell that this is an extended
partition table. If we could reliably distinguish MBR partition tables
from EBR ones, then we could prevent GRUB from considering such EBR
partition tables. But I don't see how a such a distinction could be
made: as far as I know, any EBR partition table could appear in an MBR.
So out of curiosity, I looked a bit deeper at the behavior of the file
command, and I'm afraid that the result of file is not 100% reliable in
this respect: for a partition table with only one used entry, file
detects it as an EBR partition table if the entry is not active, as
shown by this example (one sector in /tmp/sect.bin):
Device Boot Start End #sectors Id System
/tmp/sect.bin1 * 63 41945714 41945652 83 Linux
/tmp/sect.bin2 0 - 0 0 Empty
/tmp/sect.bin3 0 - 0 0 Empty
/tmp/sect.bin4 0 - 0 0 Empty
$ od -Ax -t x1 /tmp/sect.bin
000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
0001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 01
0001c0 01 00 83 fe ff ff 3f 00 00 00 34 0a 80 02 00 00
0001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
0001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa
000200
$ file /tmp/sect.bin
/tmp/sect.bin: x86 boot sector; partition 1: ID=0x83, active, starthead
1, startsector 63, 41945652 sectors, code offset 0x0
Everything looks good. But after making the partition inactive,
we get:
$ od -Ax -t x1 /tmp/sect.bin
000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
0001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01
0001c0 01 00 83 fe ff ff 3f 00 00 00 34 0a 80 02 00 00
0001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
0001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa
000200
$ file /tmp/sect.bin
/tmp/sect.bin: x86 boot sector; partition 1: ID=0x83, starthead 1,
startsector 63, 41945652 sectors, extended partition table (last)\011,
code offset 0x0
Still, this partition table may well be contained in an MBR.
Grégoire
next prev parent reply other threads:[~2010-09-21 22:54 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-21 7:31 Improperly nested partitions, help needed! Svante Signell
2010-09-21 13:13 ` Isaac Dupree
2010-09-21 20:23 ` Isaac Dupree
2010-09-21 13:59 ` Grégoire Sutre
2010-09-21 14:54 ` Lennart Sorensen
2010-09-21 15:23 ` Grégoire Sutre
2010-09-21 19:42 ` Svante Signell
2010-09-21 20:18 ` Lennart Sorensen
2010-09-21 20:29 ` Svante Signell
2010-09-21 21:11 ` Lennart Sorensen
2010-09-21 22:54 ` Grégoire Sutre [this message]
2010-09-22 16:19 ` Phillip Susi
2010-09-22 16:44 ` Lennart Sorensen
2010-09-22 17:08 ` Grégoire Sutre
2010-09-22 17:44 ` Lennart Sorensen
2010-09-22 18:00 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-09-22 20:57 ` Brendan Trotter
2010-09-22 21:13 ` Vladimir 'φ-coder/phcoder' Serbinenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C993792.1050908@labri.fr \
--to=gregoire.sutre@labri.fr \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.