Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have problems transferring binary programs to a micro-controller prototype board when using ubuntu/kubuntu to mount the board via usb. With MacOS and Windows there are no problems. I have found the writing from Ubuntu definitely changes the written file. I suspect that the write caching is the problem. How can I disable it, or what else might be the problem.

share|improve this question
add comment

1 Answer 1

up vote 5 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.