Filesystem size and free space

Peter Jeremy peterjeremy at optushome.com.au
Fri Nov 14 17:42:13 PST 2008


On 2008-Nov-14 12:27:34 +0200, Andrei Kolu <antik at bsd.ee> wrote:
>due to migration from Windows Server 2003 NTFS filesystem to FreeBSD 
>7.1Beta2 UFS+softupdates filesystem I encountered strange problem. NTFS 
>formatted filesystem seen in FreeBSD as read-only and exactly 500GB with 
>28GB free space but after format to UFS disk shows up as 484GB and after 
>copying back files that was on same disk (from ntfs) UFS filesystem 
>shows that I got -33GB (minus?) of free space. What's wrong? Is UFS so 
>inefficient filesystem or it is a bug?

Maybe your data is not a good match for the UFS2 defaults.

In the case of UFS2, the size shown as x-Blocks reflects the size of
the underlying media, less a free space allowance: 8% [not 10%] by
default - see the -m option of tunefs for details of this and why it
exists.  Out of this, UFS2 allocates file and direcory data blocks,
file metadata and filesystem metadata.  By default, data blocks are
16KB with 2KB fragments.  Each file or directory needs 256 bytes of
metadata (its inode).  I can't quickly find the size of the filesystem
metadata but estimate it is <<1% of the filesystem size.

You haven't said what sort of files you are storing but you might find
the following suggestions useful:
- As others have suggested, reducing minfree will help remove the negative
  free space.  Be careful doing this unless your filesystem is write-once.
- If you have a few very large files, rebuild the filesystem with fewer
  inodes (large '-i' parameter to newfs) and maybe a bigger blocksize.
- If you have lots of small files, you might be better off with an 8K/1K
  filesystem and maybe even UFS1 (which has a smaller inode size).

-- 
Peter Jeremy
Please excuse any delays as the result of my ISP's inability to implement
an MTA that is either RFC2821-compliant or matches their claimed behaviour.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20081115/3ffaeeed/attachment.pgp


More information about the freebsd-fs mailing list