Beware of sync option in mount

By default mount is using async option, which means that  write operations do not wait for final confirmation from the device – they are stored in disc cache and writes are done latter, optimized by disc firmware.  However you can set sync option manually ( -o sync), then write operations are synchronous, meaning each block write has to wait for confirmation that it’s physically written to the  disc and there is no optimization available.  This can significantly slow down write speed, of which I convinced myself just recently – I backuped  some data to external 2.5″ USB 3.0 HD – slowdown in this case was almost 1000x  –  (70kb/s vs 60MB/s   measured by rsync --progress).  How it happened that disc was mounted with sync option? I actually use usbmount to auto-mount disks and it has sync as default mount option (fortunately can be changed in it’s configuration). So conclusion is – don’t use sync  option unless you know exactly what you are doing and if write speed is suspiciously slow check mount options.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">