Partition size limit on big hard drives

Last modified: Friday December 1st, 2023

From this article, you will find about partition size limit on big hard drives

Introduction

At present, all standard images except CentOS 6.x support booting from a hard disk using a GUID partition table (GPT). This GPT is automatically created by the installimage script and is needed in order to bypass the 2 terabyte partition size limit of the older MS-DOS partition table. You can find information about the MS-DOS partition table on Wikipedia.

Usage of MS-DOS partition table with >2TB drives

CentOS 6 and all older images still use the MS-DOS partition table. To allow the usage of the entire 3 terabytes of the new EX model drives, use the standard partitioning scheme of drives larger than 2 terabytes as follows:

PART swap swap 32G
PART /boot ext3 512M
PART / ext4 1024G
PART /home ext4 all

All other servers continue to use this scheme:

PART swap swap 2G
PART /boot ext3 512M
PART / ext4 all

As partitions may only be a maximum of 2 terabytes in size, the remaining storage space needs to be divided up into the previous partitions. For a 3 terabyte drive, at least 1 terabyte (maximum 2 terabytes) needs to be split into the previous partitions. The following scheme would, therefore, be possible:

PART swap swap 32G
PART /boot ext3 512M
PART / ext4 1024G
PART /var ext4 200G
PART /usr ext4 300G
PART /home ext4 all

With the following scheme, the 3 terabytes were not able to be used completely (as the maximum size for a partition is 2 terabytes (/home)):

PART swap swap 32G
PART /boot ext3 512M
PART / ext4 40G
PART /home ext4 all

The following scheme also shows the 3 terabytes not being fully used:

PART swap swap 32G
PART /boot ext3 512M
PART / ext4 40G
PART /var ext4 100G
PART /usr ext4 200G
PART /home ext4 all

This is due to the structure. The last three partitions (/var, /usr, /home) are created in an extended partition, which in turn can only be a maximum of 2 terabytes in size. As the first 3 partitions do not account for at least 1 terabyte of size, it is not possible to completely use them here either.

In this example, as with the previous one, the installimage script limits the maximum partition size to 2 terabytes.

Another possible solution is LVM. It combines the partitions into one large logical volume.

PART swap swap 32G
PART /boot ext3 512M
PART lvm vg0 1024G
PART lvm vg0 all

LV vg0 root / ext4 all

The downside of this setup is the added complexity.

RAID

The size limit only applies to the partition table. This means that a software RAID Level 5, for example, results in a RAID partition of 4 terabytes over three 2 TB partitions. This is not the case when using a hardware RAID controller. In this case, a partition can only be a maximum of 2 terabytes in size.

Hardware RAID controller

In order to be able to use the full capacity of the drives, you need to create two RAID arrays on the same drives — one RAID for the bootable partition, e.g. 200 GB, and one RAID for the remaining drive space.

Example

For this example, 3 x 3 TB drives in a RAID Level 5 scheme have been used. Two RAIDs need to be created.

  1. One RAID on which the bootable system is to be installed, ~ 200 GB in size.
  2. One RAID which covers the remaining drive space. In this example ~ 5.8 TB in size.

Adaptec Hardware RAID Controller

For the RAID controller to recognize >2 TB drives, the firmware needs to be built 17911 or later. If this is not the case, then please contact our support team.

RAID 5 of 200 GB for the bootable system:

arcconf create 1 LOGICALDEVICE 200000 5 0 0 0 1 0 2 noprompt

RAID 5 of the remainder of the drives:

arcconf create 1 LOGICALDEVICE MAX 5 0 0 0 1 0 2 noprompt

LSI Hardware RAID Controller

RAID 5 of 200 GB for the bootable system:

megacli -CfgLdAdd -r5 [252:0,252:1,252:2] WB ADRA Cached CachedBadBBU -sz200GB -a0

RAID 5 of the remainder of the drives:

megacli -CfgLdAdd -r5 [252:0,252:1,252:2] WB ADRA Cached CachedBadBBU -a0

Installation and Partitioning

Now you can perform installimage. Some adjustment is necessary here: use only /dev/sda for drives; you have to comment out the other(s) using #. And you need to switch off Software RAID (set to 0).

After installing the operating system, you can create a partition on the second RAID so that you can use it. Use GPT partition table here instead of the MS-DOS partition table; that enables > 2 TB partitions.

  • gdisk /dev/sdb
  • n for new partition
  • With Enter, accept the default value for the partition number.
  • With Enter, accept the default value for the partition start.
  • Similarly with Enter, accept the default value for the partition end.
  • Enter the hex code for the partition data type (0700 for Linux/Windows data).
  • Finally, with w, save the amendments.

You can now format the partition:

mkfs.ext4 /dev/sdb1

Finally, you need to edit the file /etc/fstab with the following entry:

/dev/sdb1  /mnt  ext4  defaults  0  1
Was this article helpful?
Views: 206

10 Years Beehosting!
Celebrate with 70% OFF + FREE Site Transfer.

Facebook Instagram linkedin

Beehosting.pro website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Menu