I am trying to repair permissions on my external HD. I cannot empty my trash when it is plugged in, because I get a bunch of "such file is in use". I read online that this might be resolved by repairing permissions on the drive. I am currently unable to unmount the drive because it is in use the second I restart or unplug and replug it in. I used lsof to see what is using it but I am unable to understand this and can't seem to find a clear guide to learn what this means. The output is below:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME mds 59 root 23r DIR 1,9 1701 5 /Volumes/SEAGATE mds 59 root 31r DIR 1,9 1701 5 /Volumes/SEAGATE Command
ps ax | egrep '[ /](PID|mds)' Output
PID TT STAT TIME COMMAND 660 ?? Ss 0:12.49 /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Support/mds 673 ?? Ss 0:08.68 /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Versions/A/Support/mds_stores Command
/usr/bin/sudo kill 660 Output
//new line$ Command
sudo lsof /dev/disk2s2 Output
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME mds 1599 root 11r DIR 1,8 1764 5 /Volumes/SEAGATE In that order
If I run the bash file several times in a row I can get
PID TT STAT TIME COMMAND 1737 ?? Ss 0:00.69 /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Support/mds But the drive is still locked by mds
Just to show that the exception was added, here are screenshots:


dfand oflsof /dev/disk…where/dev/disk…is the name of your external diskSEAGATE. I don't talk here of its mount point which is/Volumes/SEAGATE.lsof /dev/disk2s2.umount -f /dev/disk2s2. Next openDisk Utilityselect it, click [Verify Disk], if necessary [Repair Disk].