LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   'df -h' showing wrong free space on disk? (https://www.linuxquestions.org/questions/slackware-14/df-h-showing-wrong-free-space-on-disk-425101/)

Cdzin 03-15-2006 11:02 AM

'df -h' showing wrong free space on disk?
 
Hi all! Recently I've downloaded the new X.org source and right after that, even after installing and removing the source directory, the 'df' commmand has been confusing me about the amount of free space I have left on my disk. The output of it:

Filesystem Size Used Avail Use% Mounted on
/dev/hdb2 5.7G 5.1G 250M 96% /

Shouldn't I have like 600M available? Is there any distinction between non-used and available space? If so, then how can I make all my non-used space available?

Regards

jomen 03-15-2006 02:13 PM

Is your filesystem ext2 or ext3 ?
If yes - when you created it with the default options,like:
mkfs.ext3 -j /dev/hdaX
it reserves 5% of the space solely for the super-user aka: root - and consequently does not show this space in "df" even if it is there - but just for "root" to be able to log in and do maintanance even if somehow the filesysten got completely full.
Today, with the help of a live-cd this is easy to do from "outside" - so, for a pretty much "single user" desktop-system there is no need to reserve that much space just in case.
mkfs.ext3 -j -m 0 /dev/hdX
will set the amount of reserved space to 0 for example - that is what I have done on my system

sn9ke_eyes 03-15-2006 04:32 PM

Quote:

Originally Posted by jomen
Is your filesystem ext2 or ext3 ?
If yes - when you created it with the default options,like:
mkfs.ext3 -j /dev/hdaX
it reserves 5% of the space solely for the super-user aka: root - and consequently does not show this space in "df" even if it is there - but just for "root" to be able to log in and do maintanance even if somehow the filesysten got completely full.
Today, with the help of a live-cd this is easy to do from "outside" - so, for a pretty much "single user" desktop-system there is no need to reserve that much space just in case.
mkfs.ext3 -j -m 0 /dev/hdX
will set the amount of reserved space to 0 for example - that is what I have done on my system

Good info. But that would be when he is creating the filesystem right ? Since his filesystem is already created and in place, is there any way to adjust without losing/corrupting data ?

jomen 03-15-2006 04:56 PM

Only from "outside" - a live-cd like knoppix or the install cd...
the filesystem in question needs to be NOT mounted...
He could run:
tune2fs -m 0 -o journal_data -O dir_index,sparse_super /dev/hdaX
followed by:
fsck.ext3 -f -D /dev/hdaX
...to re-index the filesystem - to optimize the filesystem to use the hashed b-trees option of ext3 / ext2 - which is faster than the default.

Cdzin 03-16-2006 01:35 PM

Thank you jomen and sn9ke_eyes. Those commands did the trick. I didn't know of that reserved space.

Bye


All times are GMT -5. The time now is 08:47 PM.