While playing around with some of the latest OS X releases tonight, I managed to mount a disk image (for an image viewer called "Outlaw", which is pretty cool, BTW, for its instant infinite scaling) which simply would not eject. When I tried, I got a message stating that the image couldn't be ejected because it was in use. I knew this wasn't the case, as I had quit Outlaw and pretty much everything else except OmniWeb. To debug and solve the problem, I opened a new terminal window and typed:
fstat | grep "Outlaw"
fstat is a file status program which identifies open files, and then the pipe (vertical bar) passes the output of fstat to grep, the UNIX search program. I asked grep to find the word "Outlaw", which was part of the disk image name. The output of the command was:
robg TruBlueEnv 804 11 19 drwxrwxrwx 264 r /Volumes/Outlaw-0.1b1
TruBlueEnv is Classic, which somehow had the image file open -- even though I had no Classic apps running! At that point, I returned to the GUI, opened System Prefs and stopped Classic. I could then eject the disk as usual from the contextual menu.
So if you've got a stuck image file, take a look at fstat with a search on part of the volume name (to shorten the returned list!) to find what's making your volume busy. NOTE: There may be easier ways to do this (UNIX wizards, any thoughts?) but this was the first one that came to mind when I was faced with the problem.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20010505030102731