X

Cannot delete locked files on external volumes

Users with external hard drives or other storage devices may run into problems accessing files on these devices, especially when attempting to delete files that are reported by Mac OS X to be "locked".

CNET staff
2 min read

Users with external hard drives or other storage devices may run into problems accessing files on these devices, especially when attempting to delete files that are reported by Mac OS X to be "locked".

Apple Discussions poster wholemilk writs:

"I'm trying to delete some files and I get the following message, 'Emptying the Trash cannot be completed because 'weezeer_beverly_ucv(1).mpeg' is locked. To empty everything in the Trash, including locked items, press the Option key while selecting Empty Trash.' I've tried this a dozen different ways and it won't work. I get the same error message. I've tried the Option key (on either side and together), the command key, delete and various combinations therein -- it's still in the trash."

This problem seems to be associated with drives that are formatted to FAT instead of Mac OS Extended (HFS ). While FAT supports files being set to "read only" or "hidden", the methods used for setting these files are not supported by OS X. As such, if a file is "read only" in Windows or another operating system, users will not be able to edit or delete the file in OS X, even with administrative privileges. This involves an incompatibility between the OS and the FAT filesystem since FAT does not support individual file permissions (such as Posix or ACLs) and instead relies on FAT-specific file attributes for features such as "read only", "hidden", or "archive". Therefore, file handling utilities such as "chmod" and "chown", or even "sudo rm -f" to force the file to be deleted and will not work for files on FAT-formatted drives since they all rely on permissions support for file access, and users are stuck with those files not being editable in OS X.

Fixes

Access the files in another operating system Windows fully supports the FAT format and its file attributes, so if users have access to a Windows PC or have BootCamp running on their Macs, they can access the drive in Windows to delete the locked files or unlock them so they can be edited in OS X. With the drive mounted in Windows, right-click the file and get properties on it. Then in the "General" tab uncheck the attributes checkboxes, including those listed after clicking the "Advanced" button. Alternatively users should be able to delete the file in Windows if it is unneeded.

Format the drive to another format typeIf the drives are going to be used with other computers then it may be necessary to keep the drive as FAT, but if it is only going to be used with Macintoshes, then formatting it to Mac OS Extended is the most compatible format to use. Back up the files on the disk, and then use Disk Utility to format the drive to Mac OS Extended.

Resources

  • wholemilk
  • More from Late-Breakers