Categories
Ubuntu

Ubuntu – USB Drives – Optimising for quick removal (nearly)

As default USB drives in Ubuntu are optimised for performance, i.e. when data is written to the drive it is cached.  When you unmount or eject the drive, you usually get a notification to wait whilst data is written to the drive.

After searching a bit on the net I found that you can add a couple of options to the device, sync and dirsync that cause the data to by written synchronusly rather than caching it.  I have been running with this option enabled and it seems to work.

When I now eject the drive (NOTE: You still need to unmount / eject else you get a warning!) it ejects straight away without the please wait whilst the OS clears the  cache.

To set the option install gconf-editor if it is not installed via sudo apt-get install gconf-editor or synaptic package manager.

run gconf-editor from a terminal or choose Applications > System Tools > Configuration Editor.

Navigate to System > Storage > default_options

I added the option to the vfat section, which covers most usb flash drivers because they are Fat16 or FAt32.

I have not tried it with the ntfs etc, as I still want ubuto to cache writes to my ntfs partitions.

In the right had side, double click the mount_options item to bring up the editor

Click add, and enter
sync
choose Ok.

Click add, and enter
dirsync
choose Ok.

The options are now added. Click Ok to close the key editor, and close gconf-editor.

You should now be cooking on gas…