Bug 93789 - Fixed drives incorrectly identified as removable.
Summary: Fixed drives incorrectly identified as removable.
Status: RESOLVED NOTOURBUG
Alias: None
Product: udisks
Classification: Unclassified
Component: detection (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Martin Pitt
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-20 12:36 UTC by Paul
Modified: 2016-03-02 16:47 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Paul 2016-01-20 12:36:19 UTC
Udisks2 appears to be incorrectly detecting drives as removable/ejectable.

I reported a bug against KDE's plasma5 Device Notifier https://bugs.kde.org/show_bug.cgi?id=358085 in which a developer indicated this may be a udisks bug, (comment 6).

I don't know if this is a bug with udisks2 per se, but there is a difference between udisks2 2.1.5 which correctly detects as fixed/non-ejectable, and 2.1.6 which indicates removable/ejectable. As can be seen from the following section of the output of udisksctl dump (this is the same physical drive in both cases).



Using udisks2 V2.1.5 

/org/freedesktop/UDisks2/drives/Corsair_Force_LS_140681530000994605e6:
  org.freedesktop.UDisks2.Drive:
    CanPowerOff:                false
    Configuration:              {}
    ConnectionBus:              
    Ejectable:                  false
    Id:                         Corsair-Force-LS-140681530000994605e6
    Media:                      
    MediaAvailable:             true
    MediaChangeDetected:        true
    MediaCompatibility:         
    MediaRemovable:             false
    Model:                      Corsair Force LS
    Optical:                    false
    OpticalBlank:               false
    OpticalNumAudioTracks:      0
    OpticalNumDataTracks:       0
    OpticalNumSessions:         0
    OpticalNumTracks:           0
    Removable:                  false
    Revision:                   06.5
    RotationRate:               0
    Seat:                       seat0
    Serial:                     140681530000994605e6
    SiblingId:                  
    Size:                       60021399040
    SortKey:                    00coldplug/00fixed/sd____a
    TimeDetected:               1453290050632257
    TimeMediaDetected:          1453290050632257
    Vendor:                     
    WWN:                        



Using udisks2 V2.1.6

/org/freedesktop/UDisks2/drives/Corsair_Force_LS_140681530000994605e6:
  org.freedesktop.UDisks2.Drive:
    CanPowerOff:                false
    Configuration:              {}
    ConnectionBus:              
    Ejectable:                  true
    Id:                         Corsair-Force-LS-140681530000994605e6
    Media:                      
    MediaAvailable:             true
    MediaChangeDetected:        true
    MediaCompatibility:         
    MediaRemovable:             true
    Model:                      Corsair Force LS
    Optical:                    false
    OpticalBlank:               false
    OpticalNumAudioTracks:      0
    OpticalNumDataTracks:       0
    OpticalNumSessions:         0
    OpticalNumTracks:           0
    Removable:                  true
    Revision:                   06.5
    RotationRate:               0
    Seat:                       seat0
    Serial:                     140681530000994605e6
    SiblingId:                  
    Size:                       60021399040
    SortKey:                    00coldplug/12removable/sd____a
    TimeDetected:               1453290911331475
    TimeMediaDetected:          1453290911331475
    Vendor:                     
    WWN:
Comment 1 Martin Pitt 2016-02-29 16:20:55 UTC
Are you sure that the only thing that changed there was udisks? This attribute is mostly just mirroring /sys/block/*/removable, it just applies additional udev rules where you can override the kernel detection. Neither the code nor the udev rules changed between 2.1.5 and 2.1.6.

Can you please check /sys/block/*/removable on your system for your device?
Comment 2 Paul 2016-02-29 18:39:47 UTC
(In reply to Martin Pitt from comment #1)
> Are you sure that the only thing that changed there was udisks? 

No, I'm not sure :) - I was pointed to udisks by a plasma5 developer.

> Can you please check /sys/block/*/removable on your system for your device?

Booting with the system using udisks 2.1.6, for the Corsair-Force-LS (which is a fixed drive):

"cat /sys/block/sda/removable" returns "1" (which I assume means removable).

> Neither the code nor the udev rules changed between 2.1.5 and 2.1.6.

OK, so I guess I need to look elsewhere.
Comment 3 Martin Pitt 2016-02-29 19:42:14 UTC
> "cat /sys/block/sda/removable" returns "1" (which I assume means removable).

Correct. This means that the device claims that it has removable media. If this is an internal SSD, this is indeed wrong. Can you file a bug against the kernel, with the complete contents of /sys/block/* for that drive?
Comment 4 Paul 2016-03-01 10:55:12 UTC
(In reply to Martin Pitt from comment #3)

> If this is an internal SSD, this is indeed wrong. 

Yes, it is; also on the same machine a second SSD and a conventional HDD are being reported as removable.

> Can you file a bug against the kernel, 

OK, I'll do that.

> with the complete contents of /sys/block/* for that drive?

(Shows ignorance...) Is there an "easy way" to list the entire contents, or do I have to "cat" each entry... ?

Thanks :)
Comment 5 Martin Pitt 2016-03-01 11:55:07 UTC
> Is there an "easy way" to list the entire contents

This works quite well:

  grep -r . /sys/block/sda

(replace "sda" with the actual drive, of course). This is quite nice as it lists the attribute names and their values.
Comment 6 Paul 2016-03-01 12:13:52 UTC
OK. Nice one. Many thanks.
Comment 7 Paul 2016-03-02 16:47:48 UTC
Just for information:

Eventually arrived at this existing bug report.

https://bugzilla.kernel.org/show_bug.cgi?id=111651


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.