Eject removable media (build in SD card reader) - reject but auto come back within second

I just encounter this issue.
When i eject a usb removeable device, it reconnect the usb device back straight away , within milisecond. That means i can never able properly eject a usb removable device.

$ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda           8:0    0 465,8G  0 disk 
├─sda1        8:1    0   100M  0 part 
└─sda2        8:2    0 465,7G  0 part /run/media/enos-andrew/3profile-andrewadm
sdb           8:16   0 931,5G  0 disk 
├─sdb1        8:17   0    79G  0 part /
└─sdb2        8:18   0 852,5G  0 part /home
sdc           8:32   1  14,6G  0 disk 
└─sdc1        8:33   1  14,6G  0 part /run/media/enos-andrew/deja-dup_backup
sdd           8:48   0   5,5T  0 disk 
└─sdd1        8:49   0   5,5T  0 part /run/media/enos-andrew/6TB My Book
mmcblk0     179:0    0   7,4G  0 disk 
└─mmcblk0p1 179:1    0   7,4G  0 part /run/media/enos-andrew/3451-6351
 [enos-andrew@enos-andrew-pc ~]$ sudo eject mmcblk0p1
eject: unable to eject

This photo shows the Removeable Media was just ejected, but it reconnected back. hence got 2 7.4GiB Removable Media.

What is that? Is it a memory card? What hardware is it attached to?

SD card

What hardware are you using to connect it?

Build in card reader.
I don’t know which one.

$ lspci
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor DRAM Controller (rev 06)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller (rev 06)
00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)
00:03.0 Audio device: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller (rev 06)
00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 05)
00:16.0 Communication controller: Intel Corporation 8 Series/C220 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #2 (rev 05)
00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller (rev 05)
00:1c.0 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #1 (rev d5)
00:1c.3 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #4 (rev d5)
00:1c.4 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #5 (rev d5)
00:1c.5 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #6 (rev d5)
00:1d.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #1 (rev 05)
00:1f.0 ISA bridge: Intel Corporation HM86 Express LPC Controller (rev 05)
00:1f.2 SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode] (rev 05)
00:1f.3 SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller (rev 05)
01:00.0 3D controller: NVIDIA Corporation GM108M [GeForce 940M] (rev a2)
03:00.0 Ethernet controller: Qualcomm Atheros Killer E220x Gigabit Ethernet Controller (rev 13)
04:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5249 PCI Express Card Reader (rev 01)
05:00.0 Network controller: Intel Corporation Wireless 3160 (rev 83)
[enos-andrew@enos-andrew-pc ~]$ lsusb
Bus 002 Device 003: ID 1058:25ee Western Digital Technologies, Inc. My Book 25EE
Bus 002 Device 002: ID 8087:8000 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: ID 5986:014c Acer, Inc MSI Integrated Webcam
Bus 001 Device 004: ID 8087:07dc Intel Corp. Bluetooth wireless interface
Bus 001 Device 003: ID 046d:c521 Logitech, Inc. Cordless Mouse Receiver
Bus 001 Device 002: ID 8087:8008 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 007: ID 2109:0813 VIA Labs, Inc. VL813 Hub
Bus 004 Device 006: ID 2109:0813 VIA Labs, Inc. VL813 Hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 013: ID 046d:c31c Logitech, Inc. Keyboard K120
Bus 003 Device 012: ID 0781:5567 SanDisk Corp. Cruzer Blade
Bus 003 Device 011: ID 2109:2813 VIA Labs, Inc. VL813 Hub
Bus 003 Device 010: ID 2109:2813 VIA Labs, Inc. VL813 Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

So…we started with this problem:

But it seems like you are not using a USB device at all. You are using an internal card reader. That is a totally different thing.

5 Likes

Huh ?
Sorry, i thought all devices are either PCI or USB.
So, any idea how to overcome this problem ? i can’t find anything related to this in internet. Or maybe i type a no good keyword for search.
Anyway, to search problem on endea os, the problem is there are less user uses endea… so… i have to use arch linux as search keyword in place of endea os ?

A lot of command from internet does not exist here in endea linux.

I found this command, but no idea how to use it to solve the problem.

$ udisksctl monitor
Monitoring the udisks daemon. Press Ctrl+C to exit.
00:21:35.807: The udisks-daemon is running (name-owner :1.36).
00:21:52.145: Added /org/freedesktop/UDisks2/drives/ASTC_0x00000212
  org.freedesktop.UDisks2.Drive:
    CanPowerOff:                false
    Configuration:              {}
    ConnectionBus:              sdio
    Ejectable:                  false
    Id:                         ASTC-0x00000212
    Media:                      flash_sd
    MediaAvailable:             true
    MediaChangeDetected:        true
    MediaCompatibility:         flash_sd
    MediaRemovable:             true
    Model:                      ASTC
    Optical:                    false
    OpticalBlank:               false
    OpticalNumAudioTracks:      0
    OpticalNumDataTracks:       0
    OpticalNumSessions:         0
    OpticalNumTracks:           0
    Removable:                  true
    Revision:                   
    RotationRate:               0
    Seat:                       seat0
    Serial:                     0x00000212
    SiblingId:                  
    Size:                       31142707200
    SortKey:                    01hotplug/1600899712138255
    TimeDetected:               1600899712138255
    TimeMediaDetected:          1600899712138255
    Vendor:                     
    WWN:                        
00:21:52.146: Added /org/freedesktop/UDisks2/block_devices/mmcblk0
  org.freedesktop.UDisks2.Block:
    Configuration:              []
    CryptoBackingDevice:        '/'
    Device:                     /dev/mmcblk0
    DeviceNumber:               45824
    Drive:                      '/org/freedesktop/UDisks2/drives/ASTC_0x00000212'
    HintAuto:                   true
    HintIconName:               
    HintIgnore:                 false
    HintName:                   
    HintPartitionable:          true
    HintSymbolicIconName:       
    HintSystem:                 false
    Id:                         
    IdLabel:                    
    IdType:                     
    IdUUID:                     
    IdUsage:                    
    IdVersion:                  
    MDRaid:                     '/'
    MDRaidMember:               '/'
    PreferredDevice:            /dev/mmcblk0
    ReadOnly:                   false
    Size:                       31142707200
    Symlinks:                   /dev/disk/by-id/mmc-ASTC_0x00000212
                                /dev/disk/by-path/pci-0000:04:00.0-platform-rtsx_pci_sdmmc.0
    UserspaceMountOptions:      
  org.freedesktop.UDisks2.PartitionTable:
    Partitions:         
    Type:               dos
00:21:52.184: Added /org/freedesktop/UDisks2/block_devices/mmcblk0p1
  org.freedesktop.UDisks2.Block:
    Configuration:              []
    CryptoBackingDevice:        '/'
    Device:                     /dev/mmcblk0p1
    DeviceNumber:               45825
    Drive:                      '/org/freedesktop/UDisks2/drives/ASTC_0x00000212'
    HintAuto:                   true
    HintIconName:               
    HintIgnore:                 false
    HintName:                   
    HintPartitionable:          true
    HintSymbolicIconName:       
    HintSystem:                 false
    Id:                         by-uuid-2F51-0855
    IdLabel:                    
    IdType:                     vfat
    IdUUID:                     2F51-0855
    IdUsage:                    filesystem
    IdVersion:                  FAT32
    MDRaid:                     '/'
    MDRaidMember:               '/'
    PreferredDevice:            /dev/mmcblk0p1
    ReadOnly:                   false
    Size:                       31141938176
    Symlinks:                   /dev/disk/by-id/mmc-ASTC_0x00000212-part1
                                /dev/disk/by-path/pci-0000:04:00.0-platform-rtsx_pci_sdmmc.0-part1
                                /dev/disk/by-uuid/2F51-0855
    UserspaceMountOptions:      
  org.freedesktop.UDisks2.Filesystem:
    MountPoints:        
    Size:               0
  org.freedesktop.UDisks2.Partition:
    Flags:              128
    IsContained:        false
    IsContainer:        false
    Name:               
    Number:             1
    Offset:             769024
    Size:               31141938176
    Table:              '/org/freedesktop/UDisks2/block_devices/mmcblk0'
    Type:               0x06
    UUID:               
00:21:52.185: /org/freedesktop/UDisks2/block_devices/mmcblk0: org.freedesktop.UDisks2.PartitionTable: Properties Changed
  Partitions:           /org/freedesktop/UDisks2/block_devices/mmcblk0p1
00:21:52.216: Added /org/freedesktop/UDisks2/jobs/28
  org.freedesktop.UDisks2.Job:
    Bytes:              0
    Cancelable:         true
    ExpectedEndTime:    0
    Objects:            /org/freedesktop/UDisks2/block_devices/mmcblk0p1
    Operation:          filesystem-mount
    Progress:           0.0
    ProgressValid:      false
    Rate:               0
    StartTime:          1600899712213753
    StartedByUID:       0
00:21:52.229: /org/freedesktop/UDisks2/jobs/28: org.freedesktop.UDisks2.Job::Completed (true, '')
00:21:52.230: Removed /org/freedesktop/UDisks2/jobs/28
00:21:52.230: /org/freedesktop/UDisks2/block_devices/mmcblk0p1: org.freedesktop.UDisks2.Filesystem: Properties Changed
  MountPoints:          /run/media/enos-andrew/2F51-0855
00:21:52.235: /org/freedesktop/UDisks2/block_devices/mmcblk0p1: org.freedesktop.UDisks2.Block: Properties Changed
  UserspaceMountOptions:        uhelper=udisks2

When the sd car is already plugged in, and i reject it:
this is monitored:

$ udisksctl monitor
Monitoring the udisks daemon. Press Ctrl+C to exit.
00:24:19.683: The udisks-daemon is running (name-owner :1.36).
00:24:24.749: Added /org/freedesktop/UDisks2/jobs/32
  org.freedesktop.UDisks2.Job:
    Bytes:              0
    Cancelable:         true
    ExpectedEndTime:    0
    Objects:            /org/freedesktop/UDisks2/block_devices/mmcblk0p1
    Operation:          filesystem-unmount
    Progress:           0.0
    ProgressValid:      false
    Rate:               0
    StartTime:          1600899864740921
    StartedByUID:       0
00:24:24.753: /org/freedesktop/UDisks2/block_devices/mmcblk0p1: org.freedesktop.UDisks2.Filesystem: Properties Changed
  MountPoints:          
00:24:24.779: /org/freedesktop/UDisks2/jobs/32: org.freedesktop.UDisks2.Job::Completed (true, '')
00:24:24.780: Removed /org/freedesktop/UDisks2/jobs/32
00:24:24.785: /org/freedesktop/UDisks2/block_devices/mmcblk0p1: org.freedesktop.UDisks2.Block: Properties Changed
  UserspaceMountOptions:        
00:24:24.951: Added /org/freedesktop/UDisks2/jobs/33
  org.freedesktop.UDisks2.Job:
    Bytes:              0
    Cancelable:         true
    ExpectedEndTime:    0
    Objects:            /org/freedesktop/UDisks2/drives/ASTC_0x00000212
    Operation:          drive-eject
    Progress:           0.0
    ProgressValid:      false
    Rate:               0
    StartTime:          1600899864946136
    StartedByUID:       1000
00:24:24.958: /org/freedesktop/UDisks2/jobs/33: org.freedesktop.UDisks2.Job::Completed (false, "Command-line `eject '/dev/mmcblk0'' exited with non-zero exit status 1: eject: unable to eject\n")
00:24:24.958: Removed /org/freedesktop/UDisks2/jobs/33
00:24:24.966: Removed /org/freedesktop/UDisks2/block_devices/mmcblk0p1
00:24:24.991: /org/freedesktop/UDisks2/block_devices/mmcblk0: org.freedesktop.UDisks2.PartitionTable: Properties Changed
  Partitions:           
00:24:25.028: Added /org/freedesktop/UDisks2/block_devices/mmcblk0p1
  org.freedesktop.UDisks2.Block:
    Configuration:              []
    CryptoBackingDevice:        '/'
    Device:                     /dev/mmcblk0p1
    DeviceNumber:               45825
    Drive:                      '/org/freedesktop/UDisks2/drives/ASTC_0x00000212'
    HintAuto:                   true
    HintIconName:               
    HintIgnore:                 false
    HintName:                   
    HintPartitionable:          true
    HintSymbolicIconName:       
    HintSystem:                 false
    Id:                         by-uuid-2F51-0855
    IdLabel:                    
    IdType:                     vfat
    IdUUID:                     2F51-0855
    IdUsage:                    filesystem
    IdVersion:                  FAT32
    MDRaid:                     '/'
    MDRaidMember:               '/'
    PreferredDevice:            /dev/mmcblk0p1
    ReadOnly:                   false
    Size:                       31141938176
    Symlinks:                   /dev/disk/by-id/mmc-ASTC_0x00000212-part1
                                /dev/disk/by-path/pci-0000:04:00.0-platform-rtsx_pci_sdmmc.0-part1
                                /dev/disk/by-uuid/2F51-0855
    UserspaceMountOptions:      
  org.freedesktop.UDisks2.Filesystem:
    MountPoints:        
    Size:               0
  org.freedesktop.UDisks2.Partition:
    Flags:              128
    IsContained:        false
    IsContainer:        false
    Name:               
    Number:             1
    Offset:             769024
    Size:               31141938176
    Table:              '/org/freedesktop/UDisks2/block_devices/mmcblk0'
    Type:               0x06
    UUID:               
00:24:25.029: /org/freedesktop/UDisks2/block_devices/mmcblk0: org.freedesktop.UDisks2.PartitionTable: Properties Changed
  Partitions:           /org/freedesktop/UDisks2/block_devices/mmcblk0p1
00:24:25.058: Added /org/freedesktop/UDisks2/jobs/34
  org.freedesktop.UDisks2.Job:
    Bytes:              0
    Cancelable:         true
    ExpectedEndTime:    0
    Objects:            /org/freedesktop/UDisks2/block_devices/mmcblk0p1
    Operation:          filesystem-mount
    Progress:           0.0
    ProgressValid:      false
    Rate:               0
    StartTime:          1600899865055732
    StartedByUID:       0
00:24:25.074: /org/freedesktop/UDisks2/jobs/34: org.freedesktop.UDisks2.Job::Completed (true, '')
00:24:25.075: Removed /org/freedesktop/UDisks2/jobs/34
00:24:25.075: /org/freedesktop/UDisks2/block_devices/mmcblk0p1: org.freedesktop.UDisks2.Filesystem: Properties Changed
  MountPoints:          /run/media/enos-andrew/2F51-0855
00:24:25.079: /org/freedesktop/UDisks2/block_devices/mmcblk0p1: org.freedesktop.UDisks2.Block: Properties Changed
  UserspaceMountOptions:        uhelper=udisks2


This has nothing to do with your original question or problem as you put it. You were using eject for usb devices. An sd card is not a usb device. That’s the end of it. You have now turned it into something else that it isn’t. Udisks is for another purpose which you should already know if you searched about this and are using the command.

1 Like

@andrew_ysk
I don’t think a removable sd card can be ejected like a usb. It can be unmounted i think but not ejected. So udisks2 is already installed on EndeasvourOS. I see what you are trying to do but I’m not sure i understand exactly? You can unmount an sd card and remove it? :thinking:

Do you not eject any storage device before take them out ? if just take them out without eject them properly will it causes harm to data if not careful enough (data transfering in background ) ?

If it is not need to be eject, why is there a eject button for the SD card storage ?

When you “eject” a drive, you are really just unmounting it. You can prove this by checking for the folder the drive was mounted to after clicking eject. It should be gone or have nothing in it. So in KDE unlike some other solutions, when you eject a drive, you could technically just mount it again without issues. Unmounting a drive is sufficient to prevent against data loss. Once you unmount it, you can pull it, or in the case of your SD card, you can remove it.

1 Like

It is not all that easy sometime.
I have experienced on manjaro
unable to umount a drive
and
after umount; when replug in usb stick, it won’t mount back anymore, until i restart pc.
But it works good on Endea os:

$ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda           8:0    0 465,8G  0 disk 
├─sda1        8:1    0   100M  0 part 
└─sda2        8:2    0 465,7G  0 part /run/media/enos-andrew/3profile-andrewadm
sdb           8:16   0 931,5G  0 disk 
├─sdb1        8:17   0    79G  0 part /
└─sdb2        8:18   0 852,5G  0 part /home
sdc           8:32   1  14,6G  0 disk 
└─sdc1        8:33   1  14,6G  0 part /run/media/enos-andrew/deja-dup_backup
sdd           8:48   0   5,5T  0 disk 
└─sdd1        8:49   0   5,5T  0 part /run/media/enos-andrew/6TB My Book
mmcblk0     179:0    0    29G  0 disk 
└─mmcblk0p1 179:1    0    29G  0 part /run/media/enos-andrew/2F51-0855
[enos-andrew@enos-andrew-pc mmcblk0]$ umount /dev/mmcblk0p1
[enos-andrew@enos-andrew-pc mmcblk0]$ umount /dev/mmcblk0p1
umount: /dev/mmcblk0p1: not mounted.