Create a Large file in Linux
I want to create a large file size lets says 600G. I used command
# fallocate -l 600G file01 Although I got the file of my size but the things is, there is no data. I want to create a file with size 600G and random data in it. Any suggestion? |
This is going to take a while, but something like this should work for you:
Code:
dd if=/dev/random of=filename bs=1M count=6000 |
Quote:
|
Quote:
# dd dd if=/dev/urandom of=file01 bs=1024 count=2097152 Little confusion, which one to use /dev/random or /dev/urandom so that I don't have to wait long to populate my file. |
As the manpag says, urandom will be quicker, but not as random. May not matter.
There is also frandom, but probably isn't available in your distro, so you'd have to compile and insmod it. For junk (rather than truly random data) to fill a file like that, I generate a small random file (10 Meg say), and merely copy it multiple times to the destination file. Much quicker, but not close to random. |
All times are GMT -5. The time now is 07:36 PM. |