Hetzner - DokuWiki

Partitionsgrößenlimit bei großen Festplatten/en

Inhaltsverzeichnis

General Information

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. Information about the MS-DOS partition table may be found in Wikipedia.

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 the standard partitioning scheme of drives larger than 2 Terabytes is 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 ensuing 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 exploited:

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, complete usage is not possible 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 the usage of 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 sofware 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 a RAID array has to be created twice 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, ca. 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 build 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

General details are available here: Adaptec RAID Controller

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

General details are available here: LSI RAID Controller

Installation and Partitioning

Now installimage can be performed. Some adjustment is necessary here: only /dev/sda is used for drives, the other(s) have to be commented out using #. Software RAID also needs to be switched off (set to 0).

After installing the operating system, a partition can be created on the second RAID so that this can be used. Here a GPT partition table is used instead of the MS-DOS partition table which enables > 2 TB partitions. These steps can be performed in the Rescue System.

  • 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)
  • with w finally save the amendments.

The partition can now be formatted:

mkfs.ext4 /dev/sdb1

Finally, the file /etc/fstab needs to be edited with the following entry:

/dev/sdb1  /mnt  ext4  defaults  0  1

Background

The installimage script uses the MS-DOS partitioning scheme. This partitioning scheme is only in a position to manage drives of up to 4 Terabytes in size and partitions of up to a maximum of 2 Terabytes. The technical reasons for this limitation may be read in Wikipedia.



© 2018. Hetzner Online GmbH. Alle Rechte vorbehalten.