Leap 42.2 demands root password to mount some (not all) USB flash drives

I have a fresh install of Leap 42.2, using KDE. I also still have installs of 13.1 and Leap 42.1 on the same system.

I have several USB flash drives. They are various sizes, but all are formatted FAT32 and all are detected by the device notifier in 13.1 and Leap 42.1 and can be mounted without a root password.

In Leap 42.2, however, some of the flash drives work as expected, but three of them don’t. Two aren’t detected by the device notifier at all, but if I open Dolphin, it does list USB DISK in the filesystem. If I try to mount those drives, Dolphin prompts me for the root password, and they do mount. The third drive is even weirder: the device notifier detects it, but gives me a message saying I can’t mount it without root permissions. But if I click on that message in the device notifier, it goes ahead and mounts it without asking for the root password.

Any ideas?

Lots of views, no answers. Not very encouraging.

Googling brought up lots of posts about not being able to mount any USB drive without the root password, but nothing like my problem. I did, however, find a thread on the Gentoo forum where the user had posted output from udisksctl monitor as part of the troubleshooting process. That seemed like it might be useful, so I tried it with a “good” flash drive and a “bad” one.

Good flash drive (detected by device notifier and can be mounted as user)

14:00:40.267: The udisks-daemon is running (name-owner :1.19).
14:00:55.354: Added /org/freedesktop/UDisks2/drives/USB_DISK_3_2e0
  org.freedesktop.UDisks2.Drive:
    CanPowerOff:                true
    Configuration:              {}
    ConnectionBus:              usb
    Ejectable:                  true
    Id:                         
    Media:                      
    MediaAvailable:             true
    MediaChangeDetected:        true
    MediaCompatibility:         
    MediaRemovable:             true
    Model:                      USB DISK 3.0
    Optical:                    false
    OpticalBlank:               false
    OpticalNumAudioTracks:      0
    OpticalNumDataTracks:       0
    OpticalNumSessions:         0
    OpticalNumTracks:           0
    Removable:                  true
    Revision:                   PMAP
    RotationRate:               -1
    Seat:                       seat0
    Serial:                     
    SiblingId:                  /sys/devices/pci0000:00/0000:00:16.2/usb5/5-3/5-3:1.0
    Size:                       15854469120
    SortKey:                    01hotplug/1484424055351567
    TimeDetected:               1484424055351567
    TimeMediaDetected:          1484424055351567
    Vendor:                     
    WWN:                        
14:00:55.356: Added /org/freedesktop/UDisks2/block_devices/sdd
  org.freedesktop.UDisks2.Block:
    Configuration:              ]
    CryptoBackingDevice:        '/'
    Device:                     /dev/sdd
    DeviceNumber:               2096
    Drive:                      '/org/freedesktop/UDisks2/drives/USB_DISK_3_2e0'
    HintAuto:                   true
    HintIconName:               
    HintIgnore:                 false
    HintName:                   
    HintPartitionable:          true
    HintSymbolicIconName:       
    HintSystem:                 false
    Id:                         
    IdLabel:                    
    IdType:                     
    IdUUID:                     
    IdUsage:                    
    IdVersion:                  
    MDRaid:                     '/'
    MDRaidMember:               '/'
    PreferredDevice:            /dev/sdd
    ReadOnly:                   false
    Size:                       15854469120
    Symlinks:                   /dev/disk/by-id/usb-_USB_DISK_3.0_070163160FCE6E79-0:0
                                /dev/disk/by-path/pci-0000:00:16.2-usb-0:3:1.0-scsi-0:0:0:0
  org.freedesktop.UDisks2.PartitionTable:
    Type:               dos
14:00:55.412: Added /org/freedesktop/UDisks2/block_devices/sdd1
  org.freedesktop.UDisks2.Block:
    Configuration:              ]
    CryptoBackingDevice:        '/'
    Device:                     /dev/sdd1
    DeviceNumber:               2097
    Drive:                      '/org/freedesktop/UDisks2/drives/USB_DISK_3_2e0'
    HintAuto:                   true
    HintIconName:               
    HintIgnore:                 false
    HintName:                   
    HintPartitionable:          true
    HintSymbolicIconName:       
    HintSystem:                 false
    Id:                         by-uuid-992F-0D0B
    IdLabel:                    USB DISK
    IdType:                     vfat
    IdUUID:                     992F-0D0B
    IdUsage:                    filesystem
    IdVersion:                  FAT32
    MDRaid:                     '/'
    MDRaidMember:               '/'
    PreferredDevice:            /dev/sdd1
    ReadOnly:                   false
    Size:                       15850340352
    Symlinks:                   /dev/disk/by-id/usb-_USB_DISK_3.0_070163160FCE6E79-0:0-part1
                                /dev/disk/by-label/USB\x20DISK
                                /dev/disk/by-path/pci-0000:00:16.2-usb-0:3:1.0-scsi-0:0:0:0-part1
                                /dev/disk/by-uuid/992F-0D0B
  org.freedesktop.UDisks2.Filesystem:
    MountPoints:        
  org.freedesktop.UDisks2.Partition:
    Flags:              0
    IsContained:        false
    IsContainer:        false
    Name:               
    Number:             1
    Offset:             4128768
    Size:               15850340352
    Table:              '/org/freedesktop/UDisks2/block_devices/sdd'
    Type:               0x0c
    UUID:               992f0d0b-01
14:01:09.284: Removed /org/freedesktop/UDisks2/block_devices/sdd1
14:01:09.285: Removed /org/freedesktop/UDisks2/block_devices/sdd
14:01:09.286: Removed /org/freedesktop/UDisks2/drives/USB_DISK_3_2e0
14:01:28.691: /org/freedesktop/UDisks2/drives/SanDisk_SDSSDH21_130667401722: org.freedesktop.UDisks2.Drive.Ata: Properties Changed
  SmartUpdated:         1484424088
14:01:28.754: /org/freedesktop/UDisks2/drives/SanDisk_SDSSDA24_161627400789: org.freedesktop.UDisks2.Drive.Ata: Properties Changed
  SmartUpdated:         1484424088
14:01:29.144: /org/freedesktop/UDisks2/drives/ST1000DM003_9YN1_S1D0FQMJ: org.freedesktop.UDisks2.Drive.Ata: Properties Changed
  SmartUpdated:         1484424089

**
Bad flash drive (isn’t detected by device notifier and can only be mounted with root password)**

14:02:43.123: The udisks-daemon is running (name-owner :1.19).
14:02:51.548: Added /org/freedesktop/UDisks2/block_devices/sdd
  org.freedesktop.UDisks2.Block:
    Configuration:              ]
    CryptoBackingDevice:        '/'
    Device:                     /dev/sdd
    DeviceNumber:               2096
    Drive:                      '/'
    HintAuto:                   false
    HintIconName:               
    HintIgnore:                 false
    HintName:                   
    HintPartitionable:          true
    HintSymbolicIconName:       
    HintSystem:                 true
    Id:                         by-id-usb-__07015AD98D271960-0:0
    IdLabel:                    
    IdType:                     
    IdUUID:                     
    IdUsage:                    
    IdVersion:                  
    MDRaid:                     '/'
    MDRaidMember:               '/'
    PreferredDevice:            /dev/sdd
    ReadOnly:                   false
    Size:                       7927234560
    Symlinks:                   /dev/disk/by-id/usb-__07015AD98D271960-0:0
                                /dev/disk/by-path/pci-0000:00:16.2-usb-0:3:1.0-scsi-0:0:0:0
  org.freedesktop.UDisks2.PartitionTable:
    Type:               dos
14:02:51.600: Added /org/freedesktop/UDisks2/block_devices/sdd1
  org.freedesktop.UDisks2.Block:
    Configuration:              ]
    CryptoBackingDevice:        '/'
    Device:                     /dev/sdd1
    DeviceNumber:               2097
    Drive:                      '/'
    HintAuto:                   false
    HintIconName:               
    HintIgnore:                 false
    HintName:                   
    HintPartitionable:          true
    HintSymbolicIconName:       
    HintSystem:                 true
    Id:                         by-id-usb-__07015AD98D271960-0:0-part1
    IdLabel:                    USB DISK
    IdType:                     vfat
    IdUUID:                     498B-5BF0
    IdUsage:                    filesystem
    IdVersion:                  FAT32
    MDRaid:                     '/'
    MDRaidMember:               '/'
    PreferredDevice:            /dev/sdd1
    ReadOnly:                   false
    Size:                       7923105792
    Symlinks:                   /dev/disk/by-id/usb-__07015AD98D271960-0:0-part1
                                /dev/disk/by-label/USB\x20DISK
                                /dev/disk/by-path/pci-0000:00:16.2-usb-0:3:1.0-scsi-0:0:0:0-part1
                                /dev/disk/by-uuid/498B-5BF0
  org.freedesktop.UDisks2.Filesystem:
    MountPoints:        
  org.freedesktop.UDisks2.Partition:
    Flags:              0
    IsContained:        false
    IsContainer:        false
    Name:               
    Number:             1
    Offset:             4128768
    Size:               7923105792
    Table:              '/org/freedesktop/UDisks2/block_devices/sdd'
    Type:               0x0c
    UUID:               498b5bf0-01
14:03:00.643: Removed /org/freedesktop/UDisks2/block_devices/sdd1
14:03:00.644: Removed /org/freedesktop/UDisks2/block_devices/sdd

The difference is pretty obvious–the “bad” drive is missing a whole section at the beginning–the part where the “good” drive is detected as a drive.

It seems the problem is that the “bad” drive isn’t detected as a drive, but I have no idea why or what to do about it. I’m hoping someone more knowledgeable can figure it out.

The “bad” drive is detected as fixed (“internal”) disk, not as external/removable.

To make it possible to mount it without root password, add the following to /etc/polkit-default-privs.local:

org.freedesktop.udisks2.filesystem-mount-system yes

And run “set_polkit_default_privs” afterwards to apply the change.

Or add it to your fstab (with the “users” mount option).

I cannot tell you why that happens though.
Maybe some “broken” udev rule.

A known issue since kernel 4.4.0 apparently (involving changes to libata-scsi.c and affecting some hardware)…

https://bugzilla.kernel.org/show_bug.cgi?id=111651
https://bugzilla.opensuse.org/show_bug.cgi?id=968930
https://bugs.freedesktop.org/show_bug.cgi?id=94023

That didn’t work. I haven’t tried adding it to fstab, and I’d rather not do that. It works in older versions of openSUSE on the same hardware.

Those aren’t the same problem–they’re the opposite, internal hard drives being detected as removable. My problem is some USB flash drives not being detected as removable.

Sorry, I spoke too soon. It worked after rebooting. The device notifier still doesn’t recognize it at all, but I can mount it from a file manager just by double-clicking (I’m lazy), so that’s good. The fact that it’s not working as it does in my other openSUSE installs still worries me, though. I can’t help but wonder if something just went wrong on the initial install of 42.2, especially since it seems no one else has run into this problem. I’m tempted to try installing again before I spend a lot of time configuring things to my liking.

After making the polkit changes, logging out and back in would have been sufficient.

The device notifier still doesn’t recognize it at all, but I can mount it from a file manager just by double-clicking (I’m lazy), so that’s good. The fact that it’s not working as it does in my other openSUSE installs still worries me, though. I can’t help but wonder if something just went wrong on the initial install of 42.2, especially since it seems no one else has run into this problem. I’m tempted to try installing again before I spend a lot of time configuring things to my liking.

I had a Kingston device that behaved a bit like that (ie reported by udisksctl but no notifier), but after reformatting it again the notifier then handled it as expected. What does the following report with respect to this device?

blkid

It reports

/dev/sdd1: LABEL="USB DISK" UUID="498B-5BF0" TYPE="vfat" PARTUUID="498b5bf0-01"

lsusb identifies it as a Kingston, though it’s not distributed under that name (it’s a store brand):

Bus 005 Device 003: ID 13fe:5500 Kingston Technology Company Inc. 

I didn’t have anything important on that drive, so I tried reformatting it, but it didn’t help.

I’m suspicious of the partitioning table here… I would have expected (for a single partitioned device) that it should show up as /dev/sdd, rather than /dev/sdd1.

Being careful of the device in question, try erasing the partition table completely with

sudo dd if=/dev/zero of=/dev/sdX bs=512 count=1

where X pertains to the Kingston device in question

then format it with

sudo mkfs.vfat -I /dev/sdX

Does the device behave differently then?

Device notifier still doesn’t see it. The unmounted drive now shows up in my file manager as “7.4 GiB Hard Drive” instead of “USB DISK” and blkid reports it as

/dev/sdd: UUID="1229-0CA3" TYPE="vfat"

One of the flash drives that works properly is also a Kingston, same store brand, and blkid also identifies it as sdd1 instead of sdd:

/dev/sdd1: LABEL="USB DISK" UUID="992F-0D0B" TYPE="vfat" PARTUUID="992f0d0b-01"

The two drives are different sizes, though. The nonworking one is 8 Gb, the working one is 16.

The other working drive I had tested, a SanDisk, was also 16 Gb, so I dug up every flash drive I could find around the house to check whether I had stumbled on some obscure bug that prevented the correct identification of flash drives smaller than 16 Gb. I didn’t really think I had, and no, I haven’t. I tested an assortment of flash drives of various brands and sizes (but all less than 16 Gb), and device notifier saw all of them.

Now here’s where the story gets weirder: I then retested the three problem drives, and device notifier saw all of them, too. I did not change any settings anywhere in the interim and have no idea why they suddenly started working. It’s not the repartitioning/reformatting–I only did that to one. It’s almost as if device notifier just needed more practice.

Well, the rational part of me knows this could be a bug that only manifests under certain hard-to-pin-down conditions and could recur. I’ll just have to see if it does.

Does it make a difference as to which USB port they’re connected to? (eg USB 3 port vs USB 2 port)

No, the port makes no difference.

The bad news is that device manager’s ability to recognize two of the problem drives didn’t survive a reboot. (The third drive, the one that originally was recognized by device manager but with a message that I needed to be root to mount it, is now working normally.) Both problem drives are made by Kingston; one is USB 3 and one is USB 2. Of the working drives, some are made by Kingston, some are USB 2, some are USB 3.

There is one thing the problem drives have in common: both are 8 Gb. The working drives are 1, 2, 4, and 16 Gb (three of those), but none are 8 Gb. I’m tempted to pick up a new 8 Gb flash drive just to see what happens…

An interesting find. My only Kingston flash drive is a 16GB flash drive.

Indeed.

And I would really suggest to file a bug report about this at http://bugzilla.opensuse.org/ (Base System I suppose), you should be able to login there with the same username/password as here.

For the record, all my USB sticks work fine too (also on 42.2), but I don’t have one with 8 GiB in particular.
This may be the deciding thing, or maybe not. (but the maintainers should have more insight anyway, also how to debug this further… :wink: )

I haven’t forgotten this; I’ve just been busy. I did do a reinstall of Leap 42.2 just to be sure it wasn’t a bad install, and the problem remains, so I filed https://bugzilla.opensuse.org/show_bug.cgi?id=1022674.