Filesystem and bigger files

Eygene Ryabinkin rea-fbsd at codelabs.ru
Mon May 4 13:10:47 UTC 2009


Antonio, good day.

Mon, May 04, 2009 at 12:50:59PM +0200, Antonio Tommasi wrote:
> i've freebsd 7.0 in production and i've this hard-drive
> 
> Filesystem       Size    Used   Avail    Capacity  Mounted on
> /dev/aacd0s1a  64G    15G     44G         26%    /
> 
> In a directory (spamassassin) i've one file (auto-whitelist) with 
> dimension 4.0 TB and one file (bayes_learn) with dimension 1.0TB
> 
> How is it possible? How this file are managed?

First, this isn't a proper question for the freebsd-net mailing list,
so I am redirecting it to freebsd-questions.

To answer your question: most likely, your filesystem is damaged and
should be fsck'ed.  Reboot in a single-user mode and run 'fsck -p
/dev/aacd0s1a' on your filesystem.  If it will correct the things --
it's good.  If not, run 'fsck /dev/aacd0s1a'.  It is always good to have
backups ;))  And the possible filesystem corruption is one of the
reasons why people prefer multiple partitions on the system, rather then
having one big and fat '/' partition.

Another possibility is that these files are sparse: they have "holes"
that aren't yet filled in.  Tb sizes are insane, but may be you directed
SA to do it.  Here is the illustration of sparse file creation and
its impact on the filesystem size:
-----
Filesystem  1K-blocks     Used   Avail Capacity  Mounted on
/dev/ad4s2f  24808094 14819988 8003460    65%    /0

$ dd if=/dev/zero of=test.bin bs=1K count=1 seek=10M
1+0 records in
1+0 records out
1024 bytes transferred in 0.000049 secs (20951060 bytes/sec)

$ ls -l test.bin
-rw-r--r--  1 usr  usr  10737419264  4 май 16:54 test.bin

$ df .
Filesystem  1K-blocks     Used   Avail Capacity  Mounted on
/dev/ad4s2f  24808094 14820046 8003402    65%    /0
-----
-- 
Eygene
 _                ___       _.--.   #
 \`.|\..----...-'`   `-._.-'_.-'`   #  Remember that it is hard
 /  ' `         ,       __.--'      #  to read the on-line manual
 )/' _/     \   `-_,   /            #  while single-stepping the kernel.
 `-'" `"\_  ,_.-;_.-\_ ',  fsc/as   #
     _.-'_./   {_.'   ; /           #    -- FreeBSD Developers handbook
    {_.-``-'         {_/            #


More information about the freebsd-questions mailing list