On Thu, Jun 13, 2024 at 07:49:42PM +0200, Thomas Weißschuh wrote: > On 2024-06-13 19:44:22+0000, Niklas Cassel wrote: > > On Thu, Jun 13, 2024 at 07:33:53PM +0200, Niklas Cassel wrote: > > > > > > This is however wrong. See "20-082r23SPC-6: Removable Medium Bit > > > Expectations" which has since been integrated to SPC, which states that: > > > > > > """ > > > Reports have been received that some USB Memory Stick device servers set > > > the removable medium (RMB) bit to one. The rub comes when the medium is > > > actually removed, because... The device server is removed concurrently > > > with the medium removal. If there is no device server, then there is no > > > device server that is waiting to have removable medium inserted. > > > > > > Sufficient numbers of SCSI analysts see such a device: > > > - not as a device that supports removable medium; > > > but > > > - as a removable, hot pluggable device. > > > """ > > > > > > The definition of the RMB bit in the SPC specification has since been > > > clarified to match this. > > > > > > Thus, a USB stick should not have the RMB bit set (and neither shall an > > > eSATA nor a hot-plug capable port). > > > > Since SPC-6 does make it quite clear that USB Memory Stick device servers > > should not have the RMB bit set, Thomas, may I ask what udisks is using to > > automount USB sticks? > > As also mentioned at [0]: > > /* Provide easy access to _only_ the following devices > * > * - anything connected via known local buses (e.g. USB or Firewire, MMC or MemoryStick) > * - any device with removable media > * > * Be careful when extending this list as we don't want to automount > * the world when (inadvertently) connecting to a SAN. > */ > > From [1] > [1] https://github.com/storaged-project/udisks/blob/8821a7808880ea37cdb299647c38f3a5ceb3d72a/src/udiskslinuxblock.c#L860 Unfortunately I can't find the definition of udisks_drive_get_media_removable(). But looking at the name, I'm assuming that it checks if the _media_ is removable, i.e. CD-ROM and floppy, etc., and not if the device is removable/hot-pluggable. So I think that the patch in $subject is the way to go. Kind regards, Niklas