- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Creating files of large size without occupying fil...
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
08-31-2004 05:29 AM
08-31-2004 05:29 AM
Creating files of large size without occupying filesystem space
if you do a ls -l on the large file(let's say its 5gb oracle tempfile). it shows 5gb. but if you do a df -k the disk space allocation shows that there filesystem has not used the 5gb.
i know this is how oracle does tempfile allocation quickly. it creates the file and shows it as 5gb initially but it does not grab the disk space initally it grabs it when you need them. how does oracle do it? what kind of system calls do you think go into tricking us into believing that 5gb file is out there.
can any unix guru with internals knowledge explain to me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2004 05:37 AM
08-31-2004 05:37 AM
Re: Creating files of large size without occupying filesystem space
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2004 05:39 AM
08-31-2004 05:39 AM
Re: Creating files of large size without occupying filesystem space
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2004 05:48 AM
08-31-2004 05:48 AM
Re: Creating files of large size without occupying filesystem space
Well technically it doesn't use the space when a sparse file is created with prealloc.
It just defines beginning and ending block addresses.
BUT the space is *not* available for any other purpose at the same time. So it is used in a sense because nothing else can use it you could say.
My 2 cents,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2004 05:58 AM
08-31-2004 05:58 AM
Re: Creating files of large size without occupying filesystem space
so as per your post the the blocks in sparse files are not used by anybody else seems to be not case.
I know the cause, i know the workaround as far as oracle. I know oracle documentation cautions about this, but there is no explanation as to how oracle creates files like this.I am just curious to find from the o/s level how is this happening.
If someone can guide me to specific document or post that talks about this type of file creation that is great. I am not looking for pointers in some general direction.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2004 06:00 AM
08-31-2004 06:00 AM
Re: Creating files of large size without occupying filesystem space
:(root)> prealloc TESTFILE 50000000
:(root)> ls -lrt TESTFILE
-rw-rw-r-- 1 root sys 50000000 Aug 31 10:44 TESTFILE
:(root)> du -sk TESTFILE
48829 TESTFILE
So you can use the dd and echo to create sparse file.
:(root)> echo | dd bs=1024 seek=100000 of=large
0+1 records in
0+1 records out
:(root)> ls -lrt large
-rw-rw-r-- 1 root sys 102400001 Aug 31 10:44 large
:(root)> du -sk large
8 large
:(root)>
If you want to simulate the behaviour in C, you could open a file using open(), write a byte, lseek() and write a byte again. The resulting file will be of size greater than just 2 bytes.