3TB harddrives and Linux

I recently bought two Seagate Barracuda 7200 3000GB (SATA 6Gb/s) drives to be used in a Linux software RAID. I knew I had to be careful because of the Advanced Format (AF) layout used by these new drives. Turns out that this wasn’t the only thing that one has to keep in mind when dealing with such drives – GPT BIOS boot partition, anyone?

Advanced Format:
Usually hard drives internally used 512 byte sectors and reported this back to the operating system which could then align partitions and optimize reads/writes accordingly. In recent years drives with a 4KB sector size started to ship – which caused problems for systems that couldn’t deal with 4KB sector sizes as reported by the disks. Therefore vendors decided to use 4KB sector sizes internally and report back 512 byte sectors to the OS in order to support legacy configurations.
Sounds good, but there is a drawback: Filesystems usually store data in clusters consisting of multiple sectors. Now, when the OS is not aware of the disks internal 4KB sector size it’s possible (and even likely) that multiple disk sectors have to be read or written for a single request that could otherwise be dealt with with a single read or write action as the cluster now partially spans over multiple physical sectors. This has a huge performance impact.
Therefore it’s important to align partitions to the physical layout which can be done using the “parted” tool. Western Digital (WD) has a description of this process in their knowledge base.

GUID Partition Table (GPT):
As the usual MBR partition table is limited to disk sizes of about 2 TB another partition table format has to be used: GPT
Sounds nice, is supported mostly out of the box (e.g. “parted” instead of “fdisk”), native in the Debian installer and has no drawbacks..
BUT – we want to boot from a drive with GPT. The grub installation helpfully reported a problem:

warn: This GPT partition label has no BIOS Boot Partition; embedding won’t be possible!

I first thought I had to look for an EFI-capable grub (grub-efi) but the solution was much easier: I had overlooked that GPT specifies a small partition called “BIOS Boot partition” that is a requirement if one wants to use a bootloader on a GPT partition. There are some workarounds (hacks), but the best way is to create such a boot partition. 1 MB is probably enough; just make sure to toggle the “bios_grub” GPT flag on that partition.
That’s it, no more grub warnings – and it really boots.
(I have to admit this had cost me some hours even though the error message is more or less self-explanatory – at least when one knows what it is all about)

Comments are closed.