2

I have an old MacBook Air running out of disk space, and DaisyDisk reports that 25 GB are taken by "still hidden". Following their suggestions, I've tried to run Disk Utility First Aid as well as a raw sudo fsck_apfs -ln /dev/rdisk1s1, and both give me the following error:

...
** Checking the object map.
** Checking the snapshot metadata tree.
** Checking the snapshot metadata.
** Checking snapshot 1 of 1.
error: btn: invalid value (3808, 20)
   Snapshot is invalid.
** The volume /dev/rdisk1s1 could not be verified completely.

I've checked both sudo tmutil listlocalsnapshots / and sudo tmutil listlocalsnapshotdates /, and both show no results. I've tried booting into recovery/single-user mode and running sudo fsck_apfs -y /dev/rdisk1s1, but it fails with the same "snapshot is invalid" error.

Is there any way to get fsck_apfs to successfully run and repair the disk? If not, as a last resort, would it make sense to fully delete this machine's Time Machine backup and recreate it from scratch as a way to try to get rid of this invalid snapshot?

Edit: I also forgot to mention, I have disabled Time Machine backups and restarted as well (in an attempt to get rid of all local snapshots).

6
  • 1
    If you are still dealing with this, try sudo fsck_apfs -lnS /dev/rdisk1s1 to skip checking snapshots.
    – Jivan Pal
    Commented May 30, 2020 at 22:06
  • @JivanPal thanks, that allowed the check to complete and printed a bunch of warning: found orphan dstream id object (id ..., refcnt 1) lines. Searching for that message shows other people having similar issues with a failed Time Machine backup. Any idea how to repair those without getting stuck at the invalid snapshot error?
    – jrdioko
    Commented May 30, 2020 at 23:13
  • 1
    You can encounter that issue for many reasons, but an interrupted snapshot (such as a Time Machine backup) is probably the most common. Repairing the partition is probably beyond feasible given the lack of sufficient tools from Apple. I would try to salvage the data, copying it to another drive, and then re-formatting the original drive/partition. My first step would be to see what apfs-fuse is able to read from the partition. You can boot Linux (e.g. from an Ubuntu USB) to try this.
    – Jivan Pal
    Commented May 31, 2020 at 6:04
  • 1
    You are needing to repair a malformed filesystem, albeit one that is sufficiently functional that you can apparently use it (for now — I wouldn't be surprised if it fails irreparably sometime soon). Given the lack of good tools to repair it, I'd just do a good old-fashioned backup and restore by copying the files to another drive, then wiping/reformatting the original drive and copying the files back to it. What I'm suggesting will require re-installation of the operating system.
    – Jivan Pal
    Commented May 31, 2020 at 22:12
  • 1
    I backed up a system image using Carbon Copy Cloner, reformatted/reinstalled macOS, and restored from the image using Migration Assistant. Now running First Aid in recovery mode shows no errors or warnings and everything seems to be resolved. Although running First Aid when not in recovery mode still gives a warning (apfs_num_other_fsobjects (61) is not valid (62)).
    – jrdioko
    Commented Jun 20, 2020 at 17:06

1 Answer 1

0

See the comments above for the approach I wound up taking. It appears Apple's tools don't allow recovery of the filesystem in this case, so I had to back everything up and reformat/reinstall/restore. That seems to have fixed the filesystem errors and disk space problems.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .