I'm trying to use the following command to erase an externally attached (USB 3) drive:
Code:
dd if=/dev/zero of=/dev/sdc
Depending on the block size I use, this command quickly eats the RAM buffer and eventually crashes my laptop. 1GB block size will freeze the laptop within a few minutes. Default, 512b block size freezes it within 15 minutes or so.
I also tried the following command to try and disable caching with similar results:
Code:
dd if=/dev/zero of=/dev/sdc bs=1G conv=sync
Relevant details:
Code:
$ uname -a
Linux laptop 4.1.21-14-default #1 SMP PREEMPT Sun Apr 17 07:27:45 UTC 2016 (fc187c1) x86_64 x86_64 x86_64 GNU/Linux
$ free -m
total used free shared buffers cached
Mem: 11894 2776 9117 421 13 929
-/+ buffers/cache: 1833 10060
Swap: 0 0 0
This is what free reports right before my laptop freezes when (I think) it runs out of RAM:
Code:
$ free -m
total used free shared buffers cached
Mem: 11894 11824 69 411 7849 1131
-/+ buffers/cache: 2843 9050
Swap: 0 0 0
What's the correct way to prevent dd from using buffer?
Thanks!