10

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 (PowerOff) 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.

11
  • Are there IO to the device according to iostat or similar ? – Soren A Oct 26 '18 at 8:54
  • @SorenA I'm not familiar with correct iostat syntax. During ejecting it shows kB_wrtn 1 and then flash LED starts to blink. Could you please suggest full command to debug this? – N0rbert Oct 26 '18 at 9:04
  • Check the dmesg output for any automounting which might occur for certain filesystems. Haven't seen this problem in awhile though. – ubfan1 Nov 11 '18 at 19:25
  • @N0rbert - it might be because of Firefox - Firefox is updating the thumbnails frequently often ... – dschinn1001 Nov 15 '18 at 20:53
  • 1
    +1 for bringing up what appears to be a 7 year old bug. I've scratched my curiosity itch and posted an answer below :) – WinEunuuchs2Unix Jan 6 '19 at 15:57
2
+100

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:

  • October 2017 fix has been triaged for Trusty (Ubuntu 14.04 LTS)
  • October 2017 fix has been released for Xenial (Ubuntu 16.04 LTS)
  • October 2017 fix has been released for Yakkety (Ubuntu 16.10)

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):

$ gvfs-mount -li

Drive(3): 3SYSTEM USB Flash Disk
  Type: GProxyDrive (GProxyVolumeMonitorUDisks2)
  ids:
   unix-device: '/dev/sdb'
  themed icons:  [drive-removable-media-usb]  [drive-removable-media]  [drive-removable]  [drive]
  symbolic themed icons:  [drive-removable-media-usb-symbolic]  [drive-removable-media-symbolic]  [drive-removable-symbolic]  [drive-symbolic]  [drive-removable-media-usb]  [drive-removable-media]  [drive-removable]  [drive]
  is_media_removable=1
  has_media=1
  is_media_check_automatic=1
  can_poll_for_media=0
  can_eject=1
  can_start=0
  can_stop=0
  start_stop_type=shutdown
  sort_key=01hotplug/1546789639130384

  Volume(0): LIVE_USB
    Type: GProxyVolume (GProxyVolumeMonitorUDisks2)
    ids:
     class: 'device'
     unix-device: '/dev/sdb1'
     uuid: '641A-A7DB'
     label: 'LIVE_USB'
    themed icons:  [drive-removable-media-usb]  [drive-removable-media]  [drive-removable]  [drive]
    symbolic themed icons:  [drive-removable-media-usb-symbolic]  [drive-removable-media-symbolic]  [drive-removable-symbolic]  [drive-symbolic]  [drive-removable-media-usb]  [drive-removable-media]  [drive-removable]  [drive]
    can_mount=1
    can_eject=1
    should_automount=1
    sort_key=gvfs.time_detected_usec.1546789639358749
    Mount(0): LIVE_USB -> file:///media/rick/LIVE_USB
      Type: GProxyMount (GProxyVolumeMonitorUDisks2)
      default_location=file:///media/rick/LIVE_USB
      themed icons:  [drive-removable-media-usb]  [drive-removable-media]  [drive-removable]  [drive]
      symbolic themed icons:  [drive-removable-media-usb-symbolic]  [drive-removable-media-symbolic]  [drive-removable-symbolic]  [drive-symbolic]  [drive-removable-media-usb]  [drive-removable-media]  [drive-removable]  [drive]
      can_unmount=1
      can_eject=1
      is_shadowed=0
      sort_key=gvfs.time_detected_usec.1546789639395990
  • The variable is_media_removable is set to 1 on my system but on the bug reporters system is is set to 0. I think this should have been addressed.
  • The bug reporter has can_eject=0 but my system has can_eject=1

Check your own gvfs-mount -li output to mine. Also consider subscribing to the bug reports above and/or posting there.

1
  • I accept your answer, but can add that current problem is not a caused by remount. But anyway thanks for digging in depth :) I remembered this bug since I have had reported it... – N0rbert Jan 6 '19 at 18:34
0

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.

0
0

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.

2
  • Better check my answer again then, because nowhere in it does it say "I have the same problem too"... – BillWeckel Jan 2 '19 at 23:32
  • 1
    I have a SanDisk Cruzer that does the same thing. but I missed you did answer "Is it safe (for data) to disconnect such blinking flash?" edited to make your answer clearer. Downvote removed. My apologies... – Fabby Jan 2 '19 at 23:42
0

There are three possibilities to check step-by-step which programs are using (eating) the hard-disk heavily:

1.) type in terminal:

top

or

htop

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:

sudo apt-get install fatrace

sudo fatrace

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 ...).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.