Skip to content

Instantly share code, notes, and snippets.

@varahash
Created November 15, 2020 15:08
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save varahash/9fc02e5b88c3259796e7b740b1963202 to your computer and use it in GitHub Desktop.
Save varahash/9fc02e5b88c3259796e7b740b1963202 to your computer and use it in GitHub Desktop.
Repair APFS 'warning: overallocation detected on Main device'
1. Boot into Recovery mode (by pressing CMD+R while boot macOS)
2. Unmount APFS volumes automaticaly mounted by Recovery (where /dev/disk2 is your APFS container)
$ diskutil unmountDisk /dev/disk2
Unmount of all volumes on disk2 was successful
3. Unlock APFS volumes (in case FileVault enabled for this volume)
$ diskutil apfs unlockVolume /dev/disk2s1 -nomount
Passphrase: <enter password here>
Unlocking any cryptographic user on APFS Volume disk2s1
Unlocked but did not mount APFS Volume
3.1. To verify that volume unlocked (look for "Yes (Unlocked)"):
$ diskutil apfs list
...
| +-> Volume disk2s1 73D0148D-36A2-429D-AE11-8FFB7E89EED7
| ---------------------------------------------------
| APFS Volume Disk (Role): disk2s1 (Data)
| Name: BigSur - Data (Case-insensitive)
| Mount Point: Not Mounted
| Capacity Consumed: 349155135488 B (349.2 GB)
| Sealed: No
| FileVault: Yes (Unlocked)
...
4. Run APFS repair command
$ fsck_apfs -oys /dev/disk2
...
warning: overallocation detected on Main device: (0x128e04+1) bitmap address (0x7c93d)
Fix overallocation (0x128e04+1) bitmap address (0x7c93d)? YES
...
** The volume /dev/disk2 appears to be OK.
@dannythunder
Copy link

Thanks for this! Helped me get back 200GB ❤️

@K41680
Copy link

K41680 commented Jun 20, 2023

Thanks for the guide!
It gave me the possibility to reformat my hdd to secure my 5-booting drive!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment