dd fail to write to tmpfs

6.9k views Asked by At

I'd like to measure tmpfs performance by using dd. But it fail, like below:

# dd if=/dev/zero of=/tmp/128M bs=4M count=32 oflag=direct  
dd: failed to open ‘/tmp/128M’: Invalid argument

Any help?

2

There are 2 answers

0
Vasily Tarasov On

tmpfs does not support direct I/O and returns -EINVAL.

0
BiG_NoBoDy On

Vasily Tarasov solution worked with NFS too. I had:

dd if=/dev/urandom of=TEST.200GB iflag=direct bs=1M count=204800
dd: failed to open ‘/dev/urandom’: Invalid argument

then I have removed iflag=direct and it worked