On 2014-09-22 16:09, Greg Freemyer wrote:
On September 22, 2014 9:18:44 AM EDT, "Carlos E. R." <> wrote:
On 2014-09-22 14:49, Greg Freemyer wrote:
Well for dd anyway you can bypass the cache all together. Adding oflag=direct should do it.
Ok, so that flag and a reasonable bs to compensate.
What about "dsync"? Or "nocache"?
Dsync just makes sure the data is written to disk asap, but it leaves a copy in cache. Not useful for writing an iso to a flash.
Ok, I see. Right.
Nocache probably works, but it first uses the kernel disk cache mechanism, then flushes it. That may or may not solve your issue.
Direct eliminates the use of the kernel cache altogether; that seems best for that use case.
Maybe I'll try them to time the results later.
I did: Telcontar:/data/storage_b/Isos/isos_13.1 # echo ; echo "*** direct" ; echo ; time dd if=openSUSE-13.1-DVD-x86_64.iso of=/dev/sde bs=100M oflag=direct ; echo ; time dd if=openSUSE-13.1-DVD-x86_64.iso of=/dev/sde bs=100M oflag=direct ; echo ; echo "*** dsync" ; echo ; time dd if=openSUSE-13.1-DVD-x86_64.iso of=/dev/sde bs=100M oflag=dsync ; echo ; time dd if=openSUSE-13.1-DVD-x86_64.iso of=/dev/sde bs=100M oflag=dsync ; echo ; echo "*** nocache" ; echo ; time dd if=openSUSE-13.1-DVD-x86_64.iso of=/dev/sde bs=100M oflag=nocache ; echo ; time dd if=openSUSE-13.1-DVD-x86_64.iso of=/dev/sde bs=100M oflag=nocache *** direct 43+1 records in 43+1 records out 4572839936 bytes (4.6 GB) copied, 906.21 s, 5.0 MB/s real 15m6.214s user 0m0.001s sys 0m5.762s 43+1 records in 43+1 records out 4572839936 bytes (4.6 GB) copied, 880.037 s, 5.2 MB/s real 14m40.058s user 0m0.000s sys 0m4.320s *** dsync 43+1 records in 43+1 records out 4572839936 bytes (4.6 GB) copied, 928.262 s, 4.9 MB/s real 15m28.304s user 0m0.002s sys 0m8.159s 43+1 records in 43+1 records out 4572839936 bytes (4.6 GB) copied, 923.614 s, 5.0 MB/s real 15m23.633s user 0m0.002s sys 0m8.098s *** nocache 43+1 records in 43+1 records out 4572839936 bytes (4.6 GB) copied, 910.864 s, 5.0 MB/s real 15m10.882s user 0m0.000s sys 0m7.767s 43+1 records in 43+1 records out 4572839936 bytes (4.6 GB) copied, 916.208 s, 5.0 MB/s real 15m16.239s user 0m0.002s sys 0m8.085s Telcontar:/data/storage_b/Isos/isos_13.1 # They all took the same time to write to the usb stick. There is something else, in the case of usb flash media, when writing files: there are regions, such as the filesystem metadata structures, that should better be cached, and written when needed, to minimize actual writes on the same area (even if the flash firmware distributes the actual writes). dsync is ruled out. Which would be better for that metadata consideration, direct or nocache? It does not matter for this case of "burning" an iso, but it would be different when copying files. I'm considering using dd when copying big video files to my flash sticks, my laptop becomes some unresponsive when doing that. As long as we don't know of a way to disable cache for an application or partition or disk... -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" at Telcontar)