Force dd not to cache or not to read from cache

Based on @sendmoreinfo's answer:

dd if=/dev/device iflag=direct bs=1M

It does not affect read-cache.


You could try

sync
echo 3 > /proc/sys/vm/drop_caches

which drops all sorts of caches.

For details see /usr/src/linux/Documentation/sysctl/vm.txt on drop_caches.

(Note: the question was about busybox dd which to date still does not support iflag=direct.)


Direct I/O (open mode O_DIRECT) should work, but your kernel and/or dd may not support it.

Tags:

Linux

Dd