I created a 5 MiB random file using openssl with head:
$ openssl enc -aes-256-ctr -pass pass:1o0SxTnYvbtjFtKLiuv3ccPebLOJiUU -nosalt < /dev/zero | head -c 5M > /mnt/pny1/file1
It created a file of the correct size, but also gave an error message:
error writing output file
I tried it with dd and got the same result:
$ openssl enc -aes-256-ctr -pass pass:1o0SxTnYvbtjFtKLiuv3ccPebLOJiUU -nosalt < /dev/zero | dd of=/mnt/pny1/file2 bs=1M count=5 iflag=fullblock
5+0 records in
5+0 records out
error writing output file
5242880 bytes (5.2 MB) copied, 0.0194212 s, 270 MB/s
I then tried overwriting a loop device using openssl with cat:
# openssl enc -aes-256-ctr -pass pass:1o0SxTnYvbtjFtKLiuv3ccPebLOJiUU -nosalt < /dev/zero | cat > /dev/loop0
cat: write error: No space left on device
error writing output file
Always error writing output file.
Why is this error occurring and how do I prevent it?