Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Nov 2008 12:42:03 +1100
From:      Peter Jeremy <peterjeremy@optushome.com.au>
To:        Andrei Kolu <antik@bsd.ee>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: Filesystem size and free space
Message-ID:  <20081115014203.GE51761@server.vk2pj.dyndns.org>
In-Reply-To: <491D5296.3000600@bsd.ee>
References:  <491D5296.3000600@bsd.ee>

next in thread | previous in thread | raw e-mail | index | archive | help

--b5gNqxB1S1yM7hjW
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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

--=20
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.

--b5gNqxB1S1yM7hjW
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (FreeBSD)

iEYEARECAAYFAkkeKOsACgkQ/opHv/APuIe0wACgje5nEyV1Pa6vBUCkK4hY9H8G
Y34Aniir+owb+j5nro7ghHLQM6HTn1HY
=O8Ys
-----END PGP SIGNATURE-----

--b5gNqxB1S1yM7hjW--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20081115014203.GE51761>