Re: Devices/Partitions over 2TB

From: Andries Brouwer
Date: Thu Mar 17 2005 - 08:10:07 EST


On Mon, Mar 14, 2005 at 10:44:31AM -0600, Berkley Shands wrote:

> With a Broadcom BC4852 and suitable Sata drives, it is easy to create
> functional devices with well in excess of 2TB raw space. This presents a severe
> problem to partitioning tools, such as fdisk/cfdisk and the like as the
> kernel partition structure has a 32 bit integer max for sector counts. Since
> the read_int() function combined with cround() overflows, ...

You should not read fdisk source but think about the DOS-type partition table.
An entry in such a table describes partition start and end in CHS terms
using 24 bits for start and end, and describes partition start and size
in LBA terms using 32 bits for start and size. If you use sectors of size
512, that limits the use of DOS-type partition tables to disks of at most
2^41 bytes, that is, 2 TiB.

What to do afterwards? Last year I made a hack, reserving type 88 hex for
a Linux plaintext partition table. You must be able to find the kernel patch
somewhere on Google, otherwise ask. No fdisk required, the partition table
is just plaintext that you edit using emacs or vi.
The idea here is to use an ordinary DOS-type partition table for the start
of the disk, and let the type 88 partition describe the rest.

There is also the EFI/GPT disk descriptor that is common on IA64, but not much
used elsewhere. Maybe parted supports it.

Andries
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/