16

I'm trying to delete a file, but I get a message from Trash saying:
"The operation can’t be completed because backup items can’t be modified."

The operation can’t be completed because backup items can’t be modified.

What does that mean and how can I delete it?

0

4 Answers 4

3

According to this thread at Apple, this is a bug. This means it will hopefully be fixed in a coming update to OS X.

In the meantime, you have to relaunch the Finder, which you can do either through force quit (⎇⌘⎋, or through the  menu), or by less violent means by quitting it normally, which you must first activate through the following command issued in the Terminal:

defaults write com.apple.Finder QuitMenuItem 1
2
  • 2
    You could always do killall Finder in the Terminal
    – segiddins
    Commented Apr 3, 2013 at 2:42
  • 2
    Option-click on the Finder's Dock icon and choose Relaunch Finder. Commented Apr 3, 2013 at 7:20
35
+200

The root of the cause

Time Machine backups are protected at kernel level -- on a verbose boot it's possible to spot in the first screenful of text a TMSafetyNet.kext extension being loaded.

This ensures the integrity of your backups. Access control provisions are applied via a kernel extension located at /System/Library/Extensions/TMSafetyNet.kext

Deleting in Time Machine

The officially sanctioned method for deleting items from a specific backup or all of them is to locate the item in the "in space" Time Machine view and selecting the appropriate delete option from the contextual menu or the Action button in the toolbar.

The ability to move backups to the Trash added in Lion is not only comparatively more buggy, but designed to operate on entire snapshots, i.e. the folders named with the time the backup was created which in turn contain a directory for each included volume.

Deleting from commandline (more flexible, more control)

There exists a a helper program (commandline binary) at...

/System/Library/Extensions/TMSafetyNet.kext/Contents/MacOS/bypass

...which allows you to supply a command and argument to completely bypass the access restrictions.

In Lion you run:

sudo /System/Library/Extensions/TMSafetyNet.kext/Contents/MacOS/bypass rm -rfv /Volumes/[disk]/Backups.backupdb/[path]

In Mountain Lion bypass moved to the Helpers directory:

sudo /System/Library/Extensions/TMSafetyNet.kext/Helpers/bypass rm -rfv /Volumes/[disk]/Backups.backupdb/[path]

In OS X 10.10.5 (from a comment by David Anderson), this is now at:

sudo /System/Library/Extensions/TMSafetyNet.kext/Contents/Helpers‌​/bypass rm -rfv /Volumes/[disk]/Backups.backupdb/[path]

Credits:

[1] - Michael Rushanan on TMSafetyNet bypass
[2] - A brief explanation of the Time Machine Safety Net by Joel Cowgill
[3] - Similar question on SuperUser

4
  • 1
    Yay, this worked indeed! Entering Time Machine and deleting the file from there was not an option since this backup is linked to another user. However, after deleting the *.exe files using your solution, the Finder would still show them as present. I had to kill the Finder process for the displayed content to refresh.
    – gentmatt
    Commented Apr 1, 2013 at 19:35
  • 1
    This is now moved to: "/System/Library/Extensions/TMSafetyNet.kext/Helpers/bypass", and otherwise works as advertised. Commented Jul 22, 2014 at 5:28
  • 3
    In OS X 10.10.5, this is now at /System/Library/Extensions/TMSafetyNet.kext/Contents/Helpers/bypass. Commented Sep 23, 2015 at 6:27
  • 1
    trying to use bypass to "mv" the file to a different location on the drive, but it's giving me "Operation not permitted"
    – Michael
    Commented Jan 23, 2017 at 2:52
1

bypass is in /System/Library/Extensions/TMSafetyNet.kext/Contents/Helpers/ in High Sierra (OSX 10.13.3) on my iMac. Also if you want the list of files deleted with -v, you should redirect to a file because the scrolling verbose list is impossible to read in Terminal.

2
  • how exactly does this work? sorry, noob here
    – yntheng
    Commented Jun 7, 2019 at 7:05
  • Still works in Mojave, thanks @tngn Commented Mar 27, 2020 at 21:07
0

It seems like the bypass program doesn't exist on Big Sur. I was able to delete files from the backup after renaming the top-level backup folder from "Backups.backupdb" to "Backups.backupdb.tmp":

mv Backups.backupdb{,.tmp}

I also had to remove the ACL:

chmod -R -a 'group:everyone deny add_file,delete,add_subdirectory,delete_child,writeattr,writeextattr,chown' Backups.backupdb.tmp

You must log in to answer this question.

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