public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Extended partition mapping wrong size
@ 2010-03-29 16:11 Phillip Susi
  2010-04-06 11:47 ` Karel Zak
  0 siblings, 1 reply; 5+ messages in thread
From: Phillip Susi @ 2010-03-29 16:11 UTC (permalink / raw)
  To: Linux-kernel

I've been investigating a problem I ran into trying to create partitions
in sector mode and found that the first logical partition can not begin
on the very first sector of the extended partition, immediately
following the EBR.  This apparently is because the kernel creates a dev
node to represent the extended partition and sizes it to two sectors.  I
could have sworn that the kernel did not used to create a device for the
extended partition itself, but I wondered why it was 2 sectors long.  I
found this:

from fs/partitions/msdos.c:

            /* prevent someone doing mkfs or mkswap on an
               extended partition, but leave room for LILO */
            put_partition(state, slot, start, size == 1 ? 1 : 2);

This appears to set the size of the device to 2 sectors, unless the
extended partition is only 1 sector long.  Shouldn't the size be
whatever length there is between the start of the extended partition,
and the first logical partition it contains?  So if there are 63 sectors
there, as is the usual case when using cylinder alignment, then the
device node would expose all of those, but if there is no space, then
the device node should only be 1 sector for the EBR, otherwise it
overlays the first sector of the logical partition.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-04-06 16:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-29 16:11 Extended partition mapping wrong size Phillip Susi
2010-04-06 11:47 ` Karel Zak
2010-04-06 13:58   ` Phillip Susi
2010-04-06 15:33     ` Karel Zak
2010-04-06 16:06       ` Phillip Susi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox