Hardware, HowTo’s, and the Haps of a Texan!

Kevin Blalock

September 12, 2008

Creating GPT Partitions

No Gravatar

I have run into an issue where I needed to boot off of a partition larger than 2 TB, which was created as a hardware RAID 5 array. Here is the problem, the partition end’s up being a GPT partition and you cannot boot off of a GPT partition. So, after carving out a decently sized boot volume in the RAID card’s BIOS; I was able to install Debian on a much smaller partition. Later I mounted the second volume being the rest of the array for typical storage duties.

Since I used four 750 GB drives in a RAID 5 array, this leaves me with roughly 2.25 TB of storage. I carved out 5gb for my boot volume to install Debian onto, leaving me with over 2TB on the secondary volume.

The typical partitioning tools in linux (fdisk, cfdisk, etc) do not know how to deal with partitions on devices larger than 2 TB, so we must use a tool called parted.

First, we must assign a drive label our device. I will call it “gpt”, and I will assume the device is located at /dev/sdb

parted /dev/sdb mklabel gpt

Now, let’s get the size of the device.

parted /dev/sdb print

Partition the device with the size you want. I will be using the full size (from our last command), as well as making it a primary partition. I am starting at 0 and ending at 2245GB.

parted /dev/sdb mkpart primary 0 2245GB

Now, we can format the partition. Be advised, formatting a partition that is 2TB and larger takes quite some time. Even if this was a RAID 0 array, it would still take a good while. This operation took nearly an hour to complete. If this was software raid, it would take tremendously longer! I will be using ext3 for this setup.

mkfs.ext3 /dev/sdb1

After the partition is formatted, you should be able to mount the file system!

Leave a Reply