LED indicator on USB flash disk is not switch off after disk eject

Bug #58706 reported by psl
30
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linux
Invalid
Undecided
Unassigned
eject (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Ubuntu 6.06.1, x86, 2.6.15-26-k7

I have noticed difference between behavior of my USB flash disk in Windows (W2k) and Ubuntu. I tried four different USB disks, two of them were USB20, and the result is the same.

All my USB disks has some LED indicator, one disk has LED with two colours to indicate read/write access. LED inidicator is activeted when disk is pluged to USB port and in many cases it blinks when USB disk is read/written.

When I do "remove" in Windows, I receive message like "It is safe to remove your USB disk from the system now". And LED indicator on the USB flash disk is switch off. I like that LED indicator is switch off. It is very useful in the case you have several USB disks connected to your system in the same time. When you see that LED is switch off, you know that it is safe to remove USB disk.

When I do umount in Ubuntu (or eject in Gnome), LED inidicator on USB is still power on. That is not good, as there is no indication on the USB flash disk that it is safe to remove.

My guess is that this behavoir is more kernel related than Ubuntu/GNOME related.

psl (slansky)
description: updated
Revision history for this message
Memo (memo-cj-ro) wrote :

I can confirm this, when removing the USB stick in windows the Led indicator turns off. In Ubuntu 7.04 the device is unmounted but the led is still green, wich means that the USB stick is still powered on.

Revision history for this message
psl (slansky) wrote :

Well, I think problem was fixed in Ubuntu 7.04. I like it. When you umount a flash drive, there is no reason to switch off aLED indicator. You have to eject FLASH drive. After eject (feject command from command line) or with menu command in GNIOME disk mounter, LED is switch off.

The reason why "umount" should not switch off LED is that USB disk can have several partitions.

When I reported this problem, I beleive it was not working. I think that Ubuntu 6.10 and Ubuntu 7.04 are fixed now.

Revision history for this message
psl (slansky) wrote :

command is "eject", not feject, I am sorry for typo. When your flash USB drive is mounted as /dev/sda, use "eject /dev/sda" to switch LED off. When disk is mounted as /dev/sda1, use the same eject, "eject /dev/sda".

Revision history for this message
Memo (memo-cj-ro) wrote :

I am talking about 7.04, as this is the distribution i am using. When i insert the usb stick it turns on (indicator LED lights green), and it is automaticaly mounted this is the entry in mtab:

/dev/sdb1 on /media/disk type vfat (rw,nosuid,nodev,shortname=mixed,uid=1000,utf8,umask=077)

and nautilus launches showing the files on usb stick.

In Disk Mounter, it shows the icon for the USB drive, but on click i have only two options "open" si "unmount". On unmount, it does not turn off the indicator led.

I also tried the eject /dev/sdb1 but i had to sudo it: sudo eject /dev/sdb1
The stick is unmounted and indicator led is still green.

Revision history for this message
psl (slansky) wrote :

OK, you are right, I am wrong. I retested with my USB disks on Ubuntu 7.04. I have two different results, one USB disk works as expected, LED inidicator is switch off when I select "Eject" in GNOME or when I issue "eject command in the shell". The other USB disks are only unmounted when I select Eject in GNOME or in shell. It is improvement compared with Ubuntu 6.04 but some disks are still not handled correctly. It is even more comlex. Some USB disks stay after "Eject" in GNOME mounter visible, with status (unmounted), others disapear (no icon anymore). It is even possible, that Linux is confused after several plug and unplug actions as I didn't noticed this problem in last weeks, I beleived it was fixed. But after retest I can see that some work still has to be done here.

Revision history for this message
Akshay (kiniakshay) wrote :

I am using Ubuntu 7.04 and confirm the problem exists even now. I am attaching details of my Linux version too as I have updated the kernel to the latest one (one was released after Ubuntu 7.04) ans yet this bug persists. I also notice that this bug hasn't been assigned to anybody A Year after it has been reported/confirmed! Don't know whether this bug is Kernel related, if so even Kubuntu etc. users should be facing the same problem.
Have attached files as required in : https://wiki.ubuntu.com/KernelTeamBugPolicies

Revision history for this message
Michael Doube (michael-doube) wrote :

Should have read the whole report, sorry...

Changed in linux:
status: New → Invalid
Revision history for this message
Michael Doube (michael-doube) wrote :

I've got this on a flash drive and Lexar CF card reader. Unmounting from the GNOME right-click menu leaves the light on but sudo eject /dev/sdc1 turns the light off. Have marked my bugs as duplicates.

Revision history for this message
Michael Doube (michael-doube) wrote :

Oh yeah, and I should mention that this is running Hardy (8.04) amd64.

Revision history for this message
Marcin Kowalczyk (qrczakmk) wrote :

I have a phone which can serve as USB storage with two partitions. My observations:

* Right click in Nautilus has Unmount, not Eject; each partition is unmounted separately; the phone display does not change from the connected state. I will call that operation "unmount".

* 'eject /dev/sdb1' or 'eject /dev/sdc1' do only the unmount, with a message: eject: unable to open `/dev/sdb1'

* 'sudo eject /dev/sdb1' or 'sudo eject /dev/sdc1' unmounts both partitions; the phone displays that it is now safe to unplug. I will call that operation "eject".

* Adding myself to group disk makes the eject program really eject (but is of course dangerous, as it gives the user write access to the HD). Doing 'sudo chmod o+r /dev/sdb1' has the same effect on eject, but of course does not persist plugging the phone again.

* After the unmount, the partitions can be mounted from the Computer window. After the eject, the partitions still display in the Computer window until I unplug the cable, but cannot be mounted again.

I guess the situation can be summarized as follows:

USB storage supports an operation, let's call it "eject", which implies unmounting all its partitions but is more than that. The default Ubuntu Hardy provides no GUI to ejection, and no CLI which does not involve sudo. The 'eject' program is able to eject, as long as the calling user has permissions to the corresponding /dev/sd* (read access is enough), which he does not by default.

I think access to USB ejection is valuable: even if it does not increase safety (I am not sure about this), it is convenient to unmount all partitions of a given device at once. Perhaps the permissions or uid:gid of /dev entries of removable media should be different?

Revision history for this message
Michael Doube (michael-doube) wrote :

I've just tested this on Hardy 8.04.1 and can confirm that eject no longer switches off the LED, however it does remove (unmount) the flash drive from the filesystem. The main problem here is that people expect the LED to be informing them of the status of their drive, which it does not, so they cannot confidently remove their drive. Windows has trained them to be frightened of removing devices before they are told they can "safely remove hardware" - at which point the LED is
usually off. So leaving the LED on ~= device is not ready to be removed (even if you and I, experienced Linux people, know that once it is unmounted everything is OK.)

Revision history for this message
Sebastien Bacher (seb128) wrote :

could you try in intrepid or jaunty? do you still get the issue? does eject on the command line work differently?

Changed in gnome-mount:
importance: Undecided → Low
status: Confirmed → Incomplete
Revision history for this message
Michael Doube (michael-doube) wrote :

In Jaunty alpha 5 (amd64):

Unmounting from the desktop icon right-click menu does not switch off the LED.

running
]$ eject /dev/sdc

dumps this:
jauntyalpha5@doris:~$ eject /dev/sdc
*** glibc detected *** eject: munmap_chunk(): invalid pointer: 0x00007fff5832fbf0 ***

And also doesn't switch off the LED.

This is true for a SanDisk Cruzer micro 2GB USB pen drive and Lexar CF card reader, but the LED on my Kingston 4GB pen drive only turns on during data transfer so it is off after unmounting .

Revision history for this message
Sebastien Bacher (seb128) wrote :

the new comment indicate the issue is an eject one, eject is crashing in this case and having a valgrind log would be useful

Changed in gnome-mount:
status: Incomplete → New
Revision history for this message
Michael Doube (michael-doube) wrote :

I booted Jaunty alpha 6 to get a valgrind log but eject is no longer crashing.

The LED stays on after running eject from the command line and after right click->Unmount volume.

Revision history for this message
Michael Doube (michael-doube) wrote :

This appears to be fixed in Karmic alpha 4 on my SanDisk Cruzer and Lexar CF card reader when I select 'eject' from Nautilus or Gnome's right-click menu.

Changed in eject (Ubuntu):
status: New → Fix Committed
Revision history for this message
Michael Doube (michael-doube) wrote :

Karmic now has a right click menu item to "safely remove" USB drives, which seems to fix this bug.

Changed in eject (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.