Cannot delete a .sparsebundle on / with permissions drwxr-xr-x@ 6 root wheel
-
25-05-2021 - |
Question
Even running commands as sudo I cannot change the permissions or delete the folder.
sh-3.2# xattr -l filename.sparsebundle/
com.apple.FinderInfo:
00000000 00 00 00 00 00 00 00 00 20 00 00 00 00 00 00 00 |........ .......|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
OS version
sh-3.2# sw_vers -productVersion
10.15.1
Adding requested information.
sh-3.2# ls -al
total 11
drwxr-xr-x 24 root admin 768 Oct 31 00:49 .
drwxr-xr-x 24 root admin 768 Oct 31 00:49 ..
-rw-rw-r-- 1 root admin 0 Aug 25 00:20 .DS_Store
lrwxr-xr-x 1 root admin 36 Oct 8 13:23 .VolumeIcon.icns -> System/Volumes/Data/.VolumeIcon.icns
---------- 1 root admin 0 Aug 25 00:20 .file
drwx------ 124 root admin 3968 Oct 31 00:55 .fseventsd
drwxr-xr-x 2 root wheel 64 Aug 25 00:20 .vol
drwxrwxr-x+ 80 root admin 2560 Dec 12 19:27 Applications
drwxr-xr-x 70 root wheel 2240 Oct 31 00:51 Library
drwxrwxrwt 3 root wheel 96 Dec 15 2018 Secomba
drwxr-xr-x@ 8 root wheel 256 Sep 29 22:23 System
drwxr-xr-x 5 root admin 160 Sep 29 22:22 Users
drwxr-xr-x 5 root wheel 160 Dec 12 22:04 Volumes
drwxr-xr-x@ 6 root wheel 192 Oct 8 08:27 filename.sparsebundle
drwxr-xr-x@ 38 root wheel 1216 Oct 31 00:49 bin
drwxr-xr-x 2 root wheel 64 Aug 25 00:24 cores
dr-xr-xr-x 3 root wheel 5579 Dec 12 21:39 dev
lrwxr-xr-x@ 1 root admin 11 Oct 8 13:18 etc -> private/etc
lrwxr-xr-x 1 root wheel 25 Dec 12 21:39 home -> /System/Volumes/Data/home
drwxr-xr-x 3 root wheel 96 Oct 8 13:27 opt
drwxr-xr-x 6 root wheel 192 Oct 31 00:49 private
drwxr-xr-x@ 64 root wheel 2048 Oct 31 00:49 sbin
lrwxr-xr-x@ 1 root admin 11 Oct 8 13:23 tmp -> private/tmp
drwxr-xr-x@ 11 root wheel 352 Oct 8 13:23 usr
lrwxr-xr-x@ 1 root admin 11 Oct 8 13:23 var -> private/var
Error when attempting to delete
sh-3.2# rm -rf filename.sparsebundle/
rm: filename.sparsebundle//token: Read-only file system
....
Checking extended attributes
sh-3.2# ls -laOe filename.sparsebundle
total 256
drwxr-xr-x@ 6 root wheel - 192 Oct 8 08:27 .
drwxr-xr-x 24 root admin sunlnk 768 Oct 31 00:49 ..
-rw-r--r-- 1 root wheel - 499 Oct 8 08:27 Info.bckup
-rw-r--r-- 1 root wheel - 499 Oct 8 08:27 Info.plist
drwxr-xr-x 85 root wheel - 2720 Oct 8 08:27 bands
-rw-r--r-- 1 root wheel - 122368 Oct 8 08:27 token
Solution
sh-3.2# rm -rf filename.sparsebundle/ rm: filename.sparsebundle//token: Read-only file system
The sparsebundle probably resides on the read-only mounted system volume of a Catalina boot volume.
- Boot to Recovery Mode.
- (Unlock/mount your main Catalina boot volume with Disk Utility if it is encrypted)
- Open Terminal in the menubar (Utilities > Terminal)
cd
to the root of the main system volume (e.g.cd /Volumes/Macintosh\ HD/
)List the content with
ls -la
to check whether filename.sparsebundle resides there.- Remove the sparsebundle with
rm -dR filename.sparsebundle
. - Reboot to your main volume.
OTHER TIPS
Apple has filesystem ACL and other restrictions that are more restrictive than the traditional POSIX permission model.
ls -laOe filename.sparsebundle
The above command will list out the details of your directory so you can start to decide if you will override them and how you would do that.
If you get the contents of the folder listing, you’ll have to use ls -laOe /
and sort out the entries for the sparsebundle