How to check where space is LOST

Adam Vande More amvandemore at gmail.com
Mon Sep 12 19:53:30 UTC 2011


2011/9/12 Adam Vande More <amvandemore at gmail.com>

> 2011/9/12 Коньков Евгений <kes-kes at yandex.ru>
>
>> # fstat -f /var
>>
>> USER     CMD          PID   FD MOUNT      INUM MODE         SZ|DV R/W
>>
>> root     snmpd      20545    3 /var      47141 -rw-------  37217152  w
>>
>> root     snmpd      20545    8 /var      47159 -rw-r-----     728  r
>>
>> root     cron       20455   wd /var      47105 drwxr-x---     512  r
>>
>> ...
>>
>>
>> # find /var -inum 47141 -ls
>>
> You find the inode number with fstat(1) then use find(1) to translate it to
> a filename.  It works fine here, if it doesn't work for you perhaps you have
> a user error or there is some other sort of bug.
>

One other thing, it's possible the inode is gone by the time you have run
find(1) so be sure you are working with current fstat(1) output.  May be
easier to script the transform if this is something you are doing regularly.


-- 
Adam Vande More


More information about the freebsd-questions mailing list