Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dd fail to write to tmpfs

Tags:

linux

dd

tmpfs

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?

like image 637
user3170177 Avatar asked Dec 04 '22 08:12

user3170177


2 Answers

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

like image 174
Vasily Tarasov Avatar answered Dec 15 '22 11:12

Vasily Tarasov


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

like image 35
BiG_NoBoDy Avatar answered Dec 15 '22 12:12

BiG_NoBoDy