From owner-freebsd-questions@FreeBSD.ORG Mon Sep 12 19:48:54 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C67A5106566B for ; Mon, 12 Sep 2011 19:48:54 +0000 (UTC) (envelope-from kes-kes@yandex.ru) Received: from forward14.mail.yandex.net (forward14.mail.yandex.net [IPv6:2a02:6b8:0:801::4]) by mx1.freebsd.org (Postfix) with ESMTP id F16898FC16 for ; Mon, 12 Sep 2011 19:48:53 +0000 (UTC) Received: from smtp12.mail.yandex.net (smtp12.mail.yandex.net [95.108.131.191]) by forward14.mail.yandex.net (Yandex) with ESMTP id 5CBF2198347F; Mon, 12 Sep 2011 23:48:52 +0400 (MSD) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1315856932; bh=73SLvlPKI2ATZcKr93MWVoBkFliVR76jtegMYbOQafo=; h=Date:From:Reply-To:Message-ID:To:CC:Subject:In-Reply-To: References:MIME-Version:Content-Type:Content-Transfer-Encoding; b=uwQkA4afeT5q78Aa6Wa3cMHFXc3v6a0vLIAJjJk+E/jIg+qbEgDc3DAuoXrkkwtn9 Qbv5XLcBx3WFlB8ulAZ1RtlA7A5D0261MnmahoEdIWWo2J34ELpokbePoRomv7ZRHy OSvfHIhn8PL1SBN6GhecJoUMxfqIM0/Z66NPj/C0= Received: from smtp12.mail.yandex.net (localhost [127.0.0.1]) by smtp12.mail.yandex.net (Yandex) with ESMTP id 38FE016A033E; Mon, 12 Sep 2011 23:48:52 +0400 (MSD) Received: from 46-185-28-188-mltp.broadband.kyivstar.net (46-185-28-188-mltp.broadband.kyivstar.net [46.185.28.188]) by smtp12.mail.yandex.net (nwsmtp/Yandex) with ESMTP id mpLaF4Q6-mpL0JWqI; Mon, 12 Sep 2011 23:48:52 +0400 X-Yandex-Spam: 1 Date: Mon, 12 Sep 2011 22:48:50 +0300 From: =?windows-1251?B?yu7t/Oru4iDF4uPl7ejp?= X-Mailer: The Bat! (v4.0.24) Professional Organization: =?windows-1251?B?188gyu7t/Oru4iwgRnJlZUxpbmU=?= X-Priority: 2 (High) Message-ID: <1779163157.20110912224850@yandex.ru> To: Robert Bonomi In-Reply-To: <201109120728.p8C7SMiK040538@mail.r-bonomi.com> References: <1227884793.20110912085127@yandex.ru> <201109120728.p8C7SMiK040538@mail.r-bonomi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: 8bit Cc: freebsd-questions@freebsd.org, net-snmp-coders@lists.sourceforge.net Subject: BUG: snmpd or How to check where space is LOST X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: =?windows-1251?B?yu7t/Oru4iDF4uPl7ejp?= List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2011 19:48:54 -0000 Здравствуйте, Robert. Вы писали 12 сентября 2011 г., 10:28:22: >> From kes-kes@yandex.ru Mon Sep 12 00:51:16 2011 >> Date: Mon, 12 Sep 2011 08:51:27 +0300 >> From: =?windows-1251?B?yu7t/Oru4iDF4uPl7ejp?= >> To: Robert Bonomi >> Subject: Re[2]: How to check where space is LOST >> >> Caoaanoaoeoa, Robert. >> >> u ienaee 12 naioyaoy 2011 a., 4:33:25: >> >> >> From owner-freebsd-questions@freebsd.org Sun Sep 11 17:23:57 2011 >> >> Date: Mon, 12 Sep 2011 01:23:32 +0300 >> >> From: =?windows-1251?B?yu7t/Oru4iDF4uPl7ejp?= >> >> To: freebsd-questions@freebsd.org >> >> Subject: How to check where space is LOST >> >> >> >> Hi. >> >> >> >> I notice that some times /var is overfull >> >> >> >> # df -h >> >> Filesystem Size Used Avail Capacity Mounted on >> >> /dev/ad1s1d 989M 349M 561M 38% /var >> >> >> >> # cd /var/ >> >> >> >> # du -h -d 1 >> >> 98M . >> >> >> >> If I just #reboot system. I get that on /var is only 98M used. >> >> >> >> # df -h >> >> Filesystem Size Used Avail Capacity Mounted on >> >> /dev/ad1s1d 989M 98M 891M 12% /var >> >> >> >> How to obtain what take space on /var >> >> RB> Probably, you *don't*. >> >> RB> "df" _is_ telling the truth. >> RB> 'du' is, arguably, 'telling lies'. >> >> RB> The difference concerns files that have been deleted (rm) _after_ >> RB> they have been opened, and not yet closed. The file handle/descriptor >> RB> that has the file open silll has access to all the data in the file. >> RB> but *NOTHING*ELSE* -- inlcuding 'du' -- can access that file, so the >> RB> space occupied by that deletedd file is not counted. >> >> RB> Note: this *IS* a FAQ. >> >> thank you very much. >> >> fstat -f /var tell me that process snmpd with file descriptor 3 take >> spece: RB> It's not unreasonable that snmpd (the 'simple network management protocol' RB> daemon) needs a *lot* of private storage. RB> In short, don't worry about it. Ok, How you can explain this: # df -h /dev/ad1s1d 989M 138M 772M 15% /var # 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 snmpd has 35MB of space # find /var -inum 47141 -ls output is empty (( # /usr/local/etc/rc.d/snmpd restart Stopping snmpd. Starting snmpd. # df -h /dev/ad1s1d 989M 102M 808M 11% /var # fstat -f /var/ USER CMD PID FD MOUNT INUM MODE SZ|DV R/W root snmpd 40766 3 /var 47171 -rw------- 23311 w root snmpd 40766 8 /var 47159 -rw-r----- 728 r after 3-4 weeks and snmpd overfull /var filesystem (((( Test on other system: # df -h /dev/ad0s1d 6.7G 2.1G 4.1G 34% /var # fstat -f /var | grep snmp root snmpd 7140 3 - 588866 -rw-r--r-- 947424261 w root snmpd 7140 8 /var 588842 -rw-r----- 728 r # /usr/local/etc/rc.d/snmpd restart Stopping snmpd. Waiting for PIDS: 7140. Starting snmpd. # fstat -f /var | grep snmp root snmpd 23376 3 /var 588894 -rw-r--r-- 132 w root snmpd 23376 8 /var 588872 -rw-r----- 728 r # df -h /dev/ad0s1d 6.7G 1.2G 5G 19% /var It seems that that is the BUG of snmpd # snmpd -v NET-SNMP version: 5.5 Web: http://www.net-snmp.org/ Email: net-snmp-coders@lists.sourceforge.net # uname -a FreeBSD flux 9.0-CURRENT FreeBSD 9.0-CURRENT #4: Fri Jun 10 01:30:12 UTC 2011 adm@:/usr/obj/usr/src/sys/PAE_KES i386 -- С уважением, Коньков mailto:kes-kes@yandex.ru