Bug 315065

Summary: Device notifier doesn't show any attached USB pen drives
Product: [Unmaintained] plasma4 Reporter: Eric Donkersloot <eric.donkersloot>
Component: widget-devicenotifierAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED WORKSFORME    
Severity: normal CC: aaron, bendertron, cfeck, eric.donkersloot, gtwilliams, kevin.kofler, knizek, krnekit, lenharo, lukas, wilderkde
Priority: NOR    
Version: 4.10.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
URL: http://ompldr.org/vaGc2ZQ/device_notifier.png
Latest Commit: Version Fixed In: 4.10.1
Sentry Crash Report:
Attachments: devices absence in device notifier

Description Eric Donkersloot 2013-02-13 13:23:08 UTC
Hi,

When I plug in a USB pen drive, device notifier doesn't pop up with the usual options. Thus I can only mount the drive manually. However, it works fine when I attach an external HDD via USB.
When I click on the (hidden) device notifier icon, I see 'No devices available'.
This used to work fine in KDE 4.9.x.

Reproducible: Always

Steps to Reproduce:
1. Attach a USB pen drive
2. Wait for device notifier to pop up with the usual options
3. Nothing happens
Actual Results:  
Device notifier is not popping up, thus I can only mount the USB pen drive manually.

Expected Results:  
Device notifier should pop up with the usual options.
Comment 1 Ivan Savyhin 2013-02-14 08:13:49 UTC
Created attachment 77280 [details]
devices absence in device notifier
Comment 2 Ivan Savyhin 2013-02-14 08:16:57 UTC
Same strange thing happens in Gentoo with kde 4.10.0. Device notifier doesn't show my devices, that emulate a few storage devices, neither my phone nor ebook reader (see the attachment). But if i plug phone before i login to kde, device notifier does show the device.
Comment 3 Eric Donkersloot 2013-02-15 09:51:00 UTC
Could this be related to the type of partition present on the USB pen drive? I've just formatted one of my usb pen drives  and created 1 exfat partition and the drive now pops up in device notifier.
Before I reformatted the drive, an ISO image had been written to the USB drive.
Comment 4 Aaron Luchko 2013-02-17 00:43:09 UTC
This sounds like a bug I've encountered on Fedora 18 KDE 4.9.5-1.

https://bugzilla.redhat.com/show_bug.cgi?id=911959

Since updating to Fedora 18 the KDE device notifier is unable to detect the my Samsung Galaxy S when the USB storage is turned on.

Any other USB devices or smart disks don't have a problem, and the phone still mounts on a different system running Fedora 17 (can't remember the KDE version). GNOME is also able to detect the phone and mounts all the attached devices on login. As well the phone can be mounted manually via udisks --mount

How reproducible:
Always

Steps to Reproduce:
1. Plug in phone
2. Turn on USB storage on phone
3. Device notifier doesn't detect it
  
Additional info:

This is the annotated output of udisks --monitor
# Phone is plugged in
added:     /org/freedesktop/UDisks/devices/sr1 # not sure what this is
changed:     /org/freedesktop/UDisks/devices/sr1
added:     /org/freedesktop/UDisks/devices/sdj # external microSD card in phone
added:     /org/freedesktop/UDisks/devices/sdi # main phone memory
changed:     /org/freedesktop/UDisks/devices/sdi
changed:     /org/freedesktop/UDisks/devices/sdi
changed:     /org/freedesktop/UDisks/devices/sdj
changed:     /org/freedesktop/UDisks/devices/sdj

# Phone is told to connect to USB, at this point the device notifier should detect it, it doesn't
changed:     /org/freedesktop/UDisks/devices/sdi
changed:     /org/freedesktop/UDisks/devices/sdj
changed:     /org/freedesktop/UDisks/devices/sdi
changed:     /org/freedesktop/UDisks/devices/sdj


Also of note, if the devices are mounted in GNOME they remain mounted and visible in the KDE device notifier. But if they are then unmounted using the KDE device notifier they will remain visible in the notifier menu (as unmounted devices) but will be unable to be remounted.

They are also invisible to Dolphin (at least once unmounted).
Comment 5 Marcos A. Lenharo 2013-02-17 06:38:58 UTC
The same is happening on my Arch Linux after udisks2/KDE update.
Device notifier does not show storage from my phone, but it is displayed and accessible in Dolphin.

The "udisksctl monitor" output is the following:
03:34:00.352: The udisks-daemon is running (name-owner :1.17).
03:34:04.840: Added /org/freedesktop/UDisks2/block_devices/sdb
  org.freedesktop.UDisks2.Block:
    Configuration:              []
    CryptoBackingDevice:        '/'
    Device:                     /dev/sdb
    DeviceNumber:               2064
    Drive:                      '/org/freedesktop/UDisks2/drives/Motorola_A953_0263C70A5701A040'
    HintAuto:                   true
    HintIconName:               
    HintIgnore:                 false
    HintName:                   
    HintPartitionable:          true
    HintSystem:                 false
    IdLabel:                    
    IdType:                     
    IdUUID:                     
    IdUsage:                    
    IdVersion:                  
    PreferredDevice:            /dev/sdb
    ReadOnly:                   false
    Size:                       0
    Symlinks:                   /dev/disk/by-id/usb-Motorola_A953_0263C70A5701A040-0:0
                                /dev/disk/by-path/pci-0000:00:1a.0-usb-0:1.1:1.0-scsi-0:0:0:0
03:34:13.775: Removed /org/freedesktop/UDisks2/block_devices/sdb
03:34:15.112: Added /org/freedesktop/UDisks2/block_devices/sdb
  org.freedesktop.UDisks2.Block:
    Configuration:              []
    CryptoBackingDevice:        '/'
    Device:                     /dev/sdb
    DeviceNumber:               2064
    Drive:                      '/org/freedesktop/UDisks2/drives/Motorola_A953_0263C70A5701A040'
    HintAuto:                   true
    HintIconName:               
    HintIgnore:                 false
    HintName:                   
    HintPartitionable:          true
    HintSystem:                 false
    IdLabel:                    
    IdType:                     
    IdUUID:                     
    IdUsage:                    
    IdVersion:                  
    PreferredDevice:            /dev/sdb
    ReadOnly:                   false
    Size:                       0
    Symlinks:                   /dev/disk/by-id/usb-Motorola_A953_0263C70A5701A040-0:0
                                /dev/disk/by-path/pci-0000:00:1a.0-usb-0:1.1:1.0-scsi-0:0:0:0
03:34:34.642: /org/freedesktop/UDisks2/block_devices/sdb: Added interface org.freedesktop.UDisks2.Filesystem
  MountPoints:          
03:34:34.644: /org/freedesktop/UDisks2/drives/Motorola_A953_0263C70A5701A040: org.freedesktop.UDisks2.Drive: Properties Changed
  TimeMediaDetected:            1361082874638566
  MediaAvailable:               true
  Size:                         7948139520
03:34:34.645: /org/freedesktop/UDisks2/block_devices/sdb: org.freedesktop.UDisks2.Block: Properties Changed
  IdUUID:               38C2-5724
  IdLabel:              MYUSB
  IdVersion:            FAT32
  IdType:               vfat
  IdUsage:              filesystem
  Size:                 7948139520
  Symlinks:             /dev/disk/by-id/usb-Motorola_A953_0263C70A5701A040-0:0
                        /dev/disk/by-label/MYUSB
                        /dev/disk/by-path/pci-0000:00:1a.0-usb-0:1.1:1.0-scsi-0:0:0:0
                        /dev/disk/by-uuid/38C2-5724
Comment 6 Jacopo De Simoi 2013-02-18 08:32:14 UTC
Hi,

could you please attach the output of solid-hardware details with your usb pen plugged in? 
Thanks a lot
 __J
(In reply to comment #0)
> Hi,
> 
> When I plug in a USB pen drive, device notifier doesn't pop up with the
> usual options. Thus I can only mount the drive manually. However, it works
> fine when I attach an external HDD via USB.
> When I click on the (hidden) device notifier icon, I see 'No devices
> available'.
> This used to work fine in KDE 4.9.x.
> 
> Reproducible: Always
> 
> Steps to Reproduce:
> 1. Attach a USB pen drive
> 2. Wait for device notifier to pop up with the usual options
> 3. Nothing happens
> Actual Results:  
> Device notifier is not popping up, thus I can only mount the USB pen drive
> manually.
> 
> Expected Results:  
> Device notifier should pop up with the usual options.
Comment 7 Eric Donkersloot 2013-02-18 10:59:05 UTC
udi = '/org/freedesktop/UDisks2/drives/Imation_Nano_07A408033B3F3285'
"/org/freedesktop/UDisks2/drives/Imation_Nano_07A408033B3F3285" : property "Drive" does not exist 
"/org/freedesktop/UDisks2/drives/Imation_Nano_07A408033B3F3285" : property "Table" does not exist 
  parent = '/org/freedesktop/UDisks2'  (string)
  vendor = 'Imation'  (string)
  product = 'Nano'  (string)
"/org/freedesktop/UDisks2/drives/Imation_Nano_07A408033B3F3285" : property "DeviceNumber" does not exist 
"/org/freedesktop/UDisks2/drives/Imation_Nano_07A408033B3F3285" : property "Device" does not exist 
  description = 'Imation Nano'  (string)
  Block.major = 8  (0x8)  (int)
  Block.minor = 33  (0x21)  (int)
  Block.device = '/dev/sdc1'  (string)
  StorageDrive.bus = 'Usb'  (0x1)  (enum)
  StorageDrive.driveType = 'HardDisk'  (0x0)  (enum)
  StorageDrive.removable = true  (bool)
  StorageDrive.hotpluggable = true  (bool)
  StorageDrive.inUse = false  (bool)
  StorageDrive.size = 4007657472  (0xeee00000)  (qulonglong)
Comment 8 Lukáš Tinkl 2013-02-18 15:36:06 UTC
This will be fixed in 4.10.1 with this commit: http://commits.kde.org/kdelibs/86931fe1fdf753d783d0013d95fa2a46a257658d
Comment 9 Ivan Savyhin 2013-02-19 14:23:44 UTC
I've tried to patch kdelibs-4.10.0 in gentoo, but patch doesn't seem to work properly. Device notifer does show multilun devices, but reports, that devices have 0 bytes capacity.
Are any additional changes in kdelibs-4.10.0 require to work notifier properly?
Comment 10 Christoph Feck 2013-02-24 15:29:30 UTC
Reopening based on comment #9.
Comment 11 Lukáš Tinkl 2013-02-24 19:21:33 UTC
That bug is in soliddevice dataengine or in the device notifier plasmoid.
Comment 12 Lukáš Tinkl 2013-03-06 11:28:35 UTC
*** Bug 314705 has been marked as a duplicate of this bug. ***
Comment 13 Lukáš Tinkl 2013-03-06 11:31:05 UTC
For the 0-size bug in Device Notifier, you should get this patch for kde-workspace:
http://commits.kde.org/kde-workspace/b4096a222ca5a3e3412186dade4e8bee22e9e1d3
Comment 14 Eric Donkersloot 2013-03-06 11:54:46 UTC
This bug is still present in 4.10.1:

[ericd@vaiopro13 ~]$ udisksctl status
MODEL                     REVISION  SERIAL               DEVICE
--------------------------------------------------------------------------
TOSHIBA MK5059GSXP        GT001H    91JJC2UAT            sda     
MATSHITADVD-RAM UJ8A2AS   1.20      WK94_261028          sr0     
Generic- SD/MMC           1.00                           sdb     
Imation Nano              PMAP      07A408033B3F3285     sdc

[ericd@vaiopro13 ~]$ sudo fdisk -l /dev/sdc

Disk /dev/sdc: 4007 MB, 4007657472 bytes, 7827456 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x5d256826

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           0     2247743     1123872   17  Hidden HPFS/NTFS

[ericd@vaiopro13 ~]$ solid-hardware details '/org/freedesktop/UDisks2/drives/Imation_Nano_07A408033B3F3285'
udi = '/org/freedesktop/UDisks2/drives/Imation_Nano_07A408033B3F3285'
"/org/freedesktop/UDisks2/drives/Imation_Nano_07A408033B3F3285" : property "Drive" does not exist 
"/org/freedesktop/UDisks2/drives/Imation_Nano_07A408033B3F3285" : property "Table" does not exist 
  parent = '/org/freedesktop/UDisks2'  (string)
  vendor = 'Imation'  (string)
  product = 'Nano'  (string)
"/org/freedesktop/UDisks2/drives/Imation_Nano_07A408033B3F3285" : property "DeviceNumber" does not exist 
"/org/freedesktop/UDisks2/drives/Imation_Nano_07A408033B3F3285" : property "Device" does not exist 
  description = 'Imation Nano'  (string)
  Block.major = 8  (0x8)  (int)
  Block.minor = 33  (0x21)  (int)
  Block.device = '/dev/sdc1'  (string)
  StorageDrive.bus = 'Usb'  (0x1)  (enum)
  StorageDrive.driveType = 'HardDisk'  (0x0)  (enum)
  StorageDrive.removable = true  (bool)
  StorageDrive.hotpluggable = true  (bool)
  StorageDrive.inUse = false  (bool)
  StorageDrive.size = 4007657472  (0xeee00000)  (qulonglong)
Comment 15 Lukáš Tinkl 2013-03-06 13:44:49 UTC
Please post the relevant part from "udisksctl dump", thanks
Comment 16 Eric Donkersloot 2013-03-06 19:18:10 UTC
/org/freedesktop/UDisks2/block_devices/sdc:
  org.freedesktop.UDisks2.Block:
    Configuration:              []
    CryptoBackingDevice:        '/'
    Device:                     /dev/sdc
    DeviceNumber:               2080
    Drive:                      '/org/freedesktop/UDisks2/drives/Imation_Nano_07A408033B3F3285'
    HintAuto:                   true
    HintIconName:               
    HintIgnore:                 false
    HintName:                   
    HintPartitionable:          true
    HintSystem:                 false
    IdLabel:                    MJRO_084
    IdType:                     iso9660
    IdUUID:                     2013-02-24-20-33-58-00
    IdUsage:                    filesystem
    IdVersion:                  
    PreferredDevice:            /dev/sdc
    ReadOnly:                   false
    Size:                       4007657472
    Symlinks:                   /dev/disk/by-id/usb-Imation_Nano_07A408033B3F3285-0:0
                                /dev/disk/by-label/MJRO_084
                                /dev/disk/by-path/pci-0000:00:1d.0-usb-0:1.2:1.0-scsi-0:0:0:0
                                /dev/disk/by-uuid/2013-02-24-20-33-58-00
  org.freedesktop.UDisks2.PartitionTable:
    Type:               dos

org/freedesktop/UDisks2/block_devices/sdc1:
  org.freedesktop.UDisks2.Block:
    Configuration:              []
    CryptoBackingDevice:        '/'
    Device:                     /dev/sdc1
    DeviceNumber:               2081
    Drive:                      '/org/freedesktop/UDisks2/drives/Imation_Nano_07A408033B3F3285'
    HintAuto:                   true
    HintIconName:               
    HintIgnore:                 true
    HintName:                   
    HintPartitionable:          true
    HintSystem:                 false
    IdLabel:                    MJRO_084
    IdType:                     iso9660
    IdUUID:                     2013-02-24-20-33-58-00
    IdUsage:                    filesystem
    IdVersion:                  
    PreferredDevice:            /dev/sdc1
    ReadOnly:                   false
    Size:                       1150844928
    Symlinks:                   /dev/disk/by-id/usb-Imation_Nano_07A408033B3F3285-0:0-part1
                                /dev/disk/by-label/MJRO_084
                                /dev/disk/by-path/pci-0000:00:1d.0-usb-0:1.2:1.0-scsi-0:0:0:0-part1
                                /dev/disk/by-uuid/2013-02-24-20-33-58-00
  org.freedesktop.UDisks2.Filesystem:
    MountPoints:        
  org.freedesktop.UDisks2.Partition:
    Flags:              128
    IsContained:        false
    IsContainer:        false
    Name:               
    Number:             1
    Offset:             0
    Size:               1150844928
    Table:              '/org/freedesktop/UDisks2/block_devices/sdc'
    Type:               0x17
    UUID:
Comment 17 Milan Knížek 2013-03-10 09:17:16 UTC
I am following this bug for a few weeks - may this be related to the bug of Amarok not getting aware of connected USB storage devices? (It appeared for the first time in 4.10.0.)

Now, in 4.10.1 the notifier is aware [1] about both internal and external sd cards of Samsung Galaxy S (i9000) and I can mount them, however Amarok still does not "see" them.

[1] internal sd card is reported with "0 size", while external one is reported correctly. I have not tried the patch linked in Comment 13 yet.
Comment 18 Garry Williams 2013-03-10 22:16:49 UTC
Cannot reproduce with 4.10.1-1, Fedora F18.

(I plugged in an old SanDisk Cruzer Mini.  Notification as expected.)
Comment 20 Garry Williams 2013-03-11 01:57:49 UTC
I cannot reproduce with these installed and Selinux set to enforcing (as usual!):

garry@vfr$ rpm -qa|grep udisk
udisks-1.0.4-8.fc18.x86_64
libudisks2-2.0.1-1.fc18.x86_64
udisks2-2.0.1-1.fc18.x86_64
garry@vfr$ rpm -qa|grep selinux
libselinux-2.1.12-7.1.fc18.x86_64
selinux-policy-devel-3.11.1-82.fc18.noarch
selinux-policy-targeted-3.11.1-82.fc18.noarch
libselinux-python-2.1.12-7.1.fc18.x86_64
selinux-policy-doc-3.11.1-82.fc18.noarch
libselinux-utils-2.1.12-7.1.fc18.x86_64
selinux-policy-3.11.1-82.fc18.noarch
garry@vfr$
Comment 21 Colin J Thomson 2013-03-15 20:28:10 UTC
It is not a Selinux issue on this box, or KDE either (I think) as I installed another DE with the same results of wanting Admins PW to access the drive.  I have even tried Selinux in permissive mode to make sure and there is nothing in the logs, FYI:

selinux-policy-3.11.1-85
udisks2-2.0.1-1.fc18.x86_64
libudisks2-2.0.1-1.fc18.x86_64
udisks-1.0.4-8.fc18.x86_64
polkit-kde-0.99.0-5.fc18.x86_64
polkit-qt-0.103.0-4.fc18.x86_64
lxpolkit-0.1.0-4.fc18.x86_64
polkit-0.107-4.fc18.x86_64

When I plug in my USB drive I can see it in Dolphin as a USB Pen Drive but I am asked for the root PW when I try to access it:-
"Authentication is required to mount /dev/mapper/mapthb1 - PolicyKit1 -KDE"

I can use the drive after entering the PW, however it still does not show up in the device notifier. I wonder if this permission problem maybe the cause of the Device Notifier not showing  the Drive.

F18 - KDE SC  4.10.1
Comment 22 Nikita Krupenko 2013-03-15 20:36:34 UTC
I must notice, that Mageia with Gnome 3 recognize my phone and mount it and KDE version is not.
Comment 23 Colin J Thomson 2013-03-15 20:51:32 UTC
I should add that other devices, DVD, USB PTP camera and USB mp3 player are seen in the device notifier and accessed fine as a normal user.
Comment 24 Kevin Kofler 2013-03-17 02:31:38 UTC
The device in comment #21 is probably detected as internal because of the /dev/mapper/* device name. Please file a bug against udisks (2) at https://bugs.freedesktop.org/ for that one.
Comment 25 Nikita Krupenko 2013-03-17 13:32:36 UTC
Since updatting to KDE 4.10.1 my Motorola E8 phone detected and notifications appears both in MTP and in disk modes.
Also Amarok now see the device, if it is mounted.
Comment 26 Colin J Thomson 2013-03-23 10:36:42 UTC
(In reply to comment #24)
> The device in comment #21 is probably detected as internal because of the
> /dev/mapper/* device name. Please file a bug against udisks (2) at
> https://bugs.freedesktop.org/ for that one.

Done:

https://bugs.freedesktop.org/show_bug.cgi?id=62662
Comment 27 Colin J Thomson 2013-03-23 17:40:33 UTC
It turns out device-mapper-multipath or a config file where possibly corrupt,  I removed the associated files and installed device-mapper-multipath again and everything is working fine now.