I don't know if you ever try to eject a disk and get that annoying message:
The disk x is in use and could not be ejected
but it doesn't say what is in use. Normally, I would just quit programs at random trying to find the culprit but there's an easier way with the terminal.
Just type:
diskutil list
in the command line to get something like:
/dev/disk0
#:------- type----------name----size-----identifier
0:-Apple_partition_scheme--------*37.3 GB---disk0
1:---Apple_partition_map---------31.5 KB---disk0s1
2:--------Apple_HFS-----Data----37.2 GB---disk0s3
The disk has identifier /dev/disk0. The partition I call Data, which is my system volume has identifier /dev/disk0s3.
Now let's say that's the drive I wanted to eject but can't. To list open files on that volumes, type:
lsof /dev/disk0s3
Then it will tell you what apps to quit. Sometimes these apps might be daemons but you can quit these using the process viewer. Once you do so, you should be able to eject the drive. I get this trouble a lot because I have a clone of my internal drive so often the open with dialog sometimes chooses the same apps on my external drive.
Another thing is if you need to mount a drive again, you don't need to unplug and plug it back in either. Just load Disk Utility and the partition will be greyed out. Select this and click mount.
The disk x is in use and could not be ejected
but it doesn't say what is in use. Normally, I would just quit programs at random trying to find the culprit but there's an easier way with the terminal.
Just type:
diskutil list
in the command line to get something like:
/dev/disk0
#:------- type----------name----size-----identifier
0:-Apple_partition_scheme--------*37.3 GB---disk0
1:---Apple_partition_map---------31.5 KB---disk0s1
2:--------Apple_HFS-----Data----37.2 GB---disk0s3
The disk has identifier /dev/disk0. The partition I call Data, which is my system volume has identifier /dev/disk0s3.
Now let's say that's the drive I wanted to eject but can't. To list open files on that volumes, type:
lsof /dev/disk0s3
Then it will tell you what apps to quit. Sometimes these apps might be daemons but you can quit these using the process viewer. Once you do so, you should be able to eject the drive. I get this trouble a lot because I have a clone of my internal drive so often the open with dialog sometimes chooses the same apps on my external drive.
Another thing is if you need to mount a drive again, you don't need to unplug and plug it back in either. Just load Disk Utility and the partition will be greyed out. Select this and click mount.






