- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Creating a large file.
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
05-09-2006 08:05 PM
05-09-2006 08:05 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2006 08:11 PM
05-09-2006 08:11 PM
Re: Creating a large file.
you can do while creating
mkfs -F vxfs -o largefiles /dev/
or
fsadm -F vxfs -o largefiles ...
Chan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2006 08:13 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2006 08:13 PM
05-09-2006 08:13 PM
Re: Creating a large file.
see
man prealloc
prealloc testfile 3221225473
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2006 08:15 PM
05-09-2006 08:15 PM
Re: Creating a large file.
man newfs, mkfs, fsadm
My prev reply should be read as newfs not mkfs.
Chan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2006 08:15 PM
05-09-2006 08:15 PM
Re: Creating a large file.
Do you want to create file larger than 3 GB ? If yes, you can try this program,
/*
* Assuming this is named largetest.c, build with:
* cc -o largetest largetest.c
*/
#include
#include
#include
#include
#include
#include
#include
#include
#define ERROR(x,y) { if ( (x) == -1) { perror(y); exit(errno); } }
int main(int argn, char **argv)
{
const char *file;
int fd, len;
long long count;
ssize_t result;
long long offset;
struct timeval start, end, dif;
if (argn < 2)
file = "largefile.junk";
else
file = argv[1];
gettimeofday(&start, NULL);
fd = open(file, O_CREAT | O_TRUNC | O_RDWR , 00644);
ERROR(fd, "Failed to open file");
printf("Creating 3GB test file...\n");
count = (3*1024*1024*1024) - 1;
offset = lseek(fd, count, SEEK_CUR);
ERROR(offset, "Failed to set current offset");
printf("Writting at 3GB...\n");
result = write(fd, "b", 1); /* Write data at 3GB point */
ERROR(result, "Failed to write at 3 GB mark");
printf("Closing file...\n");
result = close(fd);
ERROR(result, "Failed to close file");
gettimeofday(&end, NULL);
timersub(&end, &start, &dif);
printf("Task took %ld.%ld sec to run.\n", dif.tv_sec, dif.tv_usec);
printf("Done. Large file created.\n");
}
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2006 08:18 PM
05-09-2006 08:18 PM
Re: Creating a large file.
If you want to create a file greater than 2Gb then you need the largefiles option on your filesystem when it was created and then while mounting it. Chan has already given you the commands.
I think thats the info you are looking for. But when you say you want to create a file of size 3GB+, if you mean how you can reserve some space for a file - then you can do a prealloc filename size(in bytes)
to reserver that much space for a file. This essentially creates a file with nulls making it the size you specified - But I am not sure if this is waht you want.
Regards,
Ninad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2006 08:56 PM
05-09-2006 08:56 PM
Re: Creating a large file.
I have created file system with largefile support and also mounted with large file support.
I wanted to create some largefiles on them for testing purpose.
Thanks for your help.
Thanks & regards,
Prasad.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2006 09:35 PM
05-09-2006 09:35 PM