Guides
GuidesAPI ReferenceJoin the Mailing ListMake a Suggestion

Disk Image Resize

How to manually resize an APFS container or HFS volume

🚧

Intel Nodes Only

This guide is applicable to VMs deployed on Intel nodes only. Read more about Apple ARM-based Support (Beta) to see which commands and options are supported for VMs deployed on Apple ARM-based nodes.

🚧

Quick navigation

Jump to: Overview | Determine Filesystem Type | Resizing APFS Containers | Resizing HFS Volumes

Overview

When resizing a disk image using the command orka image resize, you have two options:

  1. Automatic Resize: Provide SSH credentials for the VM along with the new image size. In this scenario, the Orka API will resize the virtual disk image as well as growing the disk partition to fill the available space.
  2. Manual Resize: Provide only the new image size. If you choose not to provide SSH credentials (or SSH is not enabled in the VM) then you will need to manually resize the disk partition using the instructions below.

Determine Filesystem Type

In order to manually resize the disk partition, you must first determine the filesystem type used by macOS. Establish an SSH connection to the VM or connect via VNC and open Applications -> Utilities -> Terminal. Run the command diskutil list to determine the filesystem type.

For APFS filesystems (Mojave and later) you should see output similar to the following:

610610

Output of diskutil list on APFS filesystem

For HFS filesystems (High Sierra and earlier) you should see output similar to the following:

608608

Output of diskutil list on HFS filesystem

πŸ“˜

IMPORTANT

Note the identifier for the container (APFS) or volume (HFS) in the output seen from diskutil list. In the example above, the APFS container is located on disk1 with identifier disk1s2 and the HFS volume is located on disk1 with identifier disk1s2. The disk and identifier will be needed in the next step.

Resizing APFS Containers

In order to resize an APFS container, run the following commands using the appropriate disk name and identifier from the previous step:

diskutil repairDisk disk1
diskutil apfs resizeContainer disk1s2 0

If the resize was successful, you should see the tail of the output similar to what is shown below:

596596

Successful resize on APFS container

Resizing HFS Volumes

In order to resize an HFS volume, run the following commands using the appropriate disk name and identifier from the previous step:

diskutil repairDisk disk1
diskutil resizeVolume disk1s2 R

If the resize was successful, you should see the tail of the output similar to what is shown below:

567567

Successful resize on HFS volume


Did this page help you?

Β© 2019-2020 Copyright MacStadium, Inc. – Documentation built with readme.io. Orka is a registered trademark of MacStadium, Inc.