Device Notifier: Camera has become nonremovable medium

My camera with UMS was treated as removable medium for years and readily showed up in device notifier when plugged into USB. But suddenly that changed: The camera does no longer show up as removable medium, but is now listed as nonremovable and requires root permission to mount.

When removing the SD card from the camera and inserting it into a USB card reader everything works normal. Device Notifier pops up and mounts the card with user permissions. I am puzzled. Any idea?

That does read like a regression… perhaps with udev?

What is reported when the device is plugged in and you then mount it

udisksctl monitor
dmesg --follow

Let’s see how the device is flagged as removable or not

udevadm info -a -n /dev/sdb1|grep removable

*Replace the device node to suit your device as enumerated by above commands.

erlangen:~ # udisksctl monitor
Monitoring the udisks daemon. Press Ctrl+C to exit.
10:26:19.784: The udisks-daemon is running (name-owner :1.31).
10:27:03.796: Removed /org/freedesktop/UDisks2/block_devices/sdc1
10:27:03.798: Removed /org/freedesktop/UDisks2/block_devices/sdc
10:28:08.590: Added /org/freedesktop/UDisks2/block_devices/sdc
  org.freedesktop.UDisks2.Block:
    Configuration:              ]
    CryptoBackingDevice:        '/'
    Device:                     /dev/sdc
    DeviceNumber:               2080
    Drive:                      '/org/freedesktop/UDisks2/drives/MATSHITA_DMC_TZ71'
    HintAuto:                   false
    HintIconName:               
    HintIgnore:                 false
    HintName:                   
    HintPartitionable:          true
    HintSymbolicIconName:       
    HintSystem:                 true
    Id:                         by-id-scsi-20080450000000000
    IdLabel:                    
    IdType:                     
    IdUUID:                     
    IdUsage:                    
    IdVersion:                  
    MDRaid:                     '/'
    MDRaidMember:               '/'
    PreferredDevice:            /dev/sdc
    ReadOnly:                   true
    Size:                       32395755008
    Symlinks:                   /dev/disk/by-id/scsi-20080450000000000
                                /dev/disk/by-id/scsi-SMATSHITA_DMC-TZ71_000000000000000000HX1L05290943
                                /dev/disk/by-path/pci-0000:00:14.0-scsi-0:0:0:0
                                /dev/disk/by-path/pci-0000:00:14.0-usb-0:9:1.0-scsi-0:0:0:0
  org.freedesktop.UDisks2.PartitionTable:
    Type:               dos
10:28:08.774: Added /org/freedesktop/UDisks2/block_devices/sdc1
  org.freedesktop.UDisks2.Block:
    Configuration:              ]
    CryptoBackingDevice:        '/'
    Device:                     /dev/sdc1
    DeviceNumber:               2081
    Drive:                      '/org/freedesktop/UDisks2/drives/MATSHITA_DMC_TZ71'
    HintAuto:                   false
    HintIconName:               
    HintIgnore:                 false
    HintName:                   
    HintPartitionable:          true
    HintSymbolicIconName:       
    HintSystem:                 true
    Id:                         by-id-scsi-20080450000000000-part1
    IdLabel:                    DMC-TZ71
    IdType:                     vfat
    IdUUID:                     0518-01CC
    IdUsage:                    filesystem
    IdVersion:                  FAT32
    MDRaid:                     '/'
    MDRaidMember:               '/'
    PreferredDevice:            /dev/sdc1
    ReadOnly:                   true
    Size:                       32391560704
    Symlinks:                   /dev/disk/by-id/scsi-20080450000000000-part1
                                /dev/disk/by-id/scsi-SMATSHITA_DMC-TZ71_000000000000000000HX1L05290943-part1
                                /dev/disk/by-label/DMC-TZ71
                                /dev/disk/by-path/pci-0000:00:14.0-scsi-0:0:0:0-part1
                                /dev/disk/by-path/pci-0000:00:14.0-usb-0:9:1.0-scsi-0:0:0:0-part1
                                /dev/disk/by-uuid/0518-01CC
  org.freedesktop.UDisks2.Filesystem:
    MountPoints:        
  org.freedesktop.UDisks2.Partition:
    Flags:              0
    IsContained:        false
    IsContainer:        false
    Name:               
    Number:             1
    Offset:             4194304
    Size:               32391560704
    Table:              '/org/freedesktop/UDisks2/block_devices/sdc'
    Type:               
    UUID:               


[364187.645356] sd 52:0:0:0: [sdc] Adjusting the sector count from its reported value: 63272960
[364187.677081] sd 52:0:0:0: [sdc] Attached SCSI removable disk
[364354.107687] usb 1-9: USB disconnect, device number 58
[364417.228103] usb 1-9: new high-speed USB device number 59 using xhci_hcd
[364417.357470] usb 1-9: New USB device found, idVendor=04da, idProduct=2372
[364417.357473] usb 1-9: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[364417.357475] usb 1-9: Product: DMC-TZ71
[364417.357476] usb 1-9: Manufacturer: Panasonic
[364417.357477] usb 1-9: SerialNumber: 000000000000000000HX1L05290943
[364417.358122] usb-storage 1-9:1.0: USB Mass Storage device detected
[364417.358541] usb-storage 1-9:1.0: Quirks match for vid 04da pid 2372: 90
[364417.358756] scsi host53: usb-storage 1-9:1.0
[364418.356772] scsi 53:0:0:0: Direct-Access     MATSHITA DMC-TZ71         0100 PQ: 0 ANSI: 5
[364418.357149] sd 53:0:0:0: Attached scsi generic sg2 type 0
[364418.372681] sd 53:0:0:0: [sdc] Adjusting the sector count from its reported value: 63272960
[364418.372684] sd 53:0:0:0: [sdc] 63272959 512-byte logical blocks: (32.4 GB/30.2 GiB)
[364418.392152] sd 53:0:0:0: [sdc] Write Protect is on
[364418.392154] sd 53:0:0:0: [sdc] Mode Sense: 23 00 80 00
[364418.412462] sd 53:0:0:0: [sdc] Write cache: disabled, read cache: disabled, doesn't support DPO or FUA
[364418.413643] sd 53:0:0:0: [sdc] Adjusting the sector count from its reported value: 63272960
[364418.578863]  sdc: sdc1
[364418.578867] sdc: p1 size 63264768 extends beyond EOD, enabling native capacity
[364418.579737] sd 53:0:0:0: [sdc] Adjusting the sector count from its reported value: 63272960
[364418.629546]  sdc: sdc1
[364418.629549] sdc: p1 size 63264768 extends beyond EOD, truncated
[364418.630637] sd 53:0:0:0: [sdc] Adjusting the sector count from its reported value: 63272960
[364418.662374] sd 53:0:0:0: [sdc] Attached SCSI removable disk
erlangen:~ # udevadm info -a -n /dev/sdc1|grep removable
    ATTRS{removable}=="1"
    ATTRS{removable}=="unknown"
    ATTRS{removable}=="unknown"
erlangen:~ #
10:35:21.873: /org/freedesktop/UDisks2/drives/WDC_WD40EZRX_22S_WD_WCC4E2FYXSNV: org.freedesktop.UDisks2.Drive.Ata: Properties Changed
  SmartTemperature:     309.15000000000003
  SmartUpdated:         1475310921
10:35:54.050: Added /org/freedesktop/UDisks2/jobs/35
  org.freedesktop.UDisks2.Job:
    Bytes:              0
    Cancelable:         true
    ExpectedEndTime:    0
    Objects:            '/org/freedesktop/UDisks2/block_devices/sdc1']
    Operation:          filesystem-mount
    Progress:           0.0
    ProgressValid:      false
    Rate:               0
    StartTime:          1475310954046053
    StartedByUID:       1000
10:35:54.175: /org/freedesktop/UDisks2/block_devices/sdc1: org.freedesktop.UDisks2.Filesystem: Properties Changed
  MountPoints:          /run/media/karl/DMC-TZ71
10:35:54.176: /org/freedesktop/UDisks2/jobs/35: org.freedesktop.UDisks2.Job::Completed (true, 'mount: /dev/sdc1 is write-protected, mounting read-only
')
10:35:54.177: Removed /org/freedesktop/UDisks2/jobs/35

Strange… from a udev perspective the attributes show that it is a removable device (as expected). Is your camera the only mass storage device behaving like this? Try with a USB stick if you have one at hand. I can’t replicate this unfortunately.

Check your removable media settings (although I don’t think the issue is dues to this)
System Settings (systemsettings5) > Removable Media

Removable Media has every box unchecked. Inserting an USB stick pops up the device notifier as expected!

Okay, so other devices work as expected. Going back to the camera, what happens if you connect and try to mount it with udisksctl (as regular user)?

udisksctl mount -b /dev/sdc

When trying to connect I inadvertently dropped the camera on the carpet floor. Upon connecting device notifier popped up. Retried connecting several times successfully. Seems to be a hardware glitch.

That’s one way of fixing it. :smiley:

I did note that it was being mounted read-only before

10:35:54.176: /org/freedesktop/UDisks2/jobs/35: org.freedesktop.UDisks2.Job::Completed (true, 'mount: /dev/sdc1 is write-protected, mounting read-only
')

Was that due to the write protect tab on the SD card perhaps? Although that should have caused problems for you taking photos.

Definitely no.

What I found: Attaching the Camera with the SD card removed causes the problem. In this case the internal memory is mounted. When unmounting, unpluging the camera, inserting the SD card and plugging in again, device notifier fails to detect the camera as removable device, but shows it as nonremovable.

I then blocked /dev/sdc with an USB stick. Plugging in the camera results in device notifier detecting the camera at /dev/sdd and readily mounting it without requesting authorization. Thus I think there is a bug somewhere in openSUSE.

On 10/01/2016 05:36 AM, karlmistelberger wrote:
>
> deano_ferrari;2794442 Wrote:
>> Okay, so other devices work as expected. Going back to the camera, what
>> happens if you connect and try to mount it with udisksctl (as regular
>> user)?
>>>
> Code:
> --------------------
> > > udisksctl mount -b /dev/sdc
> --------------------
>>> When trying to connect I inadvertently dropped the camera on the carpet
> floor. Upon connecting device notifier popped up. Retried connecting
> several times successfully. Seems to be a hardware glitch.
>
>

My first foreman always said “don’t force it get a bigger hammer”. LOL


Ken
linux since 1994
S.u.S.E./openSUSE since 1996

That is an unusual find. If you can replicate that, consider submitting a bug report.

That doesn’t stop the temptation when things aren’t going right. :smiley:

Needed to reboot the machine for reverting to business as usual, which is PITA. Tried restarting systemd-udevd to no avail. Will restarting udisks2 preserve the user sessions?

Sorry, what was the reboot needed for?

Is the following not sufficient?

udevadm control --reload-rules

To restart UDisks2 do

systemctl restart udisks2

After taking some photos on Sunday I successfully downloaded them using digiKam. Then I unmounted the camera, unplugged it, pressed power off, removed the SD card, pressed power on and plugged it again. Device Notifier readily mounted internal memory of the camera.

Then I reverted to inserting the SD card and tried again. Now the symptoms were different from the first trial. Device Notifier showed the SD card as external drive, but repeating mount/umount ended up in killing the plasma shell. I was left with an entirely dark screen and a mouse cursor moving on the screen.

What is reproducible: Mounting the camera with the SD card removed and remounting it with the card in place again causes things to become shaky and in the end I needed to kill the user session and start again.

Thanks for clarifying. That’s worthy of a bug report IMO.