How to Fix: APFS undeclared deleted space and underallocation error
APFS undeclared deleted space and underallocation error fix
📋 Table of Contents
The APFS (Apple File System) undeclared deleted space and underallocation error is a common issue affecting macOS users who have upgraded to 10.13 or later. This error occurs when the system fails to properly free up disk space after deleting files, resulting in an underallocation of the device's capacity.
This problem can be frustrating for users like you who rely on their main machine and cannot afford to format back to HFS+. In this guide, we'll walk you through the root causes and provide two methods to fix this issue.
🔍 Why This Happens
- The primary reason for this error is that APFS uses a feature called 'sparse allocation' which can lead to underallocation issues. When files are deleted from an APFS volume, the system does not immediately free up the space allocated to those files. Instead, it waits for the next time the file is accessed or modified, at which point the system will attempt to reclaim the space.
- Another possible cause is that the system's disk cache may be causing issues. When files are deleted from an APFS volume, they may not be immediately removed from the cache, leading to underallocation errors.
🔧 Proven Troubleshooting Steps
Reclaiming Space Using Disk Utility
- Step 1: Open Disk Utility and select the main device that's showing the underallocation error. Click on 'First Aid' in the top menu bar.
- Step 2: Click on 'Scan Disk' to start the scan process. This may take several minutes depending on the size of your hard drive.
- Step 3: Once the scan is complete, click on 'Repair' and follow the prompts to repair any disk errors.
Using fsck_apfs to Reclaim Space
- Step 1: Open Terminal and type `sudo fsck_apfs -f /dev/disk0s3` (replace `/dev/disk0s3` with the actual device name of your main drive). Press enter to run the command.
- Step 2: Once the command is executed, you may need to manually repair any errors that were found. Type `sudo fsck_apfs -r` to start the repair process and follow the prompts.
🎯 Final Words
Fixing the APFS undeclared deleted space and underallocation error requires patience and persistence. By following these steps, you should be able to reclaim the lost space and resolve this issue. If you're not comfortable with these methods or if the problem persists after trying them, it may be worth considering formatting back to HFS+ as a last resort.
❓ Frequently Asked Questions
🛠️ Related Fixes
How to Fix: Pc crashes shortly after launching game (rainbow
Fix Pc crashes shortly after launching game (rainbow six siege). Compl
How to Fix: Installing an APK on a locked down phone
Installing an APK on a locked down phone: Try using a rooted device, e
How to Fix: New PC build- no signal and no clue
Fix New PC build- no signal and no clue. Complete troubleshooting guid