On 23.05.2011 21:39, Warner Losh wrote: >>> In any event, I'd be tempted to use a #define for 4096 like >>> MBR_MAX_SECTOR_SIZE. >>> >>> -msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX); >>> +msize = MIN(pp->mediasize / pp->sectorsize, 2 * UINT32_MAX); >>> >>> Why this change? I think that it is in two places. >> >> Currently we have limit to msize = UINT32_MAX, but partition in MBR has >> start offset and size (not end offset). Theoretically it can have size >> that is up to UINT32_MAX sectors, also start offset can be UINT32_MAX. >> And for example, for 4T disk we can have 2 partitions with 2TB size. > > Are there any extant examples of this? The CW is that the maximum size for > an MBR device is 2TB.
I tried with 6T md(4) device and it is possible to create 2 partitions
with 2T size, but it is inconvenient to do:
# gpart show md0
=> 1 8589934589 md0 MBR (5.5T)
1 8589934589 - free - (4T)
# gpart add -t freebsd -s 2T md0
gpart: Invalid argument
# gpart add -t freebsd -s `printf %d 0xFFFFFFFE` md0
md0s1 added
# gpart add -t freebsd md0
md0s2 added
# gpart show md0
=> 1 8589934589 md0 MBR (5.5T)
1 4294967294 1 freebsd (2T)
4294967295 4294967295 2 freebsd (2T)
So, i updated the patch and removed this support. Also i removed some
checks that scheme independent code does.
--
WBR, Andrey V. Elsukov
signature.asc
Description: OpenPGP digital signature
