HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Discrepancy between bdf, df and ls
Operating System - HP-UX
1832678
Members
2992
Online
110043
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
10-24-2002 08:59 AM
10-24-2002 08:59 AM
Hello All,
We have a 5 GB filesystem /oradata1 that is 80% full. We have 1 GB free. Our Oracle DBA created a 2 GB *.dbf file. How is this possible?
When I go into the directory /oradata1/oradata/some_instance and do an ll the file temp01.dbf is 2 GB in size.
However when I do a "du -ks *" in /oradata1/oradata/some_instance directory I get the size of temp01.dbf as 72 KB.
A bdf still shows 80% usage. So does df -k. Does anyone know the cause of this discrepancy?
Thanks in advance to all replies.
Regards,
Suren Selva
We have a 5 GB filesystem /oradata1 that is 80% full. We have 1 GB free. Our Oracle DBA created a 2 GB *.dbf file. How is this possible?
When I go into the directory /oradata1/oradata/some_instance and do an ll the file temp01.dbf is 2 GB in size.
However when I do a "du -ks *" in /oradata1/oradata/some_instance directory I get the size of temp01.dbf as 72 KB.
A bdf still shows 80% usage. So does df -k. Does anyone know the cause of this discrepancy?
Thanks in advance to all replies.
Regards,
Suren Selva
Experience is worth nothing if not gained from!
Solved! Go to Solution.
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2002 09:28 AM
10-24-2002 09:28 AM
Solution
Answer: sparse files (very common question). Oracle creates only a few parts of the file at random file positions, the rest of the file is undefined. A sparse file is one that has been created with 'holes' or unwritten parts.
Consider writing a file with record #1, then by seeking to record one million, writing another record and then closing the file. The file has but two records and occupies only a couple of blocks but the missing parts are not stored nor counted in bdf(1) or du(1).
Depending on the size of the file and the spareseness, the difference in apparent versus actual size may be VERY large.
Create your own sparse file with:
dd if=/etc/issue of=/var/tmp/sparse bs=2048k seek=1
where you will see the original file is just a few dozen bytes, the result with ls -l or wc -c shows a 2 meg file, but du(1) will show the file as occupying just a bit more than the original /etc/issue file. A cp(1) of the file will create a new file that is the same size (using ls -l or wc -c) but du(1) will now show a MUCH larger size than the original file.
A common file that is often sparse is a core file from a crashed program. Another file that might be sparse is /etc/mail/aliases.pag. And of course, any programmer could write special code that creates a sparse file.
Bill Hassell, sysadmin
Consider writing a file with record #1, then by seeking to record one million, writing another record and then closing the file. The file has but two records and occupies only a couple of blocks but the missing parts are not stored nor counted in bdf(1) or du(1).
Depending on the size of the file and the spareseness, the difference in apparent versus actual size may be VERY large.
Create your own sparse file with:
dd if=/etc/issue of=/var/tmp/sparse bs=2048k seek=1
where you will see the original file is just a few dozen bytes, the result with ls -l or wc -c shows a 2 meg file, but du(1) will show the file as occupying just a bit more than the original /etc/issue file. A cp(1) of the file will create a new file that is the same size (using ls -l or wc -c) but du(1) will now show a MUCH larger size than the original file.
A common file that is often sparse is a core file from a crashed program. Another file that might be sparse is /etc/mail/aliases.pag. And of course, any programmer could write special code that creates a sparse file.
Bill Hassell, sysadmin
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP