Web lists-archives.com

Re: Distinguishing among [unmount, Safely Remove Drive, Eject]




On Sat, 05 May 2018, Richard Owlett wrote:
> What are the distinguishing features of unmount, Safely Remove Drive, and
> Eject?

Usually it goes like this:

unmount: exactly what it says.  Likely operates only on a single
filesystem (device may have many, if it is partitioned, etc).  Will
flush caches related to that filesystem, and will issue device cache
flushes or write barriers as required, but only related to that
filesystem.

safely remove: unmount all partitions/filesystems; quiesce the device
(flush all caches, plug all read/write queues); issue device quiesce
commands (spin down HDDs, prepare-for-power-off notification for SSDs,
etc); delete it from the kernel (so that it can be physically
hot-removed by the operator, etc).

eject: unmount all partitions/filesystems, issue "media eject" IOCTL
command to device (some card readers, cdrom/cdrw/dvdrom/dvdrw and other
media-tray based devices, etc).  Might or not end up doing nearly the
same as "safely remove", depending on just what the kernel decides to do
when it gets that ioctl (or if some lower level userspace is intelligent
enough to map it to "safely remove", etc).  Does *not* delete the device
from the kernel.

> The question is prompted by observing that for partitions on USB flash
> drives which have been auto-mounted, one or both of the last two are listed
> when clicking on the icon associated with a partition. For a hard disk
> partition, only the first is given.

Next time, give us the name of the DE and application in question.

Anyway, it looks like it is giving you "unmount" when it thinks it is an
unremovable device, and the two others when it thinks either the device
or the media might be removable.

-- 
  Henrique Holschuh