Mac command

 Unmount device

diskutil umount /Volumes/"Macintosh HD"/

Check what files are being used in a device

lsof /Volumes/"Macintosh HD"/

Reindex Spotlight

sudo mdutil -i on /