>However, now 'df' reports erroneous disk usage
>% df
> Filesystem 1024-blocks Used Available Capacity Mounted on
>/dev/hda2 102424 98826 0 100% /
>/dev/hda1 119518 118538 980 99% /dosc
>/dev/hdb1 337080 246344 90736 73% /dosd
>
>The /dev/hda2 fs is my linux root partition, note that 'df' indicates
>that it is 100% full. It's obviously not.
This is the correct behavior for df and disk useage in general. When
you create a partition, mke2fs reserves 10% of the disk space (you can
change this - see mke2fs man page) for buffer (su) usage. As a user (non-root),
you cannont write in this reserved space, but if you su to root, you
will be able to, though it may reduce the efficientcy of your file
system. Df returns the percent of *usable* disk space in the capacity
column. If less than 10% of the disk is free (ie/ root wrote files
that filled the disk up), df will return a capacity of 100%. Hmm,
just looked at the mke2fs man page: it says it only reserves 5% of
the total space - this obviously varies from filesystem to filesystem;
but will always be documented in the man pages (RTFM). Filling the
root partition to capacity is a bad idea, as there is no space left for
important things like /tmp space, and spool space (mail and lpr, etc...).
During my first reboot, the system complained about not being able
to fsck the root filesystem (ext2) because it was mounted rw
So I ran 'rdev -R /vmlinuz 1' and the error message went away.
However, now 'df' reports erroneous disk usage
% df
Filesystem 1024-blocks Used Available Capacity Mounted on
/dev/hda2 102424 98826 0 100% /
/dev/hda1 119518 118538 980 99% /dosc
/dev/hdb1 337080 246344 90736 73% /dosd
The /dev/hda2 fs is my linux root partition, note that 'df' indicates
that it is 100% full. It's obviously not.
Furthermore, I can delete files from /dev/hda2 but 'df' still gives
me the same usage output, ie. 100% Capacity
Whenever I try to write a file, I get
% cat > t
quyqyweqiouweyoqiueyoqiu
cat: write error: No space left on device
BUT root-user does not have any problems writing files.
Does anyone one know what's going on? anyone? anyone?
I am running Linux Kernel 1.0 (yeah I know...it's time to upgrade)
on my 486DX250.
Here's my /etc/fstab file:
/dev/hdb1 /dosd msdos defaults
/dev/hda3 swap swap defaults
/dev/hda2 / ext2 defaults
/dev/hda1 /dosc msdos defaults
none /proc proc defaults
Here's what the /etc/mtabs look like:
/dev/hda2 / ext2 rw 0 0
/dev/hda1 /dosc msdos rw 0 0
none /proc proc rw 0 0
/dev/hdb1 /dosd msdos
Again...any pointers will be greatly appreciated!!!
---nadeem
On the ext2 fs, a percentage of space is reserved for the superuser. This
percentage can be changed using tune2fs. I believe that 'df' reports the
capacity percentage as the amount of non-superuser space used. This would
explain why a non-superuser can't write to the device -- to that user, the
disk appears 100% full.
--
Andrew Robinson
robi...@cnj.digex.net (MIME OK)