SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The du command only outputs the usage of the files that exist there. The df output includes space 'reserved' for the journaling filesystem (ext3, reiserfs, etc.).
I had no idea that journaling filesystem or any filesystem required space, but compared to the size of the partition, it is a lot of space don't you think, I mean practically more than half the partion space is gone!! Is it OK????
It could be that a process has deleted a file but not closed all of the file descriptors pointing to it. This is unlikely in your case since you've formatted the disk and still have the problem, but try running `lsof +aL1 /boot` and see if anything turns up.
There are a couple of links I tried to post about open files, but I don't have 5 previous posts under my belt...
I have found the solution from another group & I am describing it below, it is going to be a bit long, so if you are not interested you can skip it now.
Thanks
For my first case
******************
bash-3.00$ df -h /boot
Filesystem Size Used Avail Use% Mounted on
/dev/hda6 48M 37M 11M 78% /boot
bash-3.00$ du -hs /boot
4.2M /boot
bash-3.00$
******************
The solution provider suggested this
************
I'm guessing you're using ReiserFS with the default 32MB journal.
************
and was he was right, it was ReiserFS, and you will notice that the difference between the df & du result is approximately 32MB. Makes sense... so I tried it for all my partitions
You will notice that all the results have an approximate difference of 32MB with the exception of /opt & /usr (the 2 most largest partitions). This is where the solution to my second problem comes in
For my second case
***********************
bash-3.00$ df -h /boot
Filesystem Size Used Avail Use% Mounted on
/dev/hda6 48M 37M 11M 78% /boot
bash-3.00$ du -hs /boot
4.2M /boot
bash-3.00$ df -h /opt
Filesystem Size Used Avail Use% Mounted on
/dev/hda8 1.2G 676M 470M 60% /opt
bash-3.00$ du -hs /opt
698M /opt
bash-3.00$
**********************
The solution provider suggested this
*****************
ReiserFS does tail packing, which means that it can use one disk block
for storing the last, incomplete blocks of two different files if they
both fit.
du doesn't know anything about tail packing and works on the basis of
how many blocks each file spans.
With ReiserFS you may find du is more accurate if you get it to ignore
block sizes, eg:
du -bhs /opt
*****************
and sure enough this time all the du results were smaller than df results
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.