いやー久々にハマった
状況
今まで2TBのHDDで運用してきたが、単価も安くなってきたので今回4TBのHDDを購入。例のクローン機能を使って無事にコピーまではできたが、いざディスクの拡張でコケる。
パーティションを 1.82 TiB から 3.64 TiB に拡大する 00:00:00 ( エラー )
以前の開始位置: 2048
以前の終了位置: 3907024064
以前の容量: 3907022017 (1.82 TiB)
要求された開始位置: 2048
要求された終了位置: 7814035455
要求された容量: 7814033408 (3.64 TiB)
libparted のメッセージ ( 情報 )
partition length of 7814033408 sectors exceeds the msdos-partition-table-imposed maximum of 4294967295
sectors exceeds the msdos-partition-table-imposed maximum of 4294967295ってアーーーーーー
解決策
どうもこうもMS-DOSパーティンションテーブルは2TBが限界らしい。ってことで2TB以上対応してるのはGPTというパーティンションテーブルで、それに変換することにした。
最初HDDの中身も飛ぶのかと思ったがそんなことはなかった。オプションで-gをつけるだけ
-g, --mbrtogpt
Convert an MBR or BSD disklabel disk to a GPT disk. As a safety measure, use of this
option is required on MBR or BSD disklabel disks if you intend to save your changes,
in order to prevent accidentally damaging such disks.
恐る恐るやってみよう
# sgdisk -g /dev/sdc *************************************************************** Found invalid GPT and valid MBR; converting MBR to GPT format in memory. *************************************************************** The operation has completed successfully.
ビビるぐらい一瞬だった。
間違ってgdiskコマンドで-gするとMBRに書き換えるとかいう罠があるので注意
man gdiskより、
g Convert GPT into MBR and exit.
オプション統一しろよ(
教訓
身の丈にあった容量を買え