2TBの壁を超えてWesternDigitalの3TBのHDDをLinux上で使ったときに性能劣化なく動作させる方法

WesternDigital の大容量HDDは安価で消費電力が低く、温度も低めということで使われる方も多いかと思いますが、ちょっと気をつけないとハマる罠がありました。

parted でGPTパーティションを作成し、mkfs で ext4 にフォーマットすれば使えるは使えるんですが、parted は

警告: The resulting partition is not properly aligned for best performance.

と言ってくるし、ディスク・ユーティリティ(Palimpsest)からフォーマットしたパーティションを見ると

WARNING: The partition is misaligned by 3072 bytes. This may result in very poor performance. Repartitioning is suggested.

と。つまり、アラインメントがよろしくないので速度出ないよ!!ってことですね。これを回避するためには、gdisk コマンドを使います。yum で入れられるのであらかじめ

# yum install gdisk

しておいて、

# gdisk /dev/sdc
GPT fdisk (gdisk) version 0.8.2

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): i
No partitions

Command (? for help): n
Partition number (1-128, default 1):
First sector (34-5860533134, default = 40) or {+-}size{KMGTP}:
Last sector (40-5860533134, default = 5860533134) or {+-}size{KMGTP}:
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300):
Changed type of partition to 'Linux filesystem'

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): Y
OK; writing new GUID partition table (GPT).
The operation has completed successfully.

な感じですね。あとは mkfs で ext4 なりお好みのフォーマットでどうぞ。

参考: