- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Using "touch" command to create large files?? ...
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
Discussions
Discussions
Discussions
Forums
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
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-18-2005 04:04 AM
тАО05-18-2005 04:04 AM
Thanks,
Angie
Solved! Go to Solution.
- Tags:
- Touch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2005 04:07 AM
тАО05-18-2005 04:07 AM
Re: Using "touch" command to create large files?? Is it possible??
Pete
Pete
- Tags:
- prealloc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2005 04:10 AM
тАО05-18-2005 04:10 AM
Re: Using "touch" command to create large files?? Is it possible??
No but you could use prealloc e.g
prealloc ./test 100000000 >> /tmp/testperf2
All the best
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2005 04:11 AM
тАО05-18-2005 04:11 AM
Re: Using "touch" command to create large files?? Is it possible??
prealloc ./test 100000000 >> /tmp/testperf2
Thanks!
Angie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2005 04:13 AM
тАО05-18-2005 04:13 AM
Re: Using "touch" command to create large files?? Is it possible??
Regards,
Fred
"Reality is just a point of view." (P. K. D.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2005 04:14 AM
тАО05-18-2005 04:14 AM
Solutiondd if=/dev/zero bs=1k seek=52428799 count=1 of=mybigfile
If you do an ls -l mybigfile, it will display 50GB but a du -k will display only only 1 block because a sparse file has "holes". When a sparse file is read, the "holes" are filled in with NUL's so a copy of mybigfile will actually use 50GB of space.
- Tags:
- dd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2005 04:18 AM
тАО05-18-2005 04:18 AM
Re: Using "touch" command to create large files?? Is it possible??
Angie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2005 04:21 AM
тАО05-18-2005 04:21 AM
Re: Using "touch" command to create large files?? Is it possible??
$ ll filler
-rw-rw-r-- 1 plr support 100 May 18 12:20 filler
$
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2005 04:23 AM
тАО05-18-2005 04:23 AM
Re: Using "touch" command to create large files?? Is it possible??
if you have all that space available, you could try something like this in the directory you want the file "big" to be put:
# prealloc big $((50*1024*1024*1024*1024))
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2005 04:23 AM
тАО05-18-2005 04:23 AM
Re: Using "touch" command to create large files?? Is it possible??
dd if=/dev/zero bs=256k count=204800 of=mybigfile
and unlike prealloc, dd is a standard UNIX/Linix command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2005 04:23 AM
тАО05-18-2005 04:23 AM
Re: Using "touch" command to create large files?? Is it possible??
I did put e.g. Yes it creates (or reseves) a 100Mb space Up to you to adapt to your needs
note that
prealloc ./test 100000000 creates test of about 100MB
>> /tmp/testperf2 creates a file of 100MB in /tmp
I use this to see how my disks work when I suspect an issue...
You would need then >50000000000
All the best
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2005 04:28 AM
тАО05-18-2005 04:28 AM
Re: Using "touch" command to create large files?? Is it possible??
$ bdf
File System......Mbytes....Used.. Avail %Used Mounted on
/dev/vg00/lvol3.... 200.... 169......31.. 85% /
/dev/vg00/lvol1.... 288......56.... 203.. 22% /stand
/dev/vg00/lvol8....3000.... 431....2550.. 14% /var
/dev/vg00/lvol7....3000....1067....1918.. 36% /usr
/dev/vg00/lvol6.... 200......40.... 159.. 20% /tmp
/dev/vg00/lvol5....2000....1625.... 372.. 81% /opt
/dev/vg00/lvol4....1600.... 582....1012.. 36% /home
$ prealloc filler 1000000000
$ bdf
File System......Mbytes....Used.. Avail %Used Mounted on
/dev/vg00/lvol3.... 200.... 169......31.. 85% /
/dev/vg00/lvol1.... 288......56.... 203.. 22% /stand
/dev/vg00/lvol8....3000.... 431....2550.. 14% /var
/dev/vg00/lvol7....3000....1067....1918.. 36% /usr
/dev/vg00/lvol6.... 200......40.... 159.. 20% /tmp
/dev/vg00/lvol5....2000....1625.... 372.. 81% /opt
/dev/vg00/lvol4....1600....1535......65.. 96% /home
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2005 04:32 AM
тАО05-18-2005 04:32 AM
Re: Using "touch" command to create large files?? Is it possible??
I ended up using dd if=/dev/zero bs=1k seek=52428799 count=1 of=mybigfile and then I copied the file it created to another file, and it worked good. Didn't take too long either. I wanted to use this command too because I may use this on a Linux system here too.
Thanks for all the great feedback again and will post some points to all you brainiacs!
Have a nice day!
Angie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2005 07:10 AM
тАО05-18-2005 07:10 AM
Re: Using "touch" command to create large files?? Is it possible??
I did the following:
dd if=/dev/zero bs=2k seek=26214399 count=1 of=file1
See below:
-rw-r--r-- 1 root root 53687091200 2005-05-18 11:52 file1
-rw-r--r-- 1 root root 53687091200 2005-05-18 11:58 file2
-rw-r--r-- 1 root root 53687091200 2005-05-18 12:00 file3
-rw-r--r-- 1 root root 53687091200 2005-05-18 12:02 file4
But again with a "df" command still shows only 1% is in use when it should be like 50% in use with 20 of these 50-gig files.
Thanks for responding.
Angie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2005 07:39 AM
тАО05-18-2005 07:39 AM
Re: Using "touch" command to create large files?? Is it possible??
I just tried a 20MB sparse file and copied it and ls -l and du -k reported just as expected as did df -k.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2005 08:45 AM
тАО05-18-2005 08:45 AM
Re: Using "touch" command to create large files?? Is it possible??
host:/test/temp # du -k
1024005
Angie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2005 10:14 AM
тАО05-18-2005 10:14 AM
Re: Using "touch" command to create large files?? Is it possible??
dd if=/dev/zero bs=256k count=204800 of=mybigfile
Angie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2005 10:21 AM
тАО05-18-2005 10:21 AM
Re: Using "touch" command to create large files?? Is it possible??
I still don't know why cp did not completely copy the sparse file. I would try "cat < file1 > file2".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2005 10:31 AM
тАО05-18-2005 10:31 AM
Re: Using "touch" command to create large files?? Is it possible??
Thank you.. this is going to work out great!
Angie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2005 09:14 PM
тАО05-18-2005 09:14 PM
Re: Using "touch" command to create large files?? Is it possible??
$ echo "some dummy stuff" >> filename
$ tail -1000 -f filename >> filename
After few minutes of runnning it would grow to large size. You can press Ctrl-C to interrupt and check the size, if it is not yet 5GB, you can continue with the tail command.