Re: What is my disk usage?

2007-08-08 Thread Eric Crist

On Aug 8, 2007, at 11:21 AMAug 8, 2007, 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.



I don't get it, what's wrong?  Things look normal to me...

Eric Crist
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: What is my disk usage?

2007-08-08 Thread Chuck Swiger

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

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: What is my disk usage?

2007-08-08 Thread Janos Dohanics

On 8/8/2007, Chuck Swiger [EMAIL PROTECTED] 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=[EMAIL PROTECTED] \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...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: What is my disk usage?

2007-08-08 Thread [EMAIL PROTECTED]
On 08/08/2007, Janos Dohanics [EMAIL PROTECTED] wrote:

 On 8/8/2007, Chuck Swiger [EMAIL PROTECTED] 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=[EMAIL PROTECTED] \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.

-- 
--
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: What is my disk usage?

2007-08-08 Thread Janos Dohanics

On 8/8/2007, Don Hinton [EMAIL PROTECTED] wrote:

Janos Dohanics writes:
 
  On 8/8/2007, Chuck Swiger [EMAIL PROTECTED] 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=[EMAIL PROTECTED] \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...

$ echo $BLOCKSIZE
K
$ mkdir test
$ du test
2   test
$ du -k test
2   test
$ du -h test
2,0Ktest
$ unset BLOCKSIZE
$ du test
4   test

 BLOCKSIZE  If the environment variable BLOCKSIZE is set, and the -k
option is not specified, the block counts will be displayed in
units of that size block.  If BLOCKSIZE is not set, and the -k
option is not specified, the block counts will be displayed in
512-byte blocks.

hth...
don

Thank you... sorry for the noise.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]