1

I have an old and stuck local time machine snapshot or directory (probably from Mac OS 10.14/Mojave/2018) that seems impossible to delete (now on Mac OS 10.15/Catalina/2019).

The directory is empty (0 kB) and located here:

/com.apple.TimeMachine.localsnapshots/Backups.backupdb/Jons Mac/2019-09-19-223308

But it does not show up if I run:

% tmutil listlocalsnapshots /                
Snapshots for volume group containing disk /:
com.apple.TimeMachine.2020-08-03-161551.local
com.apple.TimeMachine.2020-08-03-162946.local

If I try to delete the directory, I get a error message that the directory is a read only file system:

% rm -rf /com.apple.TimeMachine.localsnapshots/Backups.backupdb/Jons\ Mac/2019-09-19-223308 
rm: /com.apple.TimeMachine.localsnapshots/Backups.backupdb/Jons Mac/2019-09-19-223308/Macintosh HD: Read-only file system
rm: /com.apple.TimeMachine.localsnapshots/Backups.backupdb/Jons Mac/2019-09-19-223308: Read-only file system

Same happens if I try to delete the old local snapshot root directory.

% rm -rf /com.apple.TimeMachine.localsnapshots
rm: /com.apple.TimeMachine.localsnapshots/Backups.backupdb/Jons Mac/2019-09-19-223308/Macintosh HD: Read-only file system
rm: /com.apple.TimeMachine.localsnapshots/Backups.backupdb/Jons Mac/2019-09-19-223308: Read-only file system
rm: /com.apple.TimeMachine.localsnapshots/Backups.backupdb/Jons Mac: Read-only file system
rm: /com.apple.TimeMachine.localsnapshots/Backups.backupdb: Read-only file system
rm: /com.apple.TimeMachine.localsnapshots: Read-only file system

This also happens if I disable SIP.

Does someone have an idea how I get can rid of this directory?

2 Answers 2

1

It is possible to delete Time Machine snapshots, but you should use the supplied tools. Trying to work around the system's blocking your attempts to rm by going into recovery mode is a sign you are taking a hammer to the problem and is not generally a good approach. Before doing that I would try the following.

After your initial command to identify what backups there are:

% tmutil listlocalsnapshots /                
Snapshots for volume group containing disk /:
com.apple.TimeMachine.2020-08-03-161551.local
com.apple.TimeMachine.2020-08-03-162946.local

You can then delete any of them with a command like:

% tmutil deletelocalsnapshots 2020-08-03-161551

Each may take a while to delete, so if you have a lot and want to automate the process, you can use this command to extract the relevant part of each file name (matching on the current year, if it's an old one you may want to ):

% tmutil listlocalsnapshotdates / | cut -f2 -d. | while read f; do tmutil deletelocalsnapshots $f; done

But I'm always paranoid about automating destructive commands, so you should first test that command with this safe variation (to protect you from something like a file naming convention change that makes the cut command act unexpectedly):

% tmutil listlocalsnapshotdates / | cut -f2 -d. | while read f; do echo $f; done
0

It is not possible to delete those orphaned Time Machine snapshots from the regular user space. You need to follow this steps to delete the folders:

  1. Turn on your Mac and immediately press and hold keys Command (⌘) and R. Need help? (see About macOS Recovery)

  2. Once you are in recovery mode, open from the menu Utilities > Terminal.

  3. In terminal you need to switch to your regular main HD. e.g. cd /Volumes/Mactintosh HD/.

  4. Check if folder com.apple.TimeMachine.localsnapshots contains the orphaned snapshots. (if not you need to go back to /Volumes and find the right volume.

  5. Go back to the HD folder from step 3.

  6. Delete the folder rm -rf com.apple.TimeMachine.localsnapshots

You must log in to answer this question.

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