Introduction
I'm using Ubuntu MATE 16.04.5 LTS with latest 4.4 Linux kernel on several machines (laptops and desktops with USB 2.0 and USB 3.0).
For me it seems that something was changed inside USB driver internals of the kernel (or maybe udisks
). Or USB flash hardware become cheaper and low-quality.
My USB flash has LED indicator. It is no-name gift (ChipsBank CBM2099E controller).
When I connect it to the computer - it has LED indicator on, it blinks when data is transferred.
My main idea: when I see blinking indicator I suppose that flash is busy, so I should not disconnect it to prevent data corruption.
Problem
Expected behavior
Many flashes - old Transcend JFV60, JF110, JF150, JF500, modern JF790; Kingston Data Traveller G2 and ADATA UE700, SanDisk Extreme Pro do not have such continuous blink problem. They stop blinking exactly after selecting Eject option and show bubble message that device is safe to remove:
Behavior of problematic flash
When I eject problematic USB flash drive from Caja file-manager or from GNOME Disks by pressing Eject menu option the flash LED is continuous blinking with fast rate. I tried to wait for about one hour, but is still blinks after this period of time. This happens even if I do not write anything on the drive. The notification bubble is not shown.
Question
My questions - what may be the reason of such blinking problem? Is it just me? Is it safe (for data) to disconnect such blinking flash?
Notes and updates
Notes
1. I do not ask here about slow drop of write cache and/or sync
the drive. It highly depends on RAM size and on real write speed of the flash. The mentioned behavior exists in cases when no data were written.
2. All these flashes do not have problems with eject functionality on Windows. They get LED off just after clicking on Eject/Safely remove.
3. Selecting Power off this disk () in GNOME Disks forces flash to stop blinking, but I'm not sure about data safety in such case (for this particular flash; for other flashes and USB HDDs or SSDs it is safe, I know it).
4. I know that for example WD MyPassport USB hard-drives changes blink rate from fast to slow glow-fade after safely remove, but is other story as it have had spin-down and parked before, so it is safe to unplug it afterwards. So I do not think that the blinking of USB flashes indicate their polling and force user to detach it...
Updates
1. below is live output of tail -f /var/log/syslog
Nov 11 23:37:35 hostname kernel: [32596.101403] scsi 7:0:0:0: Direct-Access General UDisk 5.00 PQ: 0 ANSI: 2
Nov 11 23:37:35 hostname kernel: [32596.102526] sd 7:0:0:0: Attached scsi generic sg2 type 0
Nov 11 23:37:35 hostname kernel: [32596.104745] sd 7:0:0:0: [sdc] 31129600 512-byte logical blocks: (15.9 GB/14.8 GiB)
Nov 11 23:37:35 hostname kernel: [32596.107594] sd 7:0:0:0: [sdc] Write Protect is off
Nov 11 23:37:35 hostname kernel: [32596.107611] sd 7:0:0:0: [sdc] Mode Sense: 0b 00 00 08
Nov 11 23:37:35 hostname kernel: [32596.107792] sd 7:0:0:0: [sdc] No Caching mode page found
Nov 11 23:37:35 hostname kernel: [32596.107805] sd 7:0:0:0: [sdc] Assuming drive cache: write through
Nov 11 23:37:35 hostname kernel: [32596.109561] sdc:
Nov 11 23:37:35 hostname kernel: [32596.110621] sd 7:0:0:0: [sdc] Attached SCSI removable disk
Nov 11 23:37:35 hostname udisksd[2294]: Mounted /dev/sdc at /media/username/FLASHDEVICE on behalf of uid 1000
Nov 11 23:37:52 hostname udisksd[2294]: Cleaning up mount point /media/username/FLASHDEVICE (device 8:32 is not mounted)
Nov 11 23:37:52 hostname udisksd[2294]: Unmounted /dev/sdc on behalf of uid 1000
note last lines here, at 23:37:35 device was unmounted/ejected from file manager, at 23:37:52 udisks removed it, but its LED still blinking.
2. Followed @WinEunuuchs2Unix ideas I tried both UDisks (legacy, it remains on my system because of upgrades from 12.04) and UDisks2 (modern and actual) to perform safely remove procedure - both
#udisks1 (legacy)
udisks --unmount /dev/sdc1 && udisks --detach /dev/sdc
#udisks2 (modern)
udisksctl unmount -b /dev/sdc1 && udisksctl power-off -b /dev/sdc
ended with same LED blinking problem with only one of my flashes.
3. Repeated the method above on my old Ubuntu 12.04.5 LTS and here LED is blinking on problematic flash. So it is a USB flash hardware issue.
Conclusion
There is some software-hardware incompatibility between my no-name ChipsBank CBM2099E based flash and Linux and/or Udisks. Other flashes (listed above in expected behavior) do not have problems.
In the Windows 8.1 running on the same laptop its safe removal is successful and LED is off.
The problem of LED blinking after
Eject
is selected in Nautilus, is very close to this Launchpad Bug Report from 2013:That bug report only has five subscribers and has been closed as a duplicate of this Bug Report from 2011:
The latter bug report has 155 subscribers and:
Scouring through the first bug report (the one closed as a duplicate) you see the author of
udisks
mentioning how patches need to be made. Two users who applied the patch reported no success however.I think in the bug report they missed some of the important aspects of one user's output. Here is the equivalent output from my system (that works):
is_media_removable
is set to1
on my system but on the bug reporters system is is set to0
. I think this should have been addressed.can_eject=0
but my system hascan_eject=1
Check your own
gvfs-mount -li
output to mine. Also consider subscribing to the bug reports above and/or posting there.As long as you know that the drive is not being written to then you can just remove it. Also from personal experience the power off disk in GNOME disk does not affect data.
I have a SanDisk Cruzer that does the same thing. When idle, either mounted with no reading/writing or just simply plugged in to a USB port, the LED indicator flashes, but at a slow rate. In fact, it lights up and slowly fades, then repeats.
Just to make sure I was right... I've recently bought 3 new SanDisk Cruzer Glide 16 GB flash drives. All 3 have LED indicators and all 3 act the same as yours.
So to clarify, I have 4 USB drives that operate as you've described. Is it safe to remove them? Yes, as there are obvious visual differences in behavior when the drives are idle or when being read from or written to.
There are three possibilities to check step-by-step which programs are using (eating) the hard-disk heavily:
1.) type in terminal:
or
Then you can see, which processes are actually demanding your hard-disk.
2.) You might solve it, in case of firefox, when firefox is thumbnailing your hard-disk severely, you could adjust the time-intervalls of firefox - when firefox is writing to hard-disk in the background like it is described here :
https://www.servethehome.com/firefox-is-eating-your-ssd-here-is-how-to-fix-it/
It might be as well, that google-chrome is doing the similiar things like firefox in the background.
3.) Install package fatrace with:
And tool fatrace is showing to you in terminal the programs, which are currently running in the background (e.g. google-chrome or firefox and else ...).