disk3s3 is the extra partition on the time machine disk which OS X is complaining about. From what I have read (https://discussions.apple.com/message/19675983#19675983) this is a partition called "Boot OS X" which might have been installed on your time machine disk around the time of upgrading to 10.8.2. According to the linked article, this partition contains a copy of the Recovery Partition (http://support.apple.com/kb/ht4718) which you can boot from in the event that you cannot boot from your primary hard disk. This will only give you access to Recovery Mode, not a full OS installation.
I have observed that this partition is not mounted when you plug in the time machine disk (use the "mount" or "diskutil activity" commands to see this) but instead appears to be mounted when Time Machine finishes a backup. I don't know why it does this.
When you "eject" the disk from the Finder, you probably need to wait a few seconds before unplugging it. When the drive icon disappears, this probably means that the main time machine volume has been unmounted, but maybe it is still unmounting the recovery partition. This is likely the cause of your error message about having unplugged a disk without ejecting it. If you are paranoid, type "mount" to see all the mounted volumes, and verify that the time machine volume is no longer mounted before unplugging the disk.
umount
is a UNIX command that adheres to the traditional UNIX perspective that unmounting a filesystem is a system administration task.
The rationale behind is that unmounting a filesystem, if poorly planned or executed, could be disruptive, even destructive, especially on a multiuser system. So regular users are protected from this potentially dangerous command and only root or a privileged user is allowed to execute it.
This makes a lot of sense when UNIX is used as a server operating system, but a UNIX-based desktop OS (for example, OS X or Ubuntu) has other needs: any user should be able to unmount flash drives, removable harddrives, etc.
The Finder and diskutil
(see man diskutil for more information) work this way. For example, I can open Terminal and successfully run:
$ diskutil unmount /Volumes/Untitled
Volume Untitled on disk2s2 unmounted
whereas umount
fails:
$ umount /Volumes/Untitled
umount: unmount(/Volumes/Untitled): Operation not permitted
What is the Finder or diskutil
doing differently? Behind the scenes, they send a request to a daemon called com.apple.SecurityServer (see man page for more information), which grants the right to unmount the filesystem:
$ tail -f /var/log/system.log
Feb 6 16:57:37 avallone.local com.apple.SecurityServer[17]: Succeeded authorizing right 'system.volume.removable.unmount' by client '/System/Library/CoreServices/Finder.app' [171] for authorization created by '/System/Library/CoreServices/Finder.app' [171] (100013,0)
Feb 6 16:57:37 avallone.local com.apple.SecurityServer[17]: Succeeded authorizing right 'system.volume.removable.unmount' by client '/usr/sbin/diskarbitrationd' [18] for authorization created by '/System/Library/CoreServices/Finder.app' [171] (100002,0)
Feb 6 17:01:46 avallone.local com.apple.SecurityServer[17]: Succeeded authorizing right 'system.volume.removable.unmount' by client '/usr/sbin/diskutil' [646] for authorization created by '/usr/sbin/diskutil' [646] (100013,0)
Feb 6 17:01:46 avallone.local com.apple.SecurityServer[17]: Succeeded authorizing right 'system.volume.removable.unmount' by client '/usr/sbin/diskarbitrationd' [18] for authorization created by '/usr/sbin/diskutil' [646] (100002,0)
This allows any user to unmount a drive without requiring additional authentication. (Ubuntu has a similar philosophy. If you are interested, take a look at this answer on AskUbuntu.)
To support the behavior explained above the Finder and diskutil
use several Apple frameworks:
$ otool -L $(which diskutil) | grep Disk
/System/Library/PrivateFrameworks/DiskManagement.framework/Versions/A/DiskManagement (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
$ otool -L /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder | grep Disk
/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
/System/Library/PrivateFrameworks/DiskImages.framework/Versions/A/DiskImages (compatibility version 1.0.8, current version 344.0.0)
/System/Library/PrivateFrameworks/DiskManagement.framework/Versions/A/DiskManagement (compatibility version 1.0.0, current version 1.0.0)
umount
, on the other side, is only linked to this dynamic library:
$ otool -L $(which umount)
/sbin/umount:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
(/usr/lib/libSystem.B.dylib
uses several other libraries, but isn't linked to any framework.)
Best Answer
lsof
is indeed your best bet. The fastest and easiest way would be this :-It can take a couple minutes to run, but once it's complete, it gives you a list of open files on the disk. The output will look something like this:
In this case, it's the
QuickLook
application that has a file open. Closing the application directly is the best way to fix the issue. However, that's not always possible. For example, QuickLook doesn't show up as an application you can get to in the Dock.If you can't close the application manually, you can use the
kill
command to terminate it from the command line. To do that, use thePID
from the second column as the ID to kill. From the above example, it would be:Note that sometimes that doesn't work and a more aggressive form of
kill
must be used. Here's a series of escalating aggressiveness (using the example PID of 2158):You should be able to eject the disk once the process/application has been killed.
One final note,
lsof
can take a minute or two. It can also hang, but you should give it at least a few minutes before you decide that's what happened.Also, sometimes the base command
sudo lsof /Volumes/myDrive
won't find anything. If that happens, try adding the+D
argument (i.e.sudo lsof +D /Volumes/myDrive
). That will do a top down scan of the disk. It'll take longer, but it should pick up anything that's causing the disk to be un-ejectable.(Hat tip to Alec Jacobson's post for extra details.)