Cannot delete old and empty iPhone backup folder


I used to backup my iPhone to an external drive using the instructions here but now that I am backing up to my internal hard drive (the default location) I would like to delete the old backup. I was somehow successful at deleting the data within the directories, so it no longer takes up any space, but I can’t seem to delete the directory itself. If the directory is in the Trash and I go to empty it, it tells me the sub-directories are in use:

Cannot delete old and empty iPhone backup folder

If the path is stored in $directory, whether I use rm -rf $directory or sudo rm -rf $directory, I get a Permission denied error for each sub-directory:

rm: /Volumes/VOLUME/iPhoneBackup/Backup/00008110-000G309221F0401E/61: Permission denied

As far as permissions go, I am the owner of the top level directory and each sub-directory…

I should also note that I looked for uchg (immutable) flags, and although there were none I used sudo chflags -R nouchg $directory which had no effect. I also used sudo chmod -RN $directory to remove ACLs in case there were any, also with no effect.

If I use ls -@AOelR $directory to get file flags, ACLs, and extended attributes I get this:

drwxr-xr-x  3 username  staff  - 96 Apr 22 13:41 Backup

iPhoneBackup/Backup:
total 0
drwxr-xr-x  258 username  staff  - 8256 Apr 22 13:18 00008110-000G309221F0401E

iPhoneBackup/Backup/00008110-000G309221F0401E:
total 0
drwxr-xr-x  26 username  staff  -  832 Jan 13  2024 00
drwxr-xr-x  28 username  staff  -  896 Jan 13  2024 01
...[same results for each directory]

iPhoneBackup/Backup/00008110-000G309221F0401E/00:
total 0
...[same results for each directory]

How do I get rid of this directory?

Leave a Reply

Your email address will not be published. Required fields are marked *