LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.

Welcome to LinuxQuestions.org, a friendly and active Linux Community.

You are currently viewing LQ as a guest. By joining our community you will have access to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!

Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

Are you new to LinuxQuestions.org? Visit the following links:
Site Howto | Site FAQ | Sitemap | Register Now

If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.

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.

Reply
 
Thread Tools
Old 06-10-2008, 11:09 AM   #1
jeriryan
Member
 
Registered: Apr 2003
Distribution: RHEL 5
Posts: 38
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, 11:15 AM   #2
pwc101
Senior Member
 
Registered: Oct 2005
Location: Southampton, UK
Distribution: Slackware
Posts: 1,155
Code:
dd if=/dev/zero of=./test_file bs=1024 count=2000000
pwc101 is online now     Reply With Quote
Old 06-10-2008, 07:30 PM   #3
ischi
Member
 
Registered: Apr 2008
Location: Tübingen
Distribution: Fedora 9 (Thinkpad T60), Debian 3.1 (Server)
Posts: 51
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, 03:58 AM   #4
pwc101
Senior Member
 
Registered: Oct 2005
Location: Southampton, UK
Distribution: Slackware
Posts: 1,155
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 online now     Reply With Quote
Old 06-11-2008, 04:21 AM   #5
syg00
Guru
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 5,161
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

Submit thread to Digg | Submit thread to del.icio.us | Submit to LQ Bookmarks

« Back to Top »

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

vB 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 03:30 PM
ReiserFS 2Gb maximum file size limit? Cannot copy files bigger than 2Gb ihtus Suse/Novell 2 10-26-2007 09:21 AM
Creating files larger than 2GB Nerox Programming 11 08-03-2007 06:09 PM
mysqldump : Can I split the file up to 2GB max per file? Swakoo Linux - General 10 10-17-2005 04:13 AM
cdrecord junk; /proc junk lackluster Linux - Software 5 08-06-2003 10:37 PM



Add LQ To Your Yahoo Add LQ To Your Google Add LQ To Your MSN Add LQ To Your Blog
All times are GMT -5. The time now is 12:35 PM.

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
Open Source Consulting | Domain Registration