It is currently Mon, 27 Jun 2022 13:04:36 GMT



 
Author Message
 Out of disk space though df/du show space available
$ 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)



 Sun, 07 Sep 2003 03:55:05 GMT   
 Out of disk space though df/du show space available
In article <998cip$2v...@bob.news.rcn.net>,
Albert Chin-A-Young  <ch...@devnull.com> wrote:

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



 Sun, 07 Sep 2003 05:14:51 GMT   
 Out of disk space though df/du show space available

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).

(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)



 Sun, 07 Sep 2003 12:32:37 GMT   
 Out of disk space though df/du show space available
In article <999at5$b0...@bob.news.rcn.net>,
Albert Chin-A-Young  <ch...@foo.com> wrote:

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

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.

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



 Sun, 07 Sep 2003 20:45:00 GMT   
 
   [ 4 post ] 

Similar Threads

1. help: df show the wrong disk space

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

3. DF not showing correct space - WHY?

4. df reporting wrong available space

5. df reporting wrong available space

6. Disk space differences (fdisk + df)

7. Hard disk space by df is strange???

8. Disk space by df on WD 730MB IDE

9. df -k reports incorrect disk space on Sun Ultra-1 running Solaris 2.5.1

10. wrong free disk space if I use df-command


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software