LinuxでGPTパーティションテーブル自体のサイズを変更するには?

LinuxでGPTパーティションテーブル自体のサイズを変更するには?

私はdd

しかし、GPTのサイズはまだ1GBです。たとえば、セカンダリ(バックアップ)GPTはまだ1 GBです(ディスクの最後に移動する必要があります)。

私もそう感じる2つのフィールドデフォルトのGPT内部(オフセット32と48)を更新する必要があります。

調べましたが、gdisk何も見つかりません。

ベストアンサー1

使用例gdisk:

# gdisk /dev/yourdisk
Command (? for help): v

Problem: The secondary header's self-pointer indicates that it doesn't reside
at the end of the disk. If you've added a disk to a RAID array, use the 'e'
option on the experts' menu to adjust the secondary header's and partition
table's locations.

Identified 1 problems!

gdiskx使い方が多少難解かもしれませんが、エキスパートメニュー(、)を介してこの問題を解決する方法を直接お知らせしますe

Command (? for help): x

Expert command (? for help): ?
e   relocate backup data structures to the end of the disk

Expert command (? for help): e
Relocating backup data structures to the end of the disk

この時点でパーティションを調整したり、直接作成することができます。

Expert command (? for help): v

No problems found. 15624933 free sectors (7.5 GiB) available in 1
segments, the largest of which is 15624933 (7.5 GiB) in size.

Expert 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) to /dev/yourdisk.

partedまた、動作し、コマンドを使用するときに変更するように求められます。

# parted /dev/yourdisk print
Warning: Not all of the space available to /dev/yourdisk appears to be used, 
you can fix the GPT to use all of the space (an extra 13671875 blocks)
or continue with the current setting?
Fix/Ignore?

fdiskGPTは書き込みによってサイズ変更されます。

# fdisk /dev/yourdisk

Welcome to fdisk (util-linux 2.39.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

GPT PMBR size mismatch (1953124 != 15624999) will be corrected by write.
The backup GPT table is not on the end of the device. This problem will be corrected by write.

Command (m for help): w

The partition table has been altered.
Calling ioctl() to re-read partition table.

おすすめ記事