Creating a very large random file

Solution 1:

You can't read 300 gigabytes at once (in one block). Try

dd if=/dev/urandom of=random.bin bs=2g count=150

instead.