- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- testing largefiles
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2000 12:48 AM
11-29-2000 12:48 AM
is there a way to easily create a massive file so I can test out that largefiles is working on my new lvols ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2000 12:55 AM
11-29-2000 12:55 AM
Re: testing largefiles
Use the prealloc command. eg. to create a 2.5Gb file to test out if largefiles is on; prealloc testfile 2500000000
If prealloc returns the error; file too large you know you havent got largefiles on.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2000 01:00 AM
11-29-2000 01:00 AM
Re: testing largefiles
Prealloc is the command to use. See man page on it. If will take some time to create such a large file though so be patient.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2000 01:00 AM
11-29-2000 01:00 AM
SolutionIf the option largefiles is set your system will be able to use files greater than 2GBs and so you should test this fact typing:
prealloc file-test 2100000000
Federico
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2000 01:06 AM
11-29-2000 01:06 AM
Re: testing largefiles
Thanks for the fast replies everyone!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2000 12:01 PM
11-30-2000 12:01 PM
Re: testing largefiles
My problem with prealloc is that it only writes nulls.
Not very good if you're testing compression, encryption, or file transfer stuff.
Here's a program I wrote that generates big files with lots of random characters.
NOTE: It writes to stdout. Be sure to redirect
stdout into a file, otherwise it could screw up
your terminal window. (Lots of random garbage
has a habbit of doing that.)
To compile:
/opt/ansic/bin/cc bigfile.c -o bigfile
or
gcc bigfile.c -o bigfile
To run:
./bigfile 21 M R > /tmp/21meg_file_of_random
./bigfile 21 M > /tmp/21meg_file_of_sequential
===== cut here =====
#include
#include
#define MAXBUF 400000
Usage(Filename)
char *Filename;
{
fprintf(stderr,"Script to write a file of random characters.\n");
fprintf(stderr,"Usage: %s filesize [B|K|M|G] [R]\n",Filename);
fprintf(stderr,"Specify R on the end for random, rather than sequential.\n");
fprintf(stderr,"Example: %s 15 K\n",Filename);
exit(-1);
}
int main(argc,argv)
int argc; char *argv[];
{
long FileSize;
char Scale;
long ScaleNum;
char Buf[MAXBUF];
int BufLen;
int RandomFlag=0;
if (argc < 2) Usage(argv[0]);
if (argc > 4) Usage(argv[0]);
if (argc == 2) Scale='K';
else
{
Scale=argv[2][0];
if (islower(Scale)) Scale=toupper(Scale);
}
FileSize = atol(argv[1]);
if (argv[argc-1][0]=='R') RandomFlag=1;
switch(Scale)
{
case 'K': ScaleNum=1024; break;
case 'M': ScaleNum=1024*1024; break;
case 'G': ScaleNum=1024*1024*1024; break;
default:
Scale='B';
case 'B': ScaleNum=1; break;
}
fprintf(stderr,"Generating file size %ld%c ",FileSize,Scale);
FileSize *= ScaleNum;
fprintf(stderr,"(%ld bytes)\n",FileSize);
/* dump the data */
srand(time(NULL));
BufLen=0;
while(FileSize)
{
if (RandomFlag)
{
fputc(rand()%256,stdout);
Buf[BufLen] = (rand()%256);
}
else
{
Buf[BufLen] = (BufLen%256);
BufLen++;
if (BufLen >= MAXBUF)
{
write(1,Buf,BufLen);
BufLen=0;
}
}
FileSize--;
}
if (BufLen > 0) write(1,Buf,BufLen);
return(0);
}