Disk Image Resize

How to manually resize an APFS container or HFS volume

🚧

Quick navigation

Jump to: Image Resize for Intel-based VMs
Overview | Determine Filesystem Type | Resizing APFS Containers | Resizing HFS Volumes

Jump to: Image Resize for Apple ARM-based VMs

📘

Note

Reducing the image size is not supported. An error should be displayed when attempting to do so.

Image Resize for Intel-based VMs

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:

610

Output of diskutil list on APFS filesystem

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

608

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:

596

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:

567

Successful resize on HFS volume

Image Resize for Apple ARM-based VMs

Overview

Resizing an Apple ARM-based VM's disk image is possible by using the command orka image resize. Resizing happens automatically and SSH credentials are not required.

To automatically resize an Apple ARM-based VM's disk, you just need to provide the VM ID and the new image size. The SSH credentials will automatically populate to N/A since they are not required. In this scenario, the Orka API will resize the virtual disk image as well as grow the disk partition to fill the available space.

638

Run orka image resize to resize the image to 200GB

If the resize was successful, once you SSH to the VM,diskutil list should have output similar to what is shown below:

556

200GB M1 disk image after successful resize

📘

IMPORTANT

To use Image Resize with Apple ARM-based VMs you need to use the latest version of Orka VM Tools. It comes out of the box with the latest .orkasi images.

You can also install it manually. For more information, see the downloads page.

📘

IMPORTANT

The image size has a direct effect on the cached images on a node. Read more about ARM Nodes Image Caching to see how image caching works on ARM-based nodes.

Compared to Intel-based VMs, manual disk resize is not supported. Apple ARM-based VMs' disk images have APFS filesystems (similar to Mojave and later), with an additional Apple_APFS_Recovery partition. This recovery partition is the reason why you cannot manually resize the apfs container like you can for Intel disk images.

556

A standard 90GB M1 disk image


© 2019-2023 Copyright MacStadium, Inc. – Documentation built with readme.com. Orka is a registered trademark of MacStadium, Inc.