You are not logged in.
Pages: 1
Greetings,
When an SD memory card is mounted (from the internal card reader on a laptop), one can right click the icon on the Desktop and select Unmount or Safely Remove. In Thunar an Eject icon appears on the Safely Remove entry.
However, if one chooses the Safely Remove option, the card is unmounted then promptly remounted with an error message advising that the drive could not be removed. It appears that Unmount is really the only "safe" option for SD cards. Since SD cards are more prone to corruption that flash drives or USB hard drives, "Safely Remove" is not only impossible but possibly dangerous.
Xfce is capable of distinguishing between some storage types since right clicking on the Desktop icon for a mounted USB hard drive presents Unmount as the only removal option. If possible, this should also be the only option offered for memory cards. (Thunar seems to offer all the removal options for USB hard drives as for other storage types.That appears not to be problematic for USB hard drives but it remains so for memory cards).
Lacking a USB detachable card reader, I can't test with that. It's possible that "Safely Remove" works because the system is ejecting the reader, not the memory card.
[Using Thunar 4.18.8 on Xfce 4.18]
Thanks.
Offline
I have USB-CardReader and InternalCardReader, but now only on NB with Thunar 4.20 on Xfce 4.20 (Xubuntu 24.04 + XubuntuDev PPA's :-)
Anyway my tests, with Thunar 4.20:
- USB-CardReader:
- Mounted - Safety Remove = OK
- Unmounted - Safety Remove = OK
- Internal-CardReader:
- Mounted - Safety Remove = OK
- Unmounted - Safety Remove = OK
Using context menu "Safety Remove" or icon "Eject" is same
From dmesg:
# Card inserted in Internal CardReader:
[196669.828684] sd 0:0:0:0: [sda] 62521344 512-byte logical blocks: (32.0 GB/29.8 GiB)
[196669.829304] sda: detected capacity change from 0 to 62521344
[196669.841822] sda: sda1
# After Safety Remove
[196758.874484] sda: detected capacity change from 62521344 to 0
# After physically remove Card from Reader
<nothing>
EDIT:
- my internal card reader is in ThinkPad T480 "0bda:0316 Realtek Semiconductor Corp. Card Reader" and in /dev is show sda also without card in reader inserted
- my external card reader is "Kingston MobileLite Duo 3C" and for fun... in lsusb is detected same as internal (ofc another bus/device) :-)
Last edited by k3dAR (2025-02-20 17:05:53)
Offline
In four of five laptops tested, "safely remove" or "eject" fails, and throws this dialog, then remounts the SD card:
Error ejecting /dev/mmcblk0: Command-line 'eject '/dev/mmcblk0" exited with non-zero exit status 1: eject: unable to eject
The error occurred with three Realtek internal card readers and one jMicron. The one laptop that "safely removed" successfully does not identify the card reader in either lspci or lsusb. These machines are five years old or older.
Thanks.
Offline
have all problematic card device mmcblk0 ? and in working too or sdX ?
and what if on problematic you try in terminal?:
sudo eject /dev/mmcblk0
Offline
I tried two of the uncooperative laptops and each mounts the SD card as mmcblk0 / mmcblk0p1. If I try sudo eject /dev/mmcblk0 the terminal responds with "eject: cannot eject". The card unmounts then remounts, as it does when attempting the GUI eject.
The laptop that successfully ejects mounts the card as /dev/sda1.
Thanks! I think this is progress.
Offline
so i try with another laptop: Pinebook Pro (Manjaro, Xfce 4.20, kernel 6.9.3 and eject 2.40.4)
- internal card reader not listed in lsusb/lspci
- show/create device only if card is inserted
- use device name mmcblk1
sudo eject /dev/mmcblk1
eject: unable to eject
and in dmesg show:
EXT4-fs (mmcblk1p2): unmounting filesystem
mmcblk1: p1 p2
i don't have enabled automatic mount, so card is keep unmounted, but in thunar i see for split second is card gone, then show again
for reference is not same as when card is inserted (but only last line):
# Card inserted:
mmc_host mmc1: Bus speed (slot 0) = 400000Hz (slot req 400000Hz, actual 400000HZ div = 0)
mmc_host mmc1: Bus speed (slot 0) = 100000000Hz (slot req 100000000Hz, actual 100000000HZ div = 0)
dwmmc_rockchip fe320000.mmc: Successfully tuned phase to 204
mmc1: new ultra high speed SDR50 SDHC card at address 59b4
mmcblk1: mmc1:59b4 SD 15.0 GiB
mmcblk1: p1 p2
and when card is physically removed:
mmc1: card 59b4 removed
As card represent as mmcblk device is not through a mediated interface, but direct/wired to card, maybe is not possible "eject" it similar as with usb card reader, where eject disconnect it from usb bus powering...
Added later 05 min 19 s:
EDIT: only for sure, in real you don't need eject card before remove it, only umount is enough (but understand, eject icon is simpler and also umount multiple/all partition on card at once
Last edited by k3dAR (2025-02-22 14:18:33)
Offline
Thanks. So now we know, devices mounted as sd* can be ejected, but those mounted as mmc* cannot. My suggestion is that the eject option should not be offered to the user if it doesn't work. A more polite way to handle the error would be to umount the card without promptly mounting it again.
Offline
Pages: 1
[ Generated in 0.010 seconds, 7 queries executed - Memory usage: 551.64 KiB (Peak: 568.55 KiB) ]