Install CentOS onto large partitions using GPT disk layout

Posted in January 2012 by under sysadmin

It has been a while since I installed CentOS onto a server with very large disks and I had forgotten how frustrating it was to achieve this.

I actually had two servers to build. Both were identical. They contain 16 x 750GB SATA drives in hardware RAID, providing one block device of ~ 10.5 TB as /dev/sda.

The first problem with the installation is that you cannot create a partition over 2TB on an msdos partition table.

The second problem is you cannot use the partitioning tool on the CentOS installer to use anything other than msdos partition tables and the only other tool on the installation media is fdisk which cannot handle partitions larger that 2TB either.

The next issue is that CentOS ships with GRUB 0.97 without support for GPT partition tables.

And even if you can get past these problems, you cannot install CentOS onto GPT disks after CentOS 5.0.

So here is how you work around these problems and force CentOS onto your server.

1. Download SystemRescueCD

2. Boot from the SystemRescueCD and use parted to change the partition layout from msdos to GPT and create your partitions.

Use this guide if you need detail on how to do that. I partitioned my drive as:

GNU Parted 1.8.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print

Model: LSI MegaRAID 84016E (scsi)
Disk /dev/sda: 10.5TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number       Start     End       Size   File system        Name  Flags
 1          17.4kB  3072MB     3072MB   ext3               boot
 2          3072MB  13.0GB     9928MB   linux-swap
 3          13.0GB  20.0GB     7000MB   ext3
 4          20.0GB  10.5TB     10.5TB   ext3


3. Create the filesystems on each partiton using mkfs on SystemRescueCD. You will not be able to format large partitions using the Anaconda installer in CentOS. See the man page for details on how to do this.

4. Download CentOS 5.0. I spent a whole day trying to figure out why the second server wouldn’t install until finally I tried the 5.0 CDs and found that they worked fine. It is getting harder to find CentOS 5.0 installation media and the previous link I had is now broken too.

5. Install CentOS 5.0 onto the server. When it comes to disk partitioning select “Use existing partitions”. Do not select to format the partitions. Anaconda will fail to format the large partitions.

6. Install just the minimal package selection. You can install other software later.

7. Once the OS is installed shut down the server and boot again from the SystemRescueCD and install a patched verion of GRUB 0.97 with support for GPT partition layouts.

You can follow this guide if you need more information, the details are near the end of the page.

8. Reboot the server and you should now be running CentOS 5.0. Use yum to upgrade the OS to the latest release.

9. Now you can install your required applications.

If you have any problems, please do not hesitate to post a comment asking for help and I will do my best to assist.