TransWikia.com

Can't resize APFS container

Ask Different Asked by Andriy on November 28, 2021

On a 120GB SSD hard drive in a MacBook only 68.68GB are available. The missing 51.32GB are not even shown as a free space.

Here is what the output of Disk Utility looks like:
disk0

disk1

disk1s1

terminal screen

As you can see on the first screenshot the disk has 120GB. However, the partition chart on the same screenshot only shows 68.7GB. Also the other two screenshots show that only 68.7GB out of 120GB seem to be available.

The command diskutil list shows that the physical disk0 is 120GB big, but the synthesized disk1 only 68.7GB:

disk info

3 Answers

Just for the record. I've managed to increase the size of my APFS volume using GParted and Disk Utility (from macOS Catalina).

  1. Create a GParted USB drive and boot from it
  2. Use GParted to move the APFS partition/container around so that the free space appears directly AFTER the APFS partition.
  3. Boot into Mac Recovery mode and open Disk Utility
  4. Click the drop-down in the top left and enable "Show All Devices"
  5. Select your SSD (top entry)
  6. Click "Partition"
  7. Somewhat unintuitive, but now select the "Free Space" area and click the "-" button below. This will "remove" the free space and enlarge the APFS container to fill it.
  8. Confirm the dialog and the resizing should start.
  9. Done.

Answered by mbirth on November 28, 2021

First of all - want to say "Thanks a lot" to @David Anderson, with his help i have resolved my issue: 1. Enter Internet Recovery Mode - restart you mac and hold alt + cmd + r ; 2. Open "Disk Utility" from the macOS Utilities window; 3. Erase the Macintosh HD in the Container disk1; 4. Erase the top hard drive "ADATA SP580 Media" (APPLE SSD); 5. Close the Disk Utility window and choose "Reinstall macOS" from the macOS Utilities window - follow the instructions

PS. If you want to save your data - you need to make a Time Machine backup before

Answered by Andriy on November 28, 2021

Below is the offsets and sizes of the two partitions on the drive.

The offset of disk0s1 is 409,600 bytes.
The size of disk0s1 is 209,715,200 bytes.

The offset of disk0s2 is 51,351,912,448 bytes.
The size of disk0s2 is 68,682,190,848 bytes.

Using the above data, the space between the partitions can be computed, as shown below.

(size of disk0s2) - (size of disk0s1) - (offset of disk0s1)
= 51,351,912,448 bytes - 209,715,200 bytes - 409,600 bytes
= 51,141,787,648 bytes (approximately 51.1 GB)

The command given below adds free space found immediately after disk0s2 back to the APFS container inside the partition.

diskutil apfs resizeContainer disk0s2 0

Since the 51.1 GB of free space occurs immediately before disk0s2, the command given above will not be able to return this free space back to the APFS container.

The easiest course for action would be to backup, erase the drive and reload. While it may be possible to use macOS to fix the drive without using a backup, this would require creating two APFS containers on the same drive. Apple did not design macOS to handle multiple APFS containers on the same drive and should only be attempted by advanced users.

Another possible solution would be to use third party software to move the APFS container partition (disk0s2). One possible pay utility is offered by Paragon. The free GNOME Partition Editor (GParted) utility reports being able to move APFS partitions.

How to Create a GParted Bootable Flash Drive

Note: The operating system was macOS High Sierra Version 10.13.6

  1. Download the gparted-live-0.33.0-2-amd64.zip file. I assume this file will download to your Downloads folder. After the download completes, the zip file will be automatically convert to a folder named gparted-live-0.
  2. Use the Disk Utility application to erase a 500 MB or larger flash drive. Select the options shown below.

    t1

  3. Using the Finder application, open the folder named gparted-live-0. The contents are shown below. Use the Finder application to copy the contents to the flash drive.

    t2

How to Boot from a GParted Flash Drive

Note: This was tested using an iMac (21.5 inch, Late 2013) with the latest firmware updates installed.

  1. Insert the flash drive in a USB port on the Mac.
  2. Restart the Mac and immediately hold down the option key.
  3. When the Startup Manager icons appears, choose the external drive icon labeled EFI Boot.

When prompted, I choose the default startup option.

Answered by David Anderson on November 28, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP