Out of disk space though df/du show space available

Out of disk space though df/du show space available

Post by Albert Chin-A-Youn » Thu, 22 Mar 2001 04:55:05



$ uname
SunOS beeba 5.6 Generic_105181-23 sun4u sparc SUNW,Ultra-2
$ whomi
root
$ df -k /dev/dsk/c0t1d0s0
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/dsk/c0t1d0s0    2053420 1850245  203175    91%    /mnt
$ cd /mnt
$ dd if=/dev/zero of=foo
write: No space left on device
128705+0 records in
128705+0 records out
$ df -k /dev/dsk/c0t1d0s0
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/dsk/c0t1d0s0    2053420 1914637  138783    94%    /mnt
$ du -ks /mnt
1914637 /mnt

Why isn't /mnt at 100%?

--
albert chin (china at thewrittenword dot com)

 
 
 

Out of disk space though df/du show space available

Post by Chris Thomps » Thu, 22 Mar 2001 06:14:51




Quote:>$ uname
>SunOS beeba 5.6 Generic_105181-23 sun4u sparc SUNW,Ultra-2
>$ whomi
>root
>$ df -k /dev/dsk/c0t1d0s0
>Filesystem            kbytes    used   avail capacity  Mounted on
>/dev/dsk/c0t1d0s0    2053420 1850245  203175    91%    /mnt
>$ cd /mnt
>$ dd if=/dev/zero of=foo
>write: No space left on device
>128705+0 records in
>128705+0 records out
>$ df -k /dev/dsk/c0t1d0s0
>Filesystem            kbytes    used   avail capacity  Mounted on
>/dev/dsk/c0t1d0s0    2053420 1914637  138783    94%    /mnt
>$ du -ks /mnt
>1914637 /mnt

>Why isn't /mnt at 100%?

By the look of it, you've tunefs'd this filing system to have minfree=0%.

The remaining free space may all consist of fragments, with no free
major blocks, which would mean that you cannot extend a large file
such as "foo".

Try "fstyp -v /dev/dsk/c0t1d0s0" and look at nbfree & nffree c. line 15
of the output.

Chris Thompson
Email: cet1 [at] cam.ac.uk

 
 
 

Out of disk space though df/du show space available

Post by Albert Chin-A-Youn » Thu, 22 Mar 2001 13:32:37





>>$ uname
>>SunOS beeba 5.6 Generic_105181-23 sun4u sparc SUNW,Ultra-2
>>$ whomi
>>root
>>$ df -k /dev/dsk/c0t1d0s0
>>Filesystem            kbytes    used   avail capacity  Mounted on
>>/dev/dsk/c0t1d0s0    2053420 1850245  203175    91%    /mnt
>>$ cd /mnt
>>$ dd if=/dev/zero of=foo
>>write: No space left on device
>>128705+0 records in
>>128705+0 records out
>>$ df -k /dev/dsk/c0t1d0s0
>>Filesystem            kbytes    used   avail capacity  Mounted on
>>/dev/dsk/c0t1d0s0    2053420 1914637  138783    94%    /mnt
>>$ du -ks /mnt
>>1914637 /mnt

>>Why isn't /mnt at 100%?
> By the look of it, you've tunefs'd this filing system to have minfree=0%.

Yep. Root is the only one writing to it so I didn't think minfree>0%
would buy me anything. Maybe I misunderstand what minfree is for (man
page for mkfs_ufs(1M) seems clear enough though).

Quote:> The remaining free space may all consist of fragments, with no free
> major blocks, which would mean that you cannot extend a large file
> such as "foo".
> Try "fstyp -v /dev/dsk/c0t1d0s0" and look at nbfree & nffree c. line 15
> of the output.

(line 15)
nbfree  4821    ndir    7511    nifree  233791  nffree  138665

I guess 'nbfree' is number of blocks free. What is nffree? Is there
anything I can do?

--
albert chin (china at thewrittenword dot com)

 
 
 

Out of disk space though df/du show space available

Post by Chris Thomps » Thu, 22 Mar 2001 21:45:00







>>>$ uname
>>>SunOS beeba 5.6 Generic_105181-23 sun4u sparc SUNW,Ultra-2
>>>$ whomi
>>>root
>>>$ df -k /dev/dsk/c0t1d0s0
>>>Filesystem            kbytes    used   avail capacity  Mounted on
>>>/dev/dsk/c0t1d0s0    2053420 1850245  203175    91%    /mnt
>>>$ cd /mnt
>>>$ dd if=/dev/zero of=foo
>>>write: No space left on device
>>>128705+0 records in
>>>128705+0 records out
>>>$ df -k /dev/dsk/c0t1d0s0
>>>Filesystem            kbytes    used   avail capacity  Mounted on
>>>/dev/dsk/c0t1d0s0    2053420 1914637  138783    94%    /mnt
>>>$ du -ks /mnt
>>>1914637 /mnt

>>>Why isn't /mnt at 100%?

>> By the look of it, you've tunefs'd this filing system to have minfree=0%.

>Yep. Root is the only one writing to it so I didn't think minfree>0%
>would buy me anything. Maybe I misunderstand what minfree is for (man
>page for mkfs_ufs(1M) seems clear enough though).

Well, it tells no lies, but it doesn't give the whole story either!

Quote:>> The remaining free space may all consist of fragments, with no free
>> major blocks, which would mean that you cannot extend a large file
>> such as "foo".

>> Try "fstyp -v /dev/dsk/c0t1d0s0" and look at nbfree & nffree c. line 15
>> of the output.

>(line 15)
>nbfree  4821    ndir    7511    nifree  233791  nffree  138665

>I guess 'nbfree' is number of blocks free. What is nffree?

nbfree is the number of free whole 8K blocks; nffree is the number of
free 1K fragments in blocks that have been subdivided. It looks as if
you've freed up a bit since the last reported "df", but once you've
used up the 4821*8K you would have left only the 138665*1K, and
although the latter is "available", it cannot be used to extend a
large file.

I said in another thread that this wasn't really the place for a
tutorial on UFS internals, but I'll attempt a brief explanation.

The basic allocation unit is the 8K block. To support larger numbers
of small files without having to allocate ceiling(size/8K) blocks to
each, some blocks can be subdivided into 1K fragments. All allocated
space not pointed to directly from the inode, i.e. that at offsets
greater than 96K in a file (including the indirect blocks) have to
be whole blocks: fragments cannot be used for this purpose. If a
file is less than 96K in size, what would have been the last 8K
block can be allocated as 1K to 7K from a fragmented block. The
unused fragments can be used only for such allocations in other
files. When all fragments in a block are freed, it is returned to
use as a whole block.

Quote:>                                                           Is there
>anything I can do?

Not without some filing system reorganisation. If you use
"tunefs -o space" on a filing system, the allocation algorithm
is tweaked to try harder to use already fragmented blocks rather
than fragmenting new blocks closer to where the rest of the file,
or its inode, are. This will reduce fragmentation at the expense
of increasing disk access times. But it won't do anything to an
existing filing system immediately, until you delete and recreate
a lot of the small files.

You can create UFS filing systems without fragments, e.g. by using
"newfs -b 8192 -f 8192". But although this will enable you to achieve
the goal of making your filing system 100% full (with minfree=0), it
won't have actually gained you anything, as the small files will have
whole blocks allocated in place of your existing "available" space.

Fragments are not the only reason that one is advised to avoid filling
up UFS filing systems completely. Even with only whole blocks to
consider, as they run short it becomes necessary to allocate them
in smaller consecutive runs, more sparsely around the disc. This
can drastically increase access times.

Chris Thompson
Email: cet1 [at] cam.ac.uk

 
 
 

1. df -k did not show up the right amout of available space after moving files.

I have a /disk1 that has reached 91% of it capacity, so I decided to move
the largest files, around 10%,  to an other disk /disk2 and link them with
ln.

here is the result of df -k   before the move
             Av. capacity
/diskl        91%
/disk2       35%

after the move df -k showed:
             Av. capacity
/diskl        91%       /*** still the same  **/
/disk2       47%

Any idea why the capacity of /disk1 did not change.

Two weeks ago I did the same thing with two other disks but the changes
appears instantly.

Platform: SunOS  5.7 Generic_106541-04 sun4u

Thanks for any help.

Mahmoud Kamoun

2. kernel parameters

3. help: df show the wrong disk space

4. Help in configuring RAID on IBM PC SERVER 704

5. du and df -t gives me different values for used space.

6. Refresh desktop command in KDE2?

7. Space doesn't show in df after adding volume to hd2 (/usr)

8. IDPROM error

9. DF not showing correct space - WHY?

10. df reporting wrong available space

11. Hard disk space - how to alter the 10% 'root only' space

12. Disk space, where are my files, where is my free space?