Hi,
Can anyone help me out. My problem: When I do a "df" on my file system, it reports incorrectly this is what I get on some on one of my partitions.
------------------------------ Filesystem Size Used Avail Use% Mounted on /dev/hdb1 7.7G 33M 7.3G 1% /vol2 -----------------------------
THe size of the disk is 7.7 GB and it says available is 7.3 GB that means 400 MB is used, it however reports 33M is used, although the HDD is empty.
And "du -sh /vol2" gives me
--------------------------- 37kB /vol2 --------------------------
There is nothing on the partition /vol2. What could be the reason for this...
This is an answer I got "Deleted files/open files still held open are reflected in df but not du."
Any ideas?
Regards, Keith
Keith Fernandez keith@theargoncompany.com said:
THe size of the disk is 7.7 GB and it says available is 7.3 GB that means 400 MB is used, it however reports 33M is used, although the
HDD is
empty.
What filesystem are you using - ext2, ext3, reiserfs, xfs?
Sorry about that. I am using ext3.
Regards, Keith
Keith Fernandez keith@theargoncompany.com said:
THe size of the disk is 7.7 GB and it says available is 7.3 GB that means 400 MB is used, it however reports 33M is used, although the
HDD is
empty.
What filesystem are you using - ext2, ext3, reiserfs, xfs?
On Wed, Nov 19, 2003 at 08:09:18PM +0530, Keith Fernandez wrote:
Filesystem Size Used Avail Use% Mounted on /dev/hdb1 7.7G 33M 7.3G 1% /vol2
THe size of the disk is 7.7 GB and it says available is 7.3 GB that means 400 MB is used, it however reports 33M is used, although the HDD is empty.
Two possible reasons - some space is actually used up in the filesystem data, such as inode tables and superblock information in case of extx. Also, the values in Gigs and Megs will have problems rounding up ... try comparing the actual bytes used.
And "du -sh /vol2" gives me
37kB /vol2
There is nothing on the partition /vol2. What could be the reason for this...
I believe this must be the size that is taken up by the filesystem data itself ...
"Deleted files/open files still held open are reflected in df but not du."
Thats true ... typical examples are the files in /var/log ... the actual space taken up on the disk at a given time is different from what the filesystem thinks is the size of the file ... df and du work by looking at different sources for their information, hence the discrepancy.
du will tell you exactly how many bites are taken up by the file. But df will simply ask the filesystem to see how many blocks are allocated to the same file. Thus if you create a file containing a single byte, du will say "one byte" but df will say one block, that is 512 or 1024 bytes in most cases!
Since very few files are exact multiples of the block size, a little space is wasted in every file - that's called internal fragmentation, I think. Hence df will report more than the actual physical size - it will show the amount of space that has been "allocated" to the file.
DISCLAIMER: These are my conjectures based on a little familiarity with filesystems, somebody please correct me if I am wrong!
Sameer.
I believe this must be the size that is taken up by the filesystem data itself ...
Thanks Sameer, Just one more question, Would there be such a huge difference. 33k is what the file system is using, 33 MB is what showing and 400 MB Is the difference between total size and available.
More importantly is there any way to correct this. Can I get usage stats of my hdd which are much more reliable. I did try "sync" but that did not seem to help.
Regards, Keith
On Wed, Nov 19, 2003 at 08:09:18PM +0530, Keith Fernandez wrote:
Filesystem Size Used Avail Use% Mounted on /dev/hdb1 7.7G 33M 7.3G 1% /vol2
THe size of the disk is 7.7 GB and it says available is 7.3 GB that means 400 MB is used, it however reports 33M is used, although the HDD is empty.
Two possible reasons - some space is actually used up in the filesystem data, such as inode tables and superblock information in case of extx. Also, the values in Gigs and Megs will have problems rounding up ... try comparing the actual bytes used.
And "du -sh /vol2" gives me
37kB /vol2
There is nothing on the partition /vol2. What could be the reason for this...
I believe this must be the size that is taken up by the filesystem data itself ...
"Deleted files/open files still held open are reflected in df but not du."
Thats true ... typical examples are the files in /var/log ... the actual space taken up on the disk at a given time is different from what the filesystem thinks is the size of the file ... df and du work by looking at different sources for their information, hence the discrepancy.
du will tell you exactly how many bites are taken up by the file. But df will simply ask the filesystem to see how many blocks are allocated to the same file. Thus if you create a file containing a single byte, du will say "one byte" but df will say one block, that is 512 or 1024 bytes in most cases!
Since very few files are exact multiples of the block size, a little space is wasted in every file - that's called internal fragmentation, I think. Hence df will report more than the actual physical size - it will show the amount of space that has been "allocated" to the file.
DISCLAIMER: These are my conjectures based on a little familiarity with filesystems, somebody please correct me if I am wrong!
Sameer.
Research Scholar, KReSIT, IIT Bombay http://www.it.iitb.ac.in/~sameerds/
The typical number of reserved blocks for ext3 is 5%. So that much space is actually reserved. You can change that limit when formatting the ext3 file system.
mke2fs -j -m 0
Amitay.
On Thu, 2003-11-20 at 16:10, Keith Fernandez wrote:
I believe this must be the size that is taken up by the filesystem data itself ...
Thanks Sameer, Just one more question, Would there be such a huge difference. 33k is what the file system is using, 33 MB is what showing and 400 MB Is the difference between total size and available.
More importantly is there any way to correct this. Can I get usage stats of my hdd which are much more reliable. I did try "sync" but that did not seem to help.
Regards, Keith
On Wed, Nov 19, 2003 at 08:09:18PM +0530, Keith Fernandez wrote:
Filesystem Size Used Avail Use% Mounted on /dev/hdb1 7.7G 33M 7.3G 1% /vol2
THe size of the disk is 7.7 GB and it says available is 7.3 GB that means 400 MB is used, it however reports 33M is used, although the HDD is empty.
Two possible reasons - some space is actually used up in the filesystem data, such as inode tables and superblock information in case of extx. Also, the values in Gigs and Megs will have problems rounding up ... try comparing the actual bytes used.
And "du -sh /vol2" gives me
37kB /vol2
There is nothing on the partition /vol2. What could be the reason for this...
I believe this must be the size that is taken up by the filesystem data itself ...
"Deleted files/open files still held open are reflected in df but not du."
Thats true ... typical examples are the files in /var/log ... the actual space taken up on the disk at a given time is different from what the filesystem thinks is the size of the file ... df and du work by looking at different sources for their information, hence the discrepancy.
du will tell you exactly how many bites are taken up by the file. But df will simply ask the filesystem to see how many blocks are allocated to the same file. Thus if you create a file containing a single byte, du will say "one byte" but df will say one block, that is 512 or 1024 bytes in most cases!
Since very few files are exact multiples of the block size, a little space is wasted in every file - that's called internal fragmentation, I think. Hence df will report more than the actual physical size - it will show the amount of space that has been "allocated" to the file.
DISCLAIMER: These are my conjectures based on a little familiarity with filesystems, somebody please correct me if I am wrong!
Sameer.
Research Scholar, KReSIT, IIT Bombay http://www.it.iitb.ac.in/~sameerds/
-- “I asked for strength and God gave me difficulties to make me strong. I asked for Wisdom... and God gave me problems to solve. I received nothing I wanted... But I received everything I needed."
Amitay.
Thanks Amitay, ur too cool
Regards, Keith
The typical number of reserved blocks for ext3 is 5%. So that much space is actually reserved. You can change that limit when formatting the ext3 file system.
mke2fs -j -m 0
Amitay.
On Thu, Nov 20, 2003 at 04:10:04PM +0530, Keith Fernandez wrote:
I believe this must be the size that is taken up by the filesystem data itself ...
Just one more question, Would there be such a huge difference. 33k is what the file system is using, 33 MB is what showing and 400 MB Is the difference between total size and available.
I guess Amitay's already explained where the missing space is!
More importantly is there any way to correct this. Can I get usage stats of my hdd which are much more reliable. I did try "sync" but that did not seem to help.
"sync" doesn't matter ... it only flushes the data in the buffers to the hard disk. What you need to do is make sure that there are no open files (one step is to stop all services that open log files). Then use "df" (not du), since it will show you the _actual_ available space on your disk. "du" will show you exact sizes of files, but that's not the same as the space they take up on the disk. "df" understands the properties of whatever filesystem you are using, and hence shows you whats really happening.
Sameer.