Disclaimer: Apple does not necessarily endorse any suggestions, solutions, or third-party software products that may be mentioned in the topic below. Apple encourages you to first seek a solution at Apple Support. The following links are provided as is, with no guarantee of the effectiveness or reliability of the information. Apple does not guarantee that these links will be maintained or functional at any given time. Use the information below at your own discretion.
Resetting the System Immutable Flag in OS X 10.4
These problem files typically turn up on non-boot volumes. Make a note of the volume name where the problem file or folder is located, and note the User ID of the subfolder of .Trashes involved. In the commands below, this is assumed to be 501; substitute yours if different. Of course if the file or folder is located in '.Trash' you will not need to do this.
Copy the commands below very carefully (or better, print them out), because you cannot paste into single user mode. Pay particular attention to spaces or lack of them, and periods.
You get to single user mode by rebooting while holding down the Command (Apple) key and the 's' key simultaneously. You will get some white text on a black background which will eventually stop at a '#' prompt (sometimes messages get interleaved).
When the text has stopped, type:
/sbin/fsck -fy
and repeat this command until it says your disk is OK. Then type:/sbin/mount -uw /
and if the problem is on a non-boot volume type:/usr/libexec/registermach_bootstrapservers /etc/mach_init.d
autodiskmount
cd /Volumes/"your volume name"
/usr/bin/chflags -R noschg .Trashes
/usr/sbin/chown -R 501:501 .Trashes/501
/bin/chmod -R 700 .Trashes/501
cd /Users/<yourshortname>
/usr/bin/chflags -R noschg .Trash
/usr/sbin/chown -R 501:501 .Trash
/bin/chmod -R 700 .Trash
sbin/reboot
In the unlikely event you get an error, note it down carefully, type "reboot" without the quotes, and post a message to the forums requesting help and quoting the error message, and its context, in full. You can also type "reboot" at any time should you wish.There are no dangerous commands there, so you are not likely to damage anything. Any file deletion will be done when you're back in the Finder.
What is going on here?
An explanation may help. The 'fsck' just checks your filesystem and repairs minor damage if it finds any—this is the same as running Disk Repair from the CD, and is always wise before doing anything in single-user mode.
If you go into single user mode, near the bottom of the text you will see that the filesystem is mounted read only. Therefore, to make any changes it has to be mounted for writing as well. That is the purpose of the 'mount' command. The 'autodiskmount' command is necessary because we want to make changes on other than the boot partition.
Then we 'cd' to the correct partition. The 'chflags' turns off the system immutable bit for the directory (and all its contents, because of the -R for recursive). The 'chown' ensures the trash directory has the correct owner and group. The 'chmod' makes the directory readable and write-able by the owner, again recursively.
So if you reboot at that point, you should be able to empty the trash from the Finder.
Do you want to provide feedback on this User Contributed Tip or contribute your own? If you have achieved Level 2 status, visit the User Tips Library Contributions forum for more information.
Replies