Ubuntu QA:
BlogBrainstorm
Log in
Ubuntu QA
The Ubuntu community has contributed 8347 ideas, 36569 comments, 875408 votes

Idea #5813: Make USB flash drives more hot-swappable/removable



up
194
down
Written by diablo75 the 27 Mar 08 at 03:35. Category: Hardware support. Status: New
Description
Sometimes when I unmount a USB flash drive, it has the "writing data to drive" warning up for a good minute before saying its safe to remove.

My idea: Don't make me wait on stupid stuff like that. Whatever Linux needed to do to that USB drive, it should have gotten it out of the way a long time ago while I was distracted with something else. I can see the LED light not blinking; it wasn't doing anything before, but now it's got something to do that it forgot about?? If I had it my way, I'd be allowed to pull my USB flash drive out whenever I'd like to....

So! The midway suggestion here is to get these mystery processes automated better so the drives will be that much closer to being ready to be removed safely from the PC.

But how about this: What if you made the drive constantly tidy up on the above stuff mentioned, but then logically dismount itself from the system after some inactivity, but not actually remove the drives' icon from the screen (so it will appear to still be mounted).

The icon could also have a green check mark next to it that would indicate to the user "This thing is ready to be pulled out any time." And if it's not yet dismounted, then it should have busy icon, and be busy getting itself "ready" ("dismounted"), and then actually dismount so you could pull it at will from the computer.

When I plug in a flash drive, I'd like to see a new status icon for that drive on my task bar, either with a green check mark (indicating that if I wanted to pull it out of the computer RIGHT NOW, I could do so safely), or with some other kind of icon that would indicate the drive is busy.

Now, if a person gets used to pulling their drive out whenever they please, and it actually causes a problem because they weren't paying attention to the status icon (or the frigging status LIGHTBULB on the drive itself), make it so the system will request the user to reinsert their drive for a moment so it can finish whatever it needed to finish, and correct errors if necessary.


Attachments


Duplicates


Comments
glibik wrote on the 27 Mar 08 at 10:14

Yeah, I also find that a bit of an annoyance. :-(

I think the way to 'fix' this is to disable write
caching for USB devices.

I'm not sure if this can be accomplished simply by
finding a config file for the USB subsystem or
automount and modify so that the entry created in
/etc/fstab includes the option to force synchronous
writes.

Maybe that needs to be done in the USB subsystem. :-\


droetker wrote on the 27 Mar 08 at 10:44
-1, very bad idea.

for that you would have to mount your flash drive with "sync" option.
And that's the best way to shorten lifetime of your flash drive.

BTW, in Windows/OSX you have to unmount pluggable drives as well. But in Windows noone knows that, and people just pull out the plug.

Better learn to do that on Windows as well. You don't switch off your computer without shutdown, do you?

HDave wrote on the 27 Mar 08 at 13:14
This is a good idea.

Ubuntu should be able to tell the difference between a USB hard drive (where I want sync off for performance) and a USB memory stick (where I want sync on so I can yank it out whenever I want).

The part about sync lessening the life of your flash drive is total B.S. all modern flash drives have built in mechanisms to protect from that.

So a bigtime +1 from me.

TBH wrote on the 27 Mar 08 at 13:53
mount with sync option! -1

leu wrote on the 27 Mar 08 at 14:36
Sorry, not a good idea. Look at the answers from TBH and droetker.

@HDave: Could you explain your argument a bit more?
To my knowledge the writing access is limited to 10.000 - 100.000 times, corresponding to the quality of the flash drive.

Thanks!

TBH wrote on the 27 Mar 08 at 15:03
leu: Flashdrives have improved they lifetime recently , this is not the point.

The point is there is already a solution, and MOST people wants to cache data before writing on pendrive, so i see no reason to implement this.

vexorian wrote on the 27 Mar 08 at 15:19
Terrible idea. If you are annoyed by this mount with sync, but it ought not to be the default.

rs3york wrote on the 27 Mar 08 at 17:11
I agree with some of the other commentary here, this suggestion would lead to bad default behaviour. It's much more inconvenient to have to replace a USB pen drive than to simply unmount properly.

rs3york wrote on the 27 Mar 08 at 17:11
I agree with some of the other commentary here, this suggestion would lead to bad default behaviour. It's much more inconvenient to have to replace a USB pen drive than to simply unmount properly.

ay wrote on the 27 Mar 08 at 17:24
I believe that the current behavior is pretty good: smaller drives are assumed to be NAND Flash, and are not mounted synchronously. Larger drives are assumed to be hard disks or at least NAND Flash where you'll be writing huge files, and have sync set.

The trouble is with the way NAND Flash works, and no, this has not "improved recently". You want to queue up as much of the erase/write as possible and do it all at once on these devices. Therefore the behavior is to not mount synchronously, allow everything to buffer up, and only flush the buffers to disk on umount. There's also no sense in trying to "repair", when you yank the drive the data is simply not written out yet (unless you did it during the flush to disk). In fact for that reason it's probably better to not try and sync periodically.

For slightly less naive users, it might be nice to have a "sync" option in the context menu, say next to "eject", but I doubt that most people would know what to do with it.


Post your comment