Ubuntu QA:
BlogBrainstorm
Log in
Ubuntu QA
The Ubuntu community has contributed 10286 ideas, 46172 comments, 1012990 votes

Idea #244: Mount removable storage synchronously



up
873
down
Written by jez9999 the 28 Feb 08 at 23:50. Category: System.
Related to: Nothing/Others. Status: New
Description
When you plug in something like a USB dongle, it should be mounted synchronously (-o sync) instead of in buffered mode.

For me, this is far preferable to the minute performance gain gotten by mounting the device in buffered mode. You're very unlikely to be using such devices for anything except data storage/retreival, in which case mounting synchronously is a major benefit. Expecting new users (or those used to Windows XP's behaviour) to know you have to right-click, 'unmount', before removing the drive is not a good idea, as well as just being unnecessary if the device is mounted synchronously. It's also irritating for people like me who know you need to do it, but either occasionally forget or don't want to bother.

Mount the thing synchronously by default. This is what Windows XP does, and it allows you to just remove the drive after any file transfers have finished. Yes, problems will occur if you remove it durung a file transfer, but that's gonna happen in ANY mount mode. It's far more obvious to the user that this will cause a problem than removal of the drive before unmounting. Also stop displaying that 'unsafe device removal' message for devices mounted synchronously.
Tags: (none)

Attachments
No attachments.


Duplicates


Comments
skyhook19 wrote on the 28 Feb 08 at 23:52
Good Idea, that's irratated me more than a few times, especially with my mp3 Player.

maackey wrote on the 29 Feb 08 at 01:38
I really don't see much of a difference with "Unmount Volume" in Ubuntu and "Safely Remove Hardware" in Windows. It is already quite intuitive. (to me at least)

tyrakos wrote on the 29 Feb 08 at 01:43
if you don't do a "sync" we can end up with totally screwed up data especially on devices like Blackberries/PDAs...

It happened to me twice and the only solution was to format the media card which is really irritating and could end up with loss of data.

I think it is a really good idea.

wolfier wrote on the 29 Feb 08 at 02:20
I think it is only a good idea if the removable device is not a write-limited media like all Flash memories.

I much prefer writing once than to write many times during operation. Who knows how inefficiently a program treats your disks? Buffered I/O lengthens the life of your Flash cards and USB keys.

rca123 wrote on the 29 Feb 08 at 03:49
@maackey
The problem is it is not as easy to find how to unmount/eject in Ubuntu. I've been using linux for years and am not a fan of Windows. Windows does handle it better though (except for bringing up the annoying dialog which asks what you want to eject). If a user can't find it and they unplug the device before the data is written, there can obviously be problems.

@wolfier
I also usually prefer writing once. The issue is that many people don't eject/unmount the device properly so async is a bad idea for them.

Maybe a relatively simple place to change between sync and async preference with sync being the default. A text file somewhere should be okay because most people who know the difference between async and sync are probably okay with editing a text file. Or add it to System->Administration->Removable Drives and Media

cmr wrote on the 29 Feb 08 at 05:10
surely asynchronous mounting is preferable in many cases, and should of course be supported and probably the default.

however, many usb devices are somewhat buggy, and synchronous access is preferable, despite the lower throughput and higher potential for media wear. in these cases synchronous writing makes the device usable without the repeated heartbreak of incessant filesystem corruption.

exactopposite wrote on the 29 Feb 08 at 06:35
It would make for a great option. I would prefer for everything to mount sync rather than async. I would be satisfied by having a way to change the defualt setting for this in system preferences or something like that.

derick.eisenhardt wrote on the 29 Feb 08 at 06:57
Since the vast majority of removable media used by people today is Flash drives, the "write once" buffered approach would appear to be optimal, however there should be an easy (GUI driven) way for users to choose which mode they prefer.

I find right clicking on the drive's icon that automatically pops up on your desktop and saying unmount as being super easy and more elegant than Windows usually handles things, but perhaps we should include a notification tray icon like Windows has as well to make it more obvious to inexperienced users? Or maybe have a notification screen pop up the first time a user plugs in a read/write removable device to explain to them why they need to unmount their drives rather than simply unplugging them when they feel like it?

dei wrote on the 29 Feb 08 at 10:25
sync acces surely isn't the right solution for the following reasons:
- The lifetime of the usb-drive will be shortened (-->data-loss)
- The use case if the user pulls of the drive while writing data isn't covered
- The user doesn't learns anything

There should be an icon showing up in the Tray, when a external-drive is mounted with a short explaination the first time it shows up. (with a dropdown like the network manager, not as complicated as in WinXP)

KeyserSoze93 wrote on the 29 Feb 08 at 10:33
The system ought to complain if you just pull the device out, something like:

You have removed /dev/sda1 without first clicking on Safely Remove. This can result in data loss, so in future make sure you safely remove the device.

[ ] don't show this message again [ OK ]

cedric.berger wrote on the 29 Feb 08 at 11:13
Indeed it is important that you can easily plug an usb key, drop some data on it, and unplug (physicaly, even if not umnounted first).

And in async mode, what sould at least happen is:
- buffered data is saved localy
- the warning shows up, BUT (only if data is really missing on the key !) also indicating that you can re-pug the key to retrieve data.
An ui should then show you files impacted, and have option to simply automatically re-sync -flush buffer- but also allow you to simply copy them if you want (ex. in case data on the key was modified since the unplug)

maltes wrote on the 29 Feb 08 at 12:16
Default should be sync mount and there should be an easy way to change that into buffered mode included a little advertising how and a little list on why (many reasons already above).

But the very stupid user that DOESN'T want to learn anything should not fall into that trap. Ubuntu is not elite.

CyberKiller wrote on the 29 Feb 08 at 13:16
Not a good idea, because of the media wear, plus think of the old, slow USBv1.1 flash drives. Async works a lot better (faster, more responsive) for these devices.

hermanhobnob wrote on the 29 Feb 08 at 13:18
Don't do this. Write performance is awful on a sync mounted flash drive.

time (mount -t vfat /dev/sdc1 foo -o async && dd if=/dev/zero bs=1M count=50 of=foo/asynctest && umount foo)

real 0m48.085s
user 0m0.012s
sys 0m0.264s

Vs.

time (mount -t vfat /dev/sdc1 foo -o sync && dd if=/dev/zero bs=1M count=50 of=foo/asynctest && umount foo)

real 3m1.003s
user 0m0.004s
sys 0m0.420s

edboyww wrote on the 29 Feb 08 at 16:58
sorry, no. It was a pain in the ass uploading mp3-s onto a generic drive when it was mounted with sync on.

logfish wrote on the 29 Feb 08 at 22:28
Mounting and umounting is something that is needed by more things than just USB devices. The more devices you allow the user to unplug without notifying the system, the harder it will be to educate them on doing it for other devices. I think keeping it equal for all devices is in the end better for the user and less confusion. Education is sometimes something that is needed.

rawsausage wrote on the 29 Feb 08 at 22:33
Afaik Windows does not mount the volume synced. It just flushes the disc cache fast. As does the Linux, I have always just yanked the usb stick out and nothing has broken.

Ferk wrote on the 1 Mar 08 at 04:02
The notification bubble is good to have.. if you choose to not show it again you maybe forget it has to be synchroniced

instead of "don't show this message again"
lets make it "turn off synchronous mode"


christopher_lees wrote on the 1 Mar 08 at 09:39
Ubuntu makes it easy to unmount - right-click on the volume and "Unmount" or "Eject". I always found it much easier than the way Windows does it, and it makes more sense than "drag to the trash can" that OS X does.

Async buffering is straight out a better option. First, it increases the lifetime of flash memory. Second, it can often stop excessive seeking on USB hard drives, which is very important when you're using an HDD MP3 player as a portable HDD.

Thirdly, it is faster. Fourthly, when the "Copy" dialog disappears but the data is still copying, a newbie will think "Wow, that was such a fast copy, Ubuntu is so much more efficient than Windows!". That's a good impression to make!

hatch wrote on the 1 Mar 08 at 13:46
We're not thinking here of the users we want to reach. I would like to switch my granddad, wife, whomever to Ubuntu, but they have years of conditioning in the Windows UI. So the choice is (1) mount the USB flash buffered and have a 100% chance of lost data, or (2) mount synchronously and have some small chance they'll use it enough to wear it out. They aren't worried about speed. So I vote for sync.

If you then give me a one-click way to switch a mounted, synced USB drive to buffered, I can do that when it's a good idea and feel smart because I understand the difference.

Then for the times that it's too late and I'm forgetful (because I've used Windows for years too), follow cedric.berger's idea and when I disconnect a buffered, still-mounted device, pop up a big warning and give me a "put it back quick" recovery.

@dei, @maltes:
It's not that they're stupid or that they need training (hey, they're my nice relatives!). They're just not geeks and should never be required to think about this stuff. They're the kind of folks we need to support if we want wide acceptance.

BobPendleton wrote on the 1 Mar 08 at 17:38
Folks, I teach a basic computer literacy class at a private junior college. My students have been using computers since they were old enough to reach the keyboard. I have never once had a single student who was aware of the "safely remove" option on Windows. They all simply yank the usb drive out of the machine when they are done with it. They have never heard the terms "mount" and "unmount" and when I use those terms they think I am either talking about sex or riding horses.

If you look deep enough into WinXP you will find an option to configure removable drives (on a per drive basis) to be buffered. But, the default is to mount the drive unbuffered.

Please, please please, mount *all* removable media in unbuffered mode. Worries about reducing the life span of the drive are just plane silly. If the drive is messed up because it was not properly mounted most people assume the drive is broken and throw it away, they do not reformat it because they do not know what they means. USB drives are much more likely to be stepped on, run over by cars, or run through the washer and dryer than are to wear out.

And, also please, please, please... if the user does bother to unmount the drive turn the stinking light on the usb drive *off*. It is the only way for the user to knows that it is now safe to remove the drive.


Most of you guys know too much about computers to be *allowed* to have an opinion about usability issues. You have no clue what it is like to be clueless and expect things to *just work*. That simple fact is the #1 thing holding back Linux.


christopher_lees wrote on the 2 Mar 08 at 13:02
Telling Gnome to unmount a disk is good for multiple reasons. Not only to sync the device, but also to tell the operating system that it is no longer available for reads and writes. In turn, the operating system can tell the applications that the disk is no longer there. If the applications know that the disk isn't there, they're not going to write to it at an unexpected moment.

Yanking out a USB drive is a bad habit and a bad idea no matter what operating system you use. What if you forget that another program is using the disk in the background? Some flash drives don't have indicator lights. Some MP3 players go into the port face-down so you can't see any read/write indicators.

We shouldn't reinforce this bad habit by having the operating system ignore it! If the user is not told of their mistake, they are being given positive reinforcement.

The proposed solution of mounting unsynced and then providing a "Put it back in" notification if the user doesn't unmount the drive, is a great one.

BobPendleton: You teach a computer literacy class. If they think that "unmount" is something to do with sex, then teach them "safe storage".

robert114 wrote on the 4 Mar 08 at 22:09
I think the low speed and wear of the USB thumb are not important. First the user knows when the drive is ready after a somewath 'slow transfer'. Secondly people get realy frustrated when they think the file(s) has been transfered but when they discover that it actually did not! Nobody I know "safely" removes the drive.

Lee wrote on the 5 Mar 08 at 20:37
Mounting with the "sync" flag does NOT get around the issue of removable storage requiring an explicit safe removal from the user. The only way around that is drives which lock the media in and only remove it through software ejection, like Macs have/had. The windows way of doing in the past is untenable, which is why they're starting to have "safe remove" too.

dz0 wrote on the 12 Mar 08 at 00:23
make it (at least) an option!
give the freedom to choose ;)

changlinn wrote on the 16 Mar 08 at 11:27
The current default simply doesn't make sense. Yeah it looks good, wow I copied 500mb of pictures to my memory card in a minute, awesome. Unplug, "huh, wah there is nothing on it..."
It makes more sense that this type of transfer would take time, and there is no point not doing it live.

changlinn wrote on the 16 Mar 08 at 11:32
oh and Lee; the windows option is simply what they call disabling cached writes, you could do it as far back as windows 98se with a reg edit, and having dealt with servers and workstations with usb backup drives for a few years I can tell you the disabled cached writes in windows works 99.9% of the time.
But yes I have tried setting up fstab with sync in the line for the drive, it doesn't work properly or it automounts to a different mount point, I have just had to learn and teach all the people I am moving to Ubuntu to do the unmount first.

florin wrote on the 5 Apr 08 at 20:27
To me, this is a no-brainer choice. Of course removable devices should be mounted sync write!
The only situation when a device can be mounted async write is when the device cannot be removed without pushing a button that will tell the hardware layer and the OS that the device is about to be removed, so please flush all buffers and unmount. This is not the case with USB dongles, SD cards and such.

Just make "mount -o sync" default for all removable devices.

aidave wrote on the 25 Apr 08 at 22:23
I agree. It took a while to guess why my files weren't being copied to my USB flash drive. I thought it was broken. It would be better if this were made more intuitive.

The RedBurn wrote on the 30 Apr 08 at 12:53
This is absolutely necessary as a default setting.
Then let the user change it if he wants.
About Windows, I think it was async with at the XP release and then changed to sync with the SP1.

Vikstar wrote on the 9 May 08 at 05:58
If it auto mounts when you plug it in, then it is natural to think it will auto unmount when you pull it out... it just seems more symmetric/elegant.

I agree with making sync default, and let power-users who are used to unmounting thumb drives select that option in somewhere like "System -> Preferences -> Removable Drives and Media".

Also allow a right-click option or whatever on a mount to set it back to async. For example, I could set an external USB harddrive to require manual unmount since it's use-case means it is always plugged in, but I want all my thumb/usb/ipod drives to be sync since I only plug them in momentarily to copy files across.

frogitts wrote on the 6 Jun 08 at 01:29
So I don't know if anyone realizes this, but pysdm (System > Administration > Storage device manager already has this option. Click on the drive you want to mount synced (you have to know where it is in /dev), click assistant > performance tab > I/O to the file system should be done synchronously. It's a bit much to get to, I realize, but it's in the logical place - in the storage device manager in the mount assistant. So that proposed solution is already in place. jez9999's solution is not, and I don't think it needs to be. If you know enough to want synchronous mode, you now know where it is.

frogitts wrote on the 6 Jun 08 at 01:33
Something else that was mentioned in this thread - when a usb device is unplugged and plugged back in, it's attached to the next highest /dev/sd. That is, if /dev/sda and /dev/sdb are already populated, the device is attached to /dev/sdc1. This also means that if /dev/sdb1 is unplugged without being unmounted (I tested it in both async and sync mode), when it's plugged back in it's mounted to /dev/sdc1, and can't be mounted to its normal mountpoint, because the normal mountpoint is still considered to be in use. Only a sudo umount will free it back up again. This would, I think, make it hard to write the additional information that was not received by the drive difficult, since Ubuntu doesn't realize that the drive you just unplugged is the same as the drive you plugged in right after it. Although that, in my opinion, is a bug.


Post your comment