EGOPOLY

Topics include: programming, Apple, Unix, gadgets, large-scale web sites and other nerdy stuff.

How to find out what process is using a disk on Mac OS X.

2007-01-05 08:58:29

This is not a very difficult one, but it's handy. In my case, I reinstalled the operating system on a new disk, but I kept the old disk in, so I could copy my user files and reference the other config changes I had made.

It's been about two weeks on the new disk, and I don't need the old one anymore. So I went to use Disk Utility to erase the old boot drive, and it wouldn't unmount the volume, because it was in use.

I didn't think anything should be using that disk, but I ran this command in a terminal:

% sudo lsof | grep '/Volumes/Macintosh HD'
coreservi  107  root    9u REG 494296 /Volumes/Macintosh HD/Desktop DB
coreservi  107  root   10u REG 494297 /Volumes/Macintosh HD/Desktop DF
GrowlHelp  2016 billo  txt REG 050895 /Volumes/Macintosh HD/Library/PreferencePanes/G...
GrowlHelp  2016 billo  txt REG 050839 /Volumes/Macintosh HD/Library/PreferencePanes/G...
I'm not sure why growl decided to install itself on the bogus, non-boot hard drive. But I simply shut it down, and then was able to reformat the disk. Yay.