MacOS: how to correct diskutil error snap_metadata_val object: invalid extentref_tree_oid

root's picture

I use Maintenance app to do some checks and cache cleanup from time to time. Today I got a message that my disk should be checked and repaired while in recovery.
So I did and I was surprised to find out this error while checking/repairing /: snap_metadata_val object: invalid extentref_tree_oid

Apparently this is related to local snapshots of time machine and one of them is in weird state indeed:

fmbpro:~ florian$ tmutil listlocalsnapshots /
com.apple.TimeMachine.2019-08-19-210124 (dataless)
com.apple.TimeMachine.2019-08-19-233007

So I deleted the "dateless" snapshot:

fmbpro:~ florian$ tmutil deletelocalsnapshots 2019-08-19-210124
Deleted local snapshot '2019-08-19-210124'
fmbpro:~ florian$ tmutil listlocalsnapshots /
com.apple.TimeMachine.2019-08-19-233007

Amazingly, the error was gone while checking/repairing the main drive.

Thou shalt not steal!

If you want to use this information on your own website, please remember: by doing copy/paste entirely it is always stealing and you should be ashamed of yourself! Have at least the decency to create your own text and comments and run the commands on your own servers and provide your output, not what I did!

Or at least link back to this website.