How to Fix Apple Error -120: Folder not found or target directory inode deleted during di
1. Overview & Failure Manifestation
Error -120 (dirNFErr / ENOENT in POSIX context) manifests as a catastrophic directory inode resolution failure during APFS B-tree traversal. The failure presents identically across Finder, ls, stat(2), and openat(2) syscalls: “The operation couldn’t be completed. Folder not found.” (macOS 13+) or “The item can’t be found.” (macOS 11–12). In Console.app (subsystem:com.apple.apfs, category:metadata), the signature log entry reads:
APFS: apfs_vnop_lookup:1234: dir inode 0x7F8A3C20 (oid 0x1F4B) not found in fsroot 0x1A2B3C4D; returning ENOENT (-120)
Simultaneously, kernel.log emits APFS: apfs_inode_get: inode 0x7F8A3C20 not found in extent tree. The Finder UI freezes for 8–12 seconds (default vfs.apfs.lookup_timeout_ms=10000) before surfacing the alert. mds and mdworker processes spike to 95% CPU as Spotlight attempts re-indexing the orphaned subtree. Time Machine backupd logs Error -120 scanning /Volumes/Data/Users/Shared/OrphanedDir and aborts the snapshot. On Apple Silicon (M1/M2/M3), the Secure Enclave audit log (log show --predicate 'subsystem == "com.apple.securityd"') records SEP: apfs_inode_validation_failed: oid=0x1F4B, gen=0x3E8, sig=INVALID, indicating cryptographic verification failure of the inode's Merkle hash. The volume remains mountable but the affected directory subtree is permanently inaccessible until structural repair.
2. Silicon & Firmware Architecture Root Cause
At the silicon layer, Error -120 originates from a desynchronization between the APFS B-tree node checksums stored in the NAND controller's SRAM cache and the persistent media state. On Apple Silicon SoCs (T8110/T6000/T8112), the ANS2 (Apple NAND Storage) controller manages wear-leveling and ECC via a dedicated 1.2 GHz ARM Cortex-M7 firmware core. During a metadata transaction (directory creation, rename, or hard-link), the APFS journal (/private/var/db/.AppleSetupDone equivalent on-data-volume) writes a j_phys_extent_t record to the checkpoint region (CPR) at LBA 0x2000–0x20FF. If a power-loss event (PMIC rail VDD_NAND_1V8 droop below 1.62V for >15µs, detected by the PMU's ADC_CH_NAND_VMON channel) occurs between the journal commit (CPR update) and the B-tree node flush (extent tree leaf update at LBA 0x1A2B3000), the inode's apfs_inode_t structure (offset 0x180 in the B-tree leaf) retains a stale private_id (0x1F4B) while the extent tree's apfs_extent_t record points to a freed physical block (PBN 0x3F2A1).
The Secure Enclave Processor (SEP) validates the inode's Merkle hash (SHA-384 over inode_number | parent_id | create_time | mod_time | extent_list) during apfs_inode_get(). A mismatch triggers SEP_ERROR_INODE_INTEGRITY (0x8003), causing the kernel to invalidate the vnode cache entry (vnode_reclaim()) and return ENOENT. On Intel Macs (T2-equipped), the same failure path executes via the T2's ANS firmware (v2.28.0+), but the SEP validation is offloaded to the T2's AES-XTS engine. The I2C0 bus (0x48 address) between PMIC (Dialog/OnSemi 2021A) and SoC carries the NAND_PWR_GOOD signal; a glitch here during apfs_sync_fs() (syscall 0x1A6) is the primary root cause for non-user-initiated occurrences. Firmware handshake window: ANS_FW_CMD_COMMIT_CPR (0x14) must complete within 2.4ms of ANS_FW_CMD_FLUSH_EXTENT (0x1B), else the transaction is marked DIRTY in the CPR's j_checkpoint_t.flags bit 3.
3. Diagnostic Verification & Terminal Commands
Execute the following commands in exact sequence. Requires root or sudo with csrutil disabled for fsck_apfs -n live verification.
3.1 Live APFS Structural Verification (Read-Only)
sudo fsck_apfs -n -l /dev/disk3s1 2>&1 | tee /tmp/fsck_apfs_enoent.log
Output fields: INODE (hex inode number), PARENT (parent inode), EXTENTS (count), CHECKSUM (SHA-384 truncated), STATUS (OK/ORPHAN/CHECKSUM_FAIL). Target: INODE 0x1F4B STATUS ORPHAN.
3.2 Console Log Stream Filter for Real-Time Capture
log stream --predicate '(subsystem == "com.apple.apfs" AND category == "metadata") OR (subsystem == "com.apple.securityd" AND eventMessage CONTAINS "inode_validation")' --style syslog --color always
Key fields: oid (object ID), gen (generation counter), sig (Merkle signature status), latency_us (lookup latency).
3.3 NAND Controller Health via IORegistry
ioreg -r -c AppleANS2 -k "ECC_Correctable_Count" -k "ECC_Uncorrectable_Count" -k "Wear_Level_Count" -k "Power_Loss_Events"
Failure threshold: ECC_Uncorrectable_Count > 0 OR Power_Loss_Events > 3 in last 24h.
3.4 Secure Enclave Audit Log Extraction
log show --predicate 'subsystem == "com.apple.securityd" AND eventMessage CONTAINS "SEP_ERROR_INODE_INTEGRITY"' --last 24h --style json | jq '.[] | {timestamp, oid, gen, sig}'
3.5 APFS Checkpoint Region Dump (Forensic)
sudo dd if=/dev/disk3s1 of=/tmp/cpr.bin bs=4096 count=128 skip=8 2>/dev/null && xxd -s 0x100 -l 0x200 /tmp/cpr.bin
Inspect j_checkpoint_t.flags at offset 0x1C: bit 3 (0x08) = DIRTY confirms incomplete transaction.
4. Step-by-Step Resolution Protocols
Phase 1: Rapid Software & Cache Reset (Zero Data Loss)
- Unmount target volume:
sudo diskutil unmount force /dev/disk3s1 - Flush vnode cache:
sudo purge(clearsvnode_cacheandnamei_cache) - Reset Spotlight index for volume:
sudo mdutil -i off /Volumes/Data && sudo mdutil -E /Volumes/Data && sudo mdutil -i on /Volumes/Data - Remount with
noatimeto reduce metadata writes:sudo mount -o noatime -t apfs /dev/disk3s1 /Volumes/Data - Verify:
ls -la /Volumes/Data/Users/Shared/— if target directory appears, proceed to Validation (Section 7).
Success Criteria: Directory accessible, fsck_apfs -n reports zero orphans, SEP audit log shows no new SEP_ERROR_INODE_INTEGRITY for 1 hour.
Phase 2: Terminal / Subsystem Pipeline Flush (Command-Line Remediation)
- Boot to macOS Recovery (⌘R on Intel, Power+Hold on Apple Silicon).
- Open Terminal from Utilities menu.
- Identify APFS container:
diskutil apfs list— noteAPFS Container Disk: disk3. - Run targeted repair:
fsck_apfs -y -o repair_inode=0x1F4B /dev/disk3s1(requires macOS 13.4+fsck_apfswith-o repair_inodeflag). - If
repair_inodeunavailable, execute full repair:fsck_apfs -y -c 4 /dev/disk3s1(-c 4= 4 concurrent threads). - Verify CPR clean:
dd if=/dev/disk3s1 bs=4096 count=128 skip=8 2>/dev/null | xxd -s 0x1C -l 4— confirmflags & 0x08 == 0. - Reboot to normal OS:
reboot.
Success Criteria: fsck_apfs -n clean, target directory accessible, stat /Volumes/Data/Users/Shared/TargetDir returns inode 0x1F4B with valid st_gen.
Phase 3: Hardware / DFU Deep Restoration (Complete Firmware Reflashing)
- Enter DFU Mode: Intel T2 —
idevicediagnostics restartvialibimobiledevice; Apple Silicon — Power+TouchID 10s, release Power, hold TouchID 5s. - Restore IPSW with
Apple Configurator 2(v2.15+) oridevicerestore -e -d(latestlibirecovery). - Select Erase and Install — this rewrites ANS2 firmware (NAND controller), PMIC OTP, and SEP OS.
- Post-restore, run
nvram -cto clear boot-args. - Execute Phase 2 steps 3–7.
Success Criteria: ANS2 firmware version ≥ 2.28.4 (Intel) or 3.12.1 (Apple Silicon), ioreg -c AppleANS2 shows Power_Loss_Events = 0, zero recurrence over 72h stress test (fsstress -d /Volumes/Data -n 10000 -p 4).
5. Technical Specifications & Parameter Matrix
| Parameter | Nominal Value | Failure Threshold | Remediation Target |
|---|---|---|---|
| VDD_NAND_1V8 Rail Voltage | 1.80V ± 2% | < 1.62V for > 15µs | 1.80V ± 1% (PMIC OTP recalibration) |
| APFS CPR Commit Latency | 1.2 ms (M2), 1.8 ms (M1) | > 2.4 ms (DIRTY flag set) | ≤ 1.5 ms (ANS2 FW 3.12.1+) |
| I2C0 PMIC-SoC Bus Frequency | 400 kHz (Fast Mode+) | < 100 kHz (clock stretch > 25ms) | 400 kHz stable, no NACK |
| SEP Merkle Hash Verification Window | 85 µs (SHA-384 HW accel) | > 200 µs (timeout → ENOENT) | ≤ 100 µs |
| NAND ECC Uncorrectable Bit Errors | 0 per 1 TB written | > 0 per SMART log | 0 (block retirement via ANS2) |
| APFS Journal Replay Timeout | 5.0 s (mount_apfs default) | > 30 s (mount fails) | ≤ 3.0 s (clean CPR) |
| ANS2 Firmware Watchdog Period | 100 ms | Expired during CPR commit | Reset via DFU reflash |
| vfs.apfs.lookup_timeout_ms | 10000 ms | Exceeded → Finder hang | 5000 ms (tunable via sysctl) |
6. Frequently Asked Questions
Q1: Can Error -120 occur on a healthy SSD with no power-loss events?
A: Yes. A latent ANS2 firmware defect (pre-2.28.4 / pre-3.12.1) causes incorrect apfs_extent_t.phys_block_num calculation when the extent tree depth exceeds 3 levels (volume > 4 TB with 4 KB blocks). The bug manifests as a silent inode-to-extent mapping corruption during apfs_btree_insert() at btree.c:3421. No SMART error is logged. Resolution requires Phase 3 DFU reflash to update ANS2 microcode.
Q2: Why does fsck_apfs -y sometimes report "Volume repaired" but Error -120 recurs within 48 hours?
A:
Share your exact OS build and Finder/Console snippet in the OS Updates & Error Codes forum room.