A simple (?) question about fs...

Oliver Fromme olli at lurza.secnetix.de
Wed Jan 13 12:57:20 UTC 2010


Giuseppe Maniscalco wrote:
 > On a FreeBSD 6.1 server, I can't find a way to free up space on the /
 > file system...

Please install lsof (/usr/ports/sysutils/lsof) and execute
this command:

lsof +aL1 /

It will list all processes that keep files (inodes) open
in the root file system with a link count of zero.
Killing or restarting those processes will free the space
occupied by the files.

Explanation:  When you delete a file, but the file is still
opened by a process, then the space of the file is still
kept allocated in the file system.  df(1) will see it,
because it lists the block allocations, but du(1) doesn't
see it because the directory entry of the file was already
removed.  That's why you see such a difference in the
output between df(1) and du(1).  As soon as the files are
closed (which happens when the processes are killed or
restarted), the space will be freed in the file system.

Best regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606,  Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758,  Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr:  http://www.secnetix.de/bsd

Perl is worse than Python because people wanted it worse.
        -- Larry Wall


More information about the freebsd-fs mailing list