Announcement

Collapse
No announcement yet.

USB card reader powered off after "Safely Remove..."

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    USB card reader powered off after "Safely Remove..."

    This seems to be a resurrection of an old problem but I can't find any solutions yet:

    New USB SD card reader connected to internal USB bus connect (desktop computer). Works exactly twice: Insert card, open card, "Safely Remove." After the second card is removed, the whole device powers down. The only way I can find to bring it back is reboot.

    It appears what I need is an "Eject" option rather than "Safely Remove" for the card in this reader. Is there a way to re-program this device to act more like a CD-ROM than a USB Thumb drive? Honestly, I don't like the way Kubuntu handles Thumb drives either. I'd should be able to unmount a thumb drive rather than remove it if I choose.

    Secondary in importance; but I'd like to change is the device letters this device. My hard drives are now sda,b,g,h,i and this new device take c,d,e,f

    Here's the dmesg output showing the device reading the cards then powering down:

    Code:
    [   59.353133] sd 6:0:0:2: [sde] 3887104 512-byte logical blocks: (1.99 GB/1.85 GiB)
    [   59.353893] sd 6:0:0:2: [sde] Write Protect is on
    [   59.353897] sd 6:0:0:2: [sde] Mode Sense: 03 00 80 00
    [   59.354627] sd 6:0:0:2: [sde] No Caching mode page present
    [   59.354630] sd 6:0:0:2: [sde] Assuming drive cache: write through
    [   59.357376] sd 6:0:0:2: [sde] No Caching mode page present
    [   59.357380] sd 6:0:0:2: [sde] Assuming drive cache: write through
    [   59.358137]  sde: sde1
    [  334.288543] sde: detected capacity change from 1990197248 to 0
    [  345.048459] sd 6:0:0:2: [sde] 3887104 512-byte logical blocks: (1.99 GB/1.85 GiB)
    [  345.049202] sd 6:0:0:2: [sde] Write Protect is off
    [  345.049205] sd 6:0:0:2: [sde] Mode Sense: 03 00 00 00
    [  345.049953] sd 6:0:0:2: [sde] No Caching mode page present
    [  345.049956] sd 6:0:0:2: [sde] Assuming drive cache: write through
    [  345.052089] sd 6:0:0:2: [sde] No Caching mode page present
    [  345.052092] sd 6:0:0:2: [sde] Assuming drive cache: write through
    [  345.052842]  sde: sde1
    [  361.262678] sde: detected capacity change from 1990197248 to 0
    [  383.246592] sd 6:0:0:0: [sdc] 501760 512-byte logical blocks: (256 MB/245 MiB)
    [  383.248088] sd 6:0:0:0: [sdc] No Caching mode page present
    [  383.248092] sd 6:0:0:0: [sdc] Assuming drive cache: write through
    [  383.250834] sd 6:0:0:0: [sdc] No Caching mode page present
    [  383.250837] sd 6:0:0:0: [sdc] Assuming drive cache: write through
    [  383.291224]  sdc: sdc1
    [  422.785335] sdc: detected capacity change from 256901120 to 0
    [  422.800706] WARNING! power/level is deprecated; use power/control instead
    [  422.880062] usb 1-2: USB disconnect, device number 2
    Basically: Safely remove = Eject + Power Down

    I just want Eject.
    Last edited by oshunluvr; Feb 10, 2013, 02:16 AM.

    Please Read Me

    #2
    Safely remove is designed to unmount then power down the device to make it safer to unplug, it is a reasonable default. I do think it should have an unmount button as well. Best way to achieve this is to report a bug upstream to kde if there is not one already.

    Comment


      #3
      I've found reports of this problem back into 2009. I think it maybe device specific so there's not been one big solution for it. I've even found a couple bug reports but at least one of them was "Won't Fix".

      Another bit of found info was a conversation from 2010 where the KDE devs decided that having both "Eject" and "Safely Remove" was too confusing for the masses (must have been some Gnome devs come over to rain on our parade ).

      I supposed the issue was the device not being detected as a fixed device with removable media rather than a simple USB thumb drive. I don't have a USB cdrom, but wouldn't that sort of device potentially have the same problem? I was hoping for a simple udev rule or something like that could fix it. Alternately, somehow forcing "Eject" back into the dialog for this device would work as well.

      The really odd bit is that it happens the second time you access the device and eject it, not the first. This leads me to believe the solution might lie in the power settings in the /sys/bus/usb device area but so far I haven't found the magic bullet.

      Please Read Me

      Comment


        #4
        CORRECTION: It appears I maligned KDE devs too quickly. The comment was made by Canonical devs, not KDE.

        Please Read Me

        Comment


          #5
          Can I solve this if I somehow get my device listed as "non-removable?"

          Please Read Me

          Comment


            #6
            I did discover in the /sys/block/ location that removable is set to true for this reader. Is there a way to set the device to not removable at boot time? I tried editing the "removable" file directly, but it returns "input/output error"

            Please Read Me

            Comment


              #7
              The problem is that pluggable devices aren't know to the OS until they are plugged in. Once detected/identified they are dynamically attached to the file system tree. Once unmounted, it's gone, as if it had never been part of the file system. How then, would you tell the OS to recognize/reattach that which it no longer knows about? mount -a won't work, as it has no permanent entry in fstab. When plugged in, an entry for the device is registered in mtab and also in /proc/partitions. When unmounted, the mtab entry is removed and it is no longer listed in /proc/partitions.

              You would have to have a way to manually kick off the detection routine.
              Using Kubuntu Linux since March 23, 2007
              "It is a capital mistake to theorize before one has data." - Sherlock Holmes

              Comment


                #8
                Actually, it the reader is detected by the OS at boot time. It's listed in the devices as sdc, sdd, sde, and sdf. It's not a hot-pluggable device - it's an sd card reader plugged into the internal USB bus connector. The problem is the device does not properly identify itself as non-removable.

                Please Read Me

                Comment


                  #9
                  Originally posted by Snowhog View Post
                  The problem is that pluggable devices aren't know to the OS until they are plugged in. Once detected/identified they are dynamically attached to the file system tree. Once unmounted, it's gone, as if it had never been part of the file system. How then, would you tell the OS to recognize/reattach that which it no longer knows about? mount -a won't work, as it has no permanent entry in fstab. When plugged in, an entry for the device is registered in mtab and also in /proc/partitions. When unmounted, the mtab entry is removed and it is no longer listed in /proc/partitions.

                  You would have to have a way to manually kick off the detection routine.
                  The problem is not with unmounting, you can manually unmount a device and still have it known to the kernel. The problem is the device is powered down, and so has to be reinserted to power it up again, there is no way for software to do this. Some devices like card readers should not be powered down as you can unplug the media and insert another card in... but doing so will not power up the device if it has been powered down and so the whole device needs to be unplugged and plugged back in again.

                  Here is an example:

                  Code:
                  $ [B]ls /dev/sdf*[/B] # The usb is not pluged inls: cannot access /dev/sdf*: No such file or directory
                  $ [B]ls /dev/sdf*[/B] # After the usb is plugged in
                  /dev/sdf  /dev/sdf1
                  $ [B]sudo udisks --mount /dev/sdf1[/B]
                  Mounted /org/freedesktop/UDisks/devices/sdf1 at /media/9E3D-62E9
                  $ [B]ls /dev/sdf*[/B]
                  /dev/sdf  /dev/sdf1
                  $[B] sudo udisks --unmount /dev/sdf1[/B]
                  $ [B]ls /dev/sdf*[/B] # the device is still present
                  /dev/sdf  /dev/sdf1
                  $ [B]ls /dev/sdf*[/B] # After mounting and unmounting the device in kde
                  /dev/sdf
                  Notice the sdf1 partition is no longer available, this is identical to what happens if you eject the device (aka safely power it down)

                  Code:
                  $[B] ls /dev/sdf*[/B] # After plugging in the device again
                  /dev/sdf  /dev/sdf1
                  $ [B]sudo eject /dev/sdf[/B]
                  $ [B]ls /dev/sdf*[/B]
                  /dev/sdf
                  $[B] sudo partprobe /dev/sdf[/B]
                  Error: Error opening /dev/sdf: No medium found
                  And there is no way to get the device to be rescanned as it is powered down.

                  There is a difference between a device being powered on and unmounted and a device being powered off.

                  Comment


                    #10
                    So the udev properties don't list it as being removable or not but the system does list it as being removable. I can't find if I can set it to ATTRS{removable}=="0" in a udev rule...

                    Please Read Me

                    Comment


                      #11
                      oshunluvr, you could try creating a custom udev rule to set the parameter for the specific device. Cannot remember the steps off hand but there are allot of udev guides out there.

                      Comment


                        #12
                        Still no joy of the udev rule. Half the guides out there are out of date. My rules are not being read. I'm using

                        SUBSYSTEM=="usb", ATTR{idVendor}=="0bda", ATTR{idProduct}=="0151", ENV{ID_INSTANCE}=="0:3",

                        to identify the devices, but no changes are being set. I'm trying these:

                        ENV{ID_DRIVE_FLASH_MS}="1", ENV{ID_DRIVE_EJECTABLE}="1", NAME="ms"

                        but nothing is taken effect. I added the name change just to see if if would use it - it doesn't.

                        Please Read Me

                        Comment


                          #13
                          oshunluvr, try rebooting, cannot remember how to reload the udev rules while running...

                          Comment


                            #14
                            I did, but for the record supposedly

                            sudo udevadm control --reload-rules
                            or
                            sudo udevadm trigger

                            Please Read Me

                            Comment


                              #15
                              I suggest reading through this: https://wiki.archlinux.org/index.php/Udev
                              And also this: http://www.reactivated.net/writing_udev_rules.html

                              Comment

                              Working...
                              X