From owner-freebsd-questions@FreeBSD.ORG Wed Aug 8 18:06:18 2007 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 1ECBC16A418 for ; Wed, 8 Aug 2007 18:06:18 +0000 (UTC) (envelope-from illoai@gmail.com) Received: from fk-out-0910.google.com (fk-out-0910.google.com [209.85.128.191]) by mx1.freebsd.org (Postfix) with ESMTP id 7365513C45A for ; Wed, 8 Aug 2007 18:06:17 +0000 (UTC) (envelope-from illoai@gmail.com) Received: by fk-out-0910.google.com with SMTP id b27so221176fka for ; Wed, 08 Aug 2007 11:06:15 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=WiDPsOlRqMFtdCUXIRQb057Qu6jj520egS9AqNEp+3tLCVn0LDdhMH3f34+0mQrJe67k/greQmoAhu8ke6DaMpcIDoL97zYMVyKsEEr4/ACSRZ83kGjWl9lP5bNjt407FfqSIMfQrCtqcru26tjRV0jGsSPboNcxHt18XifRLkk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Raz4fs0KUiV4DOtIxayc9DrEqGhP248f2F2Ryn/tkEd+yhlZ5910CEJeG/zZmgV2x/YzHopAUFSdAeo9z2SIHrZD/PAYZZTcv9cmno4wiFXSrVVO0AHoZxpc2WPnMaOe9ZcaBI9AwM1ebC+GPYTemd52uR5Bv80SIcVBL194rY0= Received: by 10.82.105.13 with SMTP id d13mr2280048buc.1186596360471; Wed, 08 Aug 2007 11:06:00 -0700 (PDT) Received: by 10.82.185.5 with HTTP; Wed, 8 Aug 2007 11:06:00 -0700 (PDT) Message-ID: Date: Wed, 8 Aug 2007 13:06:00 -0500 From: "illoai@gmail.com" To: "Janos Dohanics" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <30A24FEB-0E6F-4C50-BC1F-2808C216AA11@mac.com> Cc: freebsd-questions@freebsd.org Subject: Re: What is my disk usage? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2007 18:06:18 -0000 On 08/08/2007, Janos Dohanics wrote: > > On 8/8/2007, "Chuck Swiger" wrote: > > >On Aug 8, 2007, at 9:21 AM, Janos Dohanics wrote: > >> du is acting strange on my system: > >> > >> # du /usr/X11R6 > >> 4 /usr/X11R6/share/locale > >> 8 /usr/X11R6/share > >> 12 /usr/X11R6 > >> > >> # du -h /usr/X11R6 > >> 2.0K /usr/X11R6/share/locale > >> 4.0K /usr/X11R6/share > >> 6.0K /usr/X11R6 > >> > >> # du -k /usr/X11R6 > >> 2 /usr/X11R6/share/locale > >> 4 /usr/X11R6/share > >> 6 /usr/X11R6 > >> > >> This seems to be happening only after I have sudo'd myself. du reports > >> consistent numbers if I run it as myself or if I su first. > >> > >> This is a FreeBSD 6.2-STABLE system with snapshots enabled. > >> > >> Any ideas? > > > >Presumably the accounts which have consistent results have something > >like: > > > > setenv BLOCKSIZE K > > > >...or: > > > > export BLOCKSIZE=K > > > >...configured in their shell. > > > >-- > >-Chuck > > Well, this is all I have in .bash_profile: > > $ cat .bash_profile > PS1="[\u@\h \w]\\$ " > export EDITOR=vim > > The issue is that du reports twice as much disk usage as du -h or du -k, > and I have no clue why... Chuck is right: the "twice as much" is du reporting in the default 512 byte blocks. You probably have the BLOCKSIZE=K set in either ~/.profile or /etc/profile. If you recently upgraded sudo, you should take note that env_reset is now the default. You can return to the old behaviour by adding a line like: Defaults !env_reset to your sudoers file. It might be more secure to not do this with a Defaults line, though. man 5 sudoers for more information. -- --