I have a mac running in a virtual machine and I expanded the hard drive in the settings, however when I go to resize the partition in the guest OS, it does not let me. There is only one partition now, the main one I want to expand, and then just "Free Space".

  • It is a GUID partition map and PCI physical volume.
  • Using Disk Utility I can't drag to resize the volume I want to modify
  • If I delete the "Free Space", I get this error: "An internal error has occurred and the disk for one of the specified operations could not be found. This may be a temporary issue, try again."

This issue persists after a reboot and using recovery mode on High Sierra 10.13.5


Solution 1:

Solved this by first going into the terminal and finding the disk identifier:

diskutil list

Then, with the identifier I used the following and it successfully reclaimed all of the disk free space:

diskutil resizeVolume /dev/disk0s2 0

Be sure to replace /dev/disk0s2 with the identifier of the partition you want to expand.

Solution 2:

Thanks to Michael. I was trying to repartition macbook air the 2nd time for Windows 10 installation. During USB disk bootup, the setup process didn't allow to install on the partition already created and reported "The selected disk is of the GPT partition style." Then inside that Windows setup, I tried formate, delete, create new on that free space w/o success. So I jumped out and back to macOS to check and fix whatever blocked my way. The "Disk Utility" kept reporting "An internal error has occurred and the disk for one of the specified operations could not be found." if I want to delete the free space partition. Eventually Michael's commands saved my life even though my partitions are APFS format with High Sierra 10.13.6. Below are the screenshot before the fix and Terminal details of the process. Hope they help.

First to check what disk identifier needed to expand by command. Mine happened to be the same with Michael (disk0s2). Don't copy paste the ID. enter image description here

$ diskutil list
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *121.3 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                 Apple_APFS Container disk1         81.0 GB    disk0s2

/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +81.0 GB    disk1
                                 Physical Store disk0s2
   1:                APFS Volume HighSierra           60.1 GB    disk1s1
   2:                APFS Volume Preboot                 20.3 MB    disk1s2
   3:                APFS Volume Recovery                519.0 MB   disk1s3
   4:                APFS Volume VM                      1.1 GB     disk1s4

/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *16.0 GB    disk2
   1:                 DOS_FAT_32 WININSTALL              16.0 GB    disk2s1

Since my partitions have changed to APFS so it responses error.

$ diskutil resizeVolume /dev/disk0s2 0
/dev/disk0s2 is an APFS Physical Store (use "diskutil apfs resizeContainer" instead to resize)

After a minor modification it finished and Disk Utility is happy.

$ diskutil apfs resizeContainer disk0s2 0
Started APFS operation
Aligning grow delta to 40,091,033,600 bytes and targeting a new physical store size of 121,123,069,952 bytes
Determined the maximum size for the targeted physical store of this APFS Container to be 121,122,041,856 bytes
Resizing APFS Container designated by APFS Container Reference disk1
The specific APFS Physical Store being resized is disk0s2
Verifying storage system
Using live mode
Performing fsck_apfs -n -x -l /dev/disk0s2
Checking volume
Checking the container superblock
Checking the EFI jumpstart record
Checking the space manager
Checking the object map
Checking the APFS volume superblock
Checking the object map
Checking the fsroot tree
Checking the snapshot metadata tree
Checking the extent ref tree
Checking the snapshots
Checking the APFS volume superblock
Checking the object map
Checking the fsroot tree
Checking the snapshot metadata tree
Checking the extent ref tree
Checking the snapshots
Checking the APFS volume superblock
Checking the object map
Checking the fsroot tree
Checking the snapshot metadata tree
Checking the extent ref tree
Checking the snapshots
Checking the APFS volume superblock
Checking the object map
Checking the fsroot tree
Checking the snapshot metadata tree
Checking the extent ref tree
Checking the snapshots
Verifying allocated space
The volume /dev/disk0s2 appears to be OK
Storage system check exit code is 0
Growing APFS Physical Store disk0s2 from 81,032,036,352 to 121,123,069,952 bytes
Modifying partition map
Growing APFS data structures
Finished APFS operation

The title of the question gets a typo "rezize" but I was still led to here by search engine.