Hi,
I'm having some trouble using the space of a disk volume that has recently grown in size.
First, create a single partition (of full size) on the regular disk. GPT shows the following:
$ sudo gpt -r -v show /dev/disk2
gpt show: /dev/disk2: mediasize=320072907264; sectorsize=512; blocks=625142397
start size index contents
0 1 PMBR
1 1 Pri GPT header
2 32 Pri GPT table
34 6
40 409600 1 GPT part - C12A7328-F81F-11D2-BA4B-************
409640 624470576 2 GPT part - 48465300-0000-11AA-AA11-************
624880216 262148
625142364 32 Sec GPT table
625142396 1 Sec GPT header
Now, if we unmount that drive, expand the volume externally and remount with the increased size - we can read/write to the drive as normal and the disk appears as follows:
$ sudo gpt -r -v show /dev/disk2
gpt show: /dev/disk2: mediasize=640145816064; sectorsize=512; blocks=1250284797
start size index contents
0 1 PMBR
1 1 Pri GPT header
2 32 Pri GPT table
34 6
40 409600 1 GPT part - C12A7328-F81F-11D2-BA4B-************
409640 624470576 2 GPT part - 48465300-0000-11AA-AA11-************
624880216 625404548
1250284764 32 Sec GPT table
1250284796 1 Sec GPT header
However, if we compare the raw GPT Partition table header using DD, the values are the same in both the small and large drive sizes. ie. the header doesn't appear to be re-written based on the size of the new drive.
Looking at disk utility, it shows the volume increase and allows you to add another partition to the drive. If we try to create an extra partition in that space though, it shows the error:
"Partition failed for disk disk2s3 The chosen size is not valid for the chosen filesystem.x".
The UEFI 2.1 spec says the following on volume expansion:
"Software must update the backup GUID Partition Table before the primary GUID Partition Table, so if the size of
device has changed (e.g. volume expansion) and the update is interrupted, the backup GUID Partition Table is in the proper location on the disk.
If the primary GUID Partition Table is valid and the backup GUID Partition Table is invalid software must restore the backup GUID Partition Table.
Both the primary and backup GUID Partition Tables must be valid before an attempt is made to
grow the size of a physical volume. This is due to the GUID Partition Table recovery scheme
depending on locating the backup GUID Partition Table at the end of the physical device. A volume
may grow in size when disks are added to a RAID device. As soon as the volume size is increased
the backup GUID Partition Table must be moved to the end of the volume and the primary and
backup GUID Partition Table Headers must be updated to reflect the new volume size."
So, is this a bug in the implementation of GPT, or am I doing something wrong?
Thanks,
Andy