Disk Utility hangs after adding a partition with gpt; diskutil still works just fine

disk-utilitypartition

I'm trying to shrink my Time Machine partition to make more space for Windows games. The shrink went perfectly, but I was left with a chunk of free space Disk Utility wouldn't let me make a partition in. I would have to delete the free space and make a new partition.

I couldn't figure out how to get it to not resize my Time Machine partition again, and diskutil doesn't seem to be able to create new partitions from scratch, only split and merge them. So I turned to gpt using this answer.

After running gpt add -b 1739919576 -s 88606504 -t hfs disk2, Disk Utility could see the new empty partition just fine. Then I tried to delete the partition after it (it was 500MB with nothing on it), and resize the new one to compensate. Then Disk Utility hung on "Waiting for partitions to activate". I force quit it, which in retrospect was a pretty stupid idea.

Now I can use diskutil and gpt just fine, but when I open Disk Utility it just hangs immediately. Any ideas?


Before:

/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.0 TB     disk2
   1:                        EFI EFI                     209.7 MB   disk2s1
   2:          Apple_CoreStorage SG-1                    400.0 GB   disk2s2
   3:                 Apple_Boot Boot OS X               134.2 MB   disk2s3
   4:          Apple_CoreStorage SG-1_TM                 490.4 GB   disk2s4
   5:                 Apple_Boot Boot OS X               134.2 MB   disk2s8
   6:                  Apple_HFS tmp                     500.2 MB   disk2s6
   7:       Microsoft Basic Data WTransfer               63.2 GB    disk2s7
       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-00A0C93EC93B
      409640   781240488      2  GPT part - 53746F72-6167-11AA-AA11-00306543ECAC
   781650128      262144      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
   781912272   957745160      4  GPT part - 53746F72-6167-11AA-AA11-00306543ECAC
  1739657432      262144      5  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
  1739919576    88868648         
  1828788224      976896      6  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
  1829765120   123496448      7  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
  1953261568      263566         
  1953525134          32         Sec GPT table
  1953525166           1         Sec GPT header

Current state:

/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.0 TB     disk2
   1:                        EFI EFI                     209.7 MB   disk2s1
   2:          Apple_CoreStorage SG-1                    400.0 GB   disk2s2
   3:                 Apple_Boot Boot OS X               134.2 MB   disk2s3
   4:          Apple_CoreStorage SG-1_TM                 490.4 GB   disk2s4
   5:                 Apple_Boot Boot OS X               134.2 MB   disk2s5
   6:       Microsoft Basic Data WTransfer               63.2 GB    disk2s6
   7:                  Apple_HFS                         45.4 GB    disk2s7
gpt show: disk2: mediasize=1000204885504; sectorsize=512; blocks=1953525167
gpt show: disk2: PMBR at sector 0
gpt show: disk2: Pri GPT at sector 1
gpt show: disk2: Sec GPT at sector 1953525166
       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-00A0C93EC93B
      409640   781240488      2  GPT part - 53746F72-6167-11AA-AA11-00306543ECAC
   781650128      262144      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
   781912272   957745160      4  GPT part - 53746F72-6167-11AA-AA11-00306543ECAC
  1739657432      262144      5  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
  1739919576    88606504      7  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
  1828526080     1239040         
  1829765120   123496448      6  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
  1953261568      263566         
  1953525134          32         Sec GPT table
  1953525166           1         Sec GPT header

Update

Deleting the new partition, rebooting, and creating a new partition exactly filling the available space (taking into account the necessary 262144-sector gaps) fixed the problem…until I tried to resize a partition again. When I tried to delete the partition after the new one and again grow it to fit, it got stuck again on "Waiting for partitions to activate".

I ran a diskutil list, which seemed to indicate the operation succeeded and the partition had been properly grown. So I ran diskutil eject disk2, which worked fine. Then I force-quit Disk Utility, and strangely, it seemed to have no adverse effects. It didn't hang when I opened it again.

Best Answer

It turns out deleting the new partition, rebooting, and creating a new partition exactly filling the available space (taking into account the necessary 262144-sector gaps) fixed the problem. It's working perfectly now.

I'm not quite sure which of these were necessary, but hopefully this will help if someone else has the same issue.