This article is from the Macintosh system software FAQ, by Elliotte Harold email@example.com with numerous contributions by others.
When file-sharing is turned on it makes all disks larger
than two megabytes available for remote access by the owner even
if they aren't specifically shared. This prevents the dismounting
of removable media. Turn off file-sharing first. Then drag the
volume icon to the trash. Apple's recently released free utility
UnmountIt will do this automagically, i.e. turn off file-sharing,
eject the disk, and then turn file-sharing back on. See