Web lists-archives.com

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




On Sun, 06 May 2018, Richard Owlett wrote:
> On 05/06/2018 06:23 AM, Henrique de Moraes Holschuh wrote:
> > 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.
> 
> I'm running Debian 9 with MATE.
> My observed symptoms were initially observed related to what choices given
> when right clicking on the icon associated with a partition.

Ok, so it is the "device/partition is registered as removable" thing, as
hinted by the kernel plus whatever overrides udev/udisks2/MATE has for a
particular device / device type.

> I suspect the underlying probably is related to how/when something is
> "auto-magically" mounted. YES, a vague statement. This afternoon I plan to
> run some tests.

Indeed.  Anyway, FWIW, there are ways (through udev or equivalent) to
change the system's notion of whether a device is removable or not.
Unfortunately, it has been half a decade I needed to mess with this, so
I don't recall the incantations.

As for removable *media* (cdroms, etc), the kernel will return an error
when the eject IOCTL is issued and the operation cannot be performed for
any reason (e.g., you tried it on a SSD/HDD, or the optical drive tray
was locked, or the media is mounted and in use).  I *assume* that
userspace (MATE, udisks, whatever) _might_ decide to (in some
situations), attempt to "safely remove" when the eject IOCTL fails with
an "ioctl innapropriate for this device" error.

-- 
  Henrique Holschuh