LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
Thread Tools
Old 06-10-2008, 12:09 PM   #1
jeriryan
Member
 
Registered: Apr 2003
Distribution: RHEL 5
Posts: 39
Thanked: 0
Creating a test/junk file around 2gb


[Log in to get rid of this advertisement]
I need to create a test/junk file to benchmark the performance of a tape drive, but apparently I didn't install mkfile by default so is there any alternative? (Assume that even though I'm asking this question on the internet, I can't access the internet on Red Hat, so I'd like a built-in solution.)
jeriryan is offline     Reply With Quote
Old 06-10-2008, 12:15 PM   #2
pwc101
Senior Member
 
Registered: Oct 2005
Location: Southampton, UK
Distribution: Slackware
Posts: 1,698
Thanked: 93
Code:
dd if=/dev/zero of=./test_file bs=1024 count=2000000
pwc101 is offline     Reply With Quote
Old 06-10-2008, 08:30 PM   #3
ischi
Member
 
Registered: Apr 2008
Location: Tübingen
Distribution: Fedora 9 (Thinkpad T60), Debian 3.1 (Server)
Posts: 51
Thanked: 0
for a benchmark file it might be better to use /dev/random as a source just to get around any optimization that might be happening through compression while trenfering the file (just a thought dont know what you wnat to do excatly)
Code:
dd if=/dev/random of=./test bs=1024 count=2000000
ischi is offline     Reply With Quote
Old 06-11-2008, 04:58 AM   #4
pwc101
Senior Member
 
Registered: Oct 2005
Location: Southampton, UK
Distribution: Slackware
Posts: 1,698
Thanked: 93
Quote:
Originally Posted by ischi View Post
for a benchmark file it might be better to use /dev/random as a source just to get around any optimization that might be happening through compression while trenfering the file (just a thought dont know what you wnat to do excatly)
Code:
dd if=/dev/random of=./test bs=1024 count=2000000
Using /dev/random to create a 2GB file would take a year! /dev/random uses mouse input etc. as input to generate random numbers, and thus doesn't contain much data. It would be better to use /dev/urandom, which generates pseudo random data. However, this would still take a lot longer as generating the pseudo random data is processor intensive.
pwc101 is offline     Reply With Quote
Old 06-11-2008, 05:21 AM   #5
syg00
Guru
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 6,908
Thanked: 165
Mmmm - all random number generators need seeding. That's not the problem with /dev/random, but the fact that it blocks. /dev/urandom is a indeed better option, since it doesn't block - *if* the data really needs to be random.

Of more concern when I have done this sort of thing is whether the data needs to be a of a particular structure - say 20 chars followed by 8 digits, followed by ...
I tend to generate a small file, then copy (append) the file back and forth; fibonacci growth, and quickly gets to the required size. Simple shell script handles things.
syg00 is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
rpmbuild error: File ./test-2.3.0/SOURCES/test-2.3.0.tar.gz: No such file powah Linux - Software 1 12-13-2007 04:30 PM
ReiserFS 2Gb maximum file size limit? Cannot copy files bigger than 2Gb ihtus Suse/Novell 2 10-26-2007 10:21 AM
Creating files larger than 2GB Nerox Programming 11 08-03-2007 07:09 PM
mysqldump : Can I split the file up to 2GB max per file? Swakoo Linux - General 10 10-17-2005 05:13 AM
cdrecord junk; /proc junk lackluster Linux - Software 5 08-06-2003 11:37 PM


All times are GMT -5. The time now is 04:19 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration