Partitions on large (>2TB) disks

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
arkady
Posts: 17
Joined: Wed Jan 02, 2008 3:14 pm
Location: Poland

Partitions on large (>2TB) disks

Post 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?
Last edited by arkady on Sat Nov 24, 2012 10:11 am, edited 1 time in total.
egos
Member
Member
Posts: 612
Joined: Fri Nov 16, 2007 1:59 pm

Re: Partitions on large (>2TB) disks

Post 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.
If you have seen bad English in my words, tell me what's wrong, please.
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: Partitions on large (>2TB) disks

Post 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.
egos
Member
Member
Posts: 612
Joined: Fri Nov 16, 2007 1:59 pm

Re: Partitions on large (>2TB) disks

Post 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.
If you have seen bad English in my words, tell me what's wrong, please.
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: Partitions on large (>2TB) disks

Post by bewing »

Yes. As said above, if you write your own bootloader, it works.
arkady
Posts: 17
Joined: Wed Jan 02, 2008 3:14 pm
Location: Poland

Re: Partitions on large (>2TB) disks

Post 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.
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: Partitions on large (>2TB) disks

Post 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.
Post Reply