Introduction
This article focuses on troubleshooting an issue where an erased doc-id record exists on an APFS-formatted SSD, causing Disk Utility in macOS Monterey to report an error. We will cover the key concepts of this issue, provide solutions, and offer references for further reading.
Issue Description
When using Disk Utility in macOS Monterey to check or repair an APFS-formatted SSD, an error message might appear, stating:
error: doc-id tree: record exists (doc-id 4838, file-id 147794278)
This error message indicates that there is a discrepancy between the metadata on the SSD and the information that Disk Utility expects. In this specific case, the doc-id record with the ID 4838 still exists, even though it should have been erased.
Possible Causes
There are several reasons why this issue might occur:
-
A previous disk repair or erase operation did not complete successfully.
-
The SSD has encountered physical damage or corruption.
-
The APFS file system has become corrupted.
Solutions
Solution 1: Repair the Disk
The first step to resolve this issue is to attempt a repair of the APFS-formatted SSD using Disk Utility:
-
Restart your Mac and hold down the Command + R keys to enter Recovery Mode.
-
Once in Recovery Mode, select Disk Utility from the Utilities menu.
-
Find the affected APFS-formatted SSD in the list of disks, then click the "First Aid" tab.
-
Click the "Repair Disk" button and wait for the process to complete.
If the repair is successful, the issue should be resolved. If not, proceed to the next solution.
Solution 2: Erase the Disk
If the repair does not resolve the issue, you may need to erase the entire APFS-formatted SSD:
-
In Disk Utility, select the affected APFS-formatted SSD and click the "Erase" tab.
-
Enter a name for the new disk and choose the desired format (APFS).
-
Click the "Erase" button and wait for the process to complete.
After the erase process is finished, you can reinstall macOS and transfer your data back to the SSD.