Page 1 of 1

Partitions on large (>2TB) disks

Posted: Sat Nov 24, 2012 9:22 am
by arkady
I'm trying to read (and understand) info about partitions from standard MBR. Each partition entry contains:
1. LBA number of the first sector of that partition
2. size of the partition in sectors
Both are 32-bit values. Let's say we have a 3TB hdd with a 512-byte sector. Is it possible to put two 1.5TB partitions on that disk? First starting, say, at sector 63, second starting at sector 3.220.000.063, both having size of 3.220.000.000 sectors - all number fit in 32-bit values. So the layout would be:

1------------------------------------2----------3------------------------4
where:
1 - is the start of a disk
2 - end of first partition (and the beginning of a second one) - 1.5TB mark
3 - 2TB mark
4 - end of a disk (3TB)

I am aware of 2TB limit for 512-bytes per sector disks but this only limits the starting sector of a partition, right? If a partition starts below 2TB but ends well above that mark is it still OK to put it in a standard (32-bit) MBR?

Re: Partitions on large (>2TB) disks

Posted: Sat Nov 24, 2012 9:39 am
by egos
In theory it's possible but in this case traditional stage 1 boot loaders can't work properly, so I would recommend not to use such disk format with MBR partitioning scheme.

Re: Partitions on large (>2TB) disks

Posted: Mon Nov 26, 2012 2:43 pm
by qw
When you add 1 to 0xffffffff the result does not fit into 32 bits anymore. You can't be sure that the boot loader checks for overflow. It probably doesn't.

Re: Partitions on large (>2TB) disks

Posted: Mon Nov 26, 2012 10:22 pm
by egos
Some stage 1 boot loaders can use 64-bit access, so they will work properly even if a partition (where such boot loader is located) starts at 0xFFFFFFFF.

Re: Partitions on large (>2TB) disks

Posted: Tue Nov 27, 2012 12:08 am
by bewing
Yes. As said above, if you write your own bootloader, it works.

Re: Partitions on large (>2TB) disks

Posted: Thu Nov 29, 2012 12:42 pm
by arkady
So for 512-bytes per sector HDDs and standard MBR there are 2 limitations:
1. max. partition size: 2TB minus 512 bytes
2. max. partitioned space: 4TB minus 1024 bytes?
Plus limitations imposed by a file system. Thanks everyone.

Re: Partitions on large (>2TB) disks

Posted: Thu Nov 29, 2012 12:53 pm
by bluemoon
The maximum size for MBR partitioned disk is defined to be 2TB. While you may exploit up to near 4TB space with non-standard method (as mentioned above), it is unsafe (due to non-standard method being used) and not considered supported.

The proper way is adopt GPT, forget about exploits.