I'm trying to create a large random file on a ramdisk, in order to do some tests. I've created the ramdisk and my starting file (from /dev/urandom) without much trouble, but I'm having trouble increasing it's size (I was hoping I could just cat it into itself to double it up until the disk was full), and I'm unsure why. I'm hoping someone can tell me what I'm overlooking.
First, the file is definitely there:
$ ls -la /mnt/ramdisk/ramfile
-rw-r--r-- 1 root root 163840 Nov 22 11:07 /mnt/ramdisk/ramfile
Second, I try to use cat to double it's size, which fails:
$ sudo -s "cat /mnt/ramdisk/ramfile >> /mnt/ramdisk/ramfile"
/bin/bash: cat /mnt/ramdisk/ramfile >> /mnt/ramdisk/ramfile: No such file or directory
So I guess I'm misunderstanding something here, because I would expect that to work. I also tried catting the starting file twice to another file, but I got a similar error.
In case it's relevent, I created the file as follows:
sudo dd if=/dev/urandom of=/mnt/ramdisk/ramfile bs=16384 count=10
The reason I want to do this, I found urandom to be quite slow to read from (even on a massively overpowered server) and I want to ensure that the read speed from this random file isn't a bottleneck.
EDIT:
Versions-
GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)
cat (GNU coreutils) 8.21
Ubuntu 14.04 x86_64