An error message I’d love to see improved in Snow Leopard

OS X's "disk is in use" error dialog

Oh how I hate the above error message. It’s not that it’s completely uninformative, but it’s a perfect case of “so close but yet so far”…

Anyone who uses as many external disks on a Mac as I do is apt to occasionally have trouble properly unmounting and ejecting those disks 1. Before unmounting a disk, it’s necessary to stop accessing files on the disk. This is often an easy thing to do –if I’ve loaded a file from an external disk into an application, I just close the document or quit the application entirely. If I’ve goofed and am still using files on the drive, OS X will refuse to unmount the drive and will display the error dialog I’ve pasted above. 2

But often it’s less than obvious which application or function built-in to the operating system is using a file on the drive. There are applications that don’t play nice, and keep file handles open to files on a disk even after you’ve closed all documents that use those files 3. There are functions built into the operating system that access files on a disk without calling any attention to themselves. This error message could and should be a hell of a lot more informative and useful.

A simple set of commands in Terminal 4 can reveal which application is using a file on a particular disk. Since this information is available, is incredibly useful, and can be quickly retrieved in the Terminal, I see no reason that it is not just included in the initial error message. Telling me that a disk is still in use is not nearly as useful as telling me that a disk is still in use by Microsoft Word, or that a disk is still being shared with another computer.

In this case, the terminal command “lsof | egrep -i 400Gb” reported that a process named “smbd” was still using the drive. Since I’m a Unix geek this is useful information to me, but since OS X tries to also be useful to people who wouldn’t know a Samba daemon if it ate their grandmother, this process should be simplified. In an ideal world, the error message above would read “The disk ‘400Gb_Thing’ is in use by OS X’s Windows file sharing. Would you like to stop sharing this drive and eject it?” and would feature both “OK” and “Cancel Ejection” buttons.

This is a no-brainer. Apple, please fix. Thanks.

Technorati Tags: , , , , , , , , ,

  1. It’s a good idea to actually unmount disks prior to unplugging them, modern filesystems need to be given a proper send-off before disconnection to keep the data in good shape. ↩︎
  2. Windows users (and I am one), please refrain from feeling smug at this tale of Mac woe. Don’t get me started on the Windows “Safely Remove Hardware” dialogue and how much fun it is to try to remember the model numbers of each of my external drives so that I can find them in that list. It’s unconscionable that this feature wasn’t redesigned for Windows Vista. They must have used a single USB drive as the test case. ↩︎
  3. I often just have to quit Final Cut Pro before ejecting a drive for this reason, sometimes it just won’t let go of a file even when all FCP projects have been closed and I’m looking at an empty Browser ↩︎
  4. “lsof | egrep -i portion-of-disk-name”, or in this case “lsof | egrep -i 400Gb”, without the quotes. ↩︎

Leave a Reply