How to create a large file
Hi all,
I would like to create a file that takes up a lot of disc space on Debian. Say 5 GB or more. Is there a way that I can create such a file from nothing? The reason I am asking is this: I would like to artifically fill my server after reinstallation and then shred that file to overwrite any information that might be left in the difference between a clean install and the previous install with data. If theres a command to create a from "nothing" please let me know... |
dd if=/dev/zero of=/path/to/bigfile count=10000000
Yves. |
try piping /dev/urandom to a file, not sure how you woudl stop it when you got to the right size tho
|
Quote:
To use a pipe, you would have to do something like "cat /dev/urandom" I don't know if that's legal (and I am not about to try......;) ) |
Sure it is, but you wouldn't pipe it - use it instead of /dev/zero in dd.
Use a decent blocksize as well. |
thanks YinYeti, it worked like a charm!
|
You're welcome :)
Note that dd is more powerfull than my knowledge reckons ;) Thanks syg00 for reminding me about that. In my example, I used the default block size, which is 512 Bytes. By specifying a saner block size, you could at least simplify the computations that give you the "count" argument. Besides, /dev/random or similar may indeed interest you if you want random content in your result file. Yves. Edit: see here: http://www.linuxquestions.org/questi...d.php?t=362506 |
All times are GMT -5. The time now is 10:45 PM. |