How to switch off caching for usb device when writing to it?

Read this first: http://groups.google.com/group/linux.kernel/msg/8d1591196c0ae15e?pli=1
I am unsure if it is true or not.

You can try using hdparm to set the write caching feature to off at runtime. (You will probably need to run this after every boot or every time you remove and reinsert the device)

sudo hdparm -W 0 /dev/devicename

Please ensure you know the correct device name (sdb, sdc or so on).

You can find out the device name by running:

sudo fdisk -l

You can also edit /etc/fstab and add the mount options sync,dirsync however I am not very familiar with how /etc/fstab works with removable devices. I think they need a permanent mount point.


kudos to @NightwishFan for the hdparm switch to set the drive's write-caching feature.

Note that the sync mount option decreases the speed by a magnitude (over 10 times). flush mount option ensures an effective writing with no performance cost. Also I've been using it with no issues for a few years on all the FAT devices (spinning or flash-memory based) I've used: Actually the whole set of mount options is noauto,users,noatime,flush,umask=111,dmask=000, set manually or in /etc/fstab.


I have replaced "sync" in favor of "noatime,flush" like stated in @tuk0z answer.

This lead to the USB floppydrive behaving the same like sync, but it writes files so much faster, like the normal operationspeed you expect it to be.

Reading image files from floppy does not result in random artifacts anymore. Also reading DD floppies does not result in weird characters in filenames.

Perhaps it's a bit unfortunate how the official documentation of "mount" put the usage in context.

Kudos!