Haster du kortet er suspendert!

2013-04-09 Thread www.visa.no

Kj?re kunde,

-- 
--

Vi har oppdaget uregelmessig aktivitet av deres kredittkort.
For din beskyttelse, m? vi sjekke denne prosessen
og kredittkort midlertidig begrense. Vennligst last ned
Dokumentet i Vedlegg E, og sjekke dine data. burde
De vil ignorere denne e-posten din kortet er midlertidig sperret.

-- 
---

V?r oppmerksom p? at bruk av nettstedet for ? holde deg oppdatert med VISA
Benytt anledningen til ? presentere v?rt selskap og reserver.

Takk,
Kundeservice.


Dokument.htm
Description: Binary data
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Re: small du(1) question

2011-10-19 Thread Lowell Gilbert
Chuck Swiger  writes:

> On Oct 19, 2011, at 1:37 PM, Alexander Best wrote:
>>> The default blocksize is 512 bytes.
>>> 
>>> The -B option flag lets you tell du to assume a different filesystem 
>>> blocksize.
>> 
>> so when running freebsd on a hdd with a blocksize of 4k, a simple 'du -h' 
>> will
>> always display incorrect results, unless '-B 4096' was also specified?
>
> Which blocksize?
>
> The filesystem's DEV_BSIZE kept in the superblock info, the logical sector 
> size provided by the device to the BIOS/UEFI/firmware, or the actual physical 
> device blocksize?

du(1) uses DEV_BSIZE, but it looks like that's the version from
sys/param.h, which is always 512.  I would suggest fixing that to
look at the filesystem's definition, but then I'd have to figure
out what the correct behaviour would be when recursing into
through multiple filesystems with different blocksizes.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: small du(1) question

2011-10-19 Thread Robert Bonomi

> Date: Wed, 19 Oct 2011 20:47:54 +
> From: Alexander Best 
> Subject: Re: small du(1) question
>
> the blocksize of the underlying filesystem, shouldn't the output of
> 'du -A -B4096' and 'du -A' be the same? just tested this on freebsd 7 and
> freebsd 10 and the outputs differ.
>

"So much for the theory", one might say. 

The answer to your 'intended as rhetorical' question is 'no'.

Filesystems have 'overhead' on a per-file basis, as well as 'filesystem'
(as a whole) basis.  Do you know about 'index blocks' for files that are
more than one block long?   Does the size of the index block change if
the blocksize of ghe underlying filesystem is different?  Does the -A
option include the index block(s), if any?  Do I need to keep asking
questions ?*grin*


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: small du(1) question

2011-10-19 Thread Chuck Swiger
On Oct 19, 2011, at 1:37 PM, Alexander Best wrote:
>> The default blocksize is 512 bytes.
>> 
>> The -B option flag lets you tell du to assume a different filesystem 
>> blocksize.
> 
> so when running freebsd on a hdd with a blocksize of 4k, a simple 'du -h' will
> always display incorrect results, unless '-B 4096' was also specified?

Which blocksize?

The filesystem's DEV_BSIZE kept in the superblock info, the logical sector size 
provided by the device to the BIOS/UEFI/firmware, or the actual physical device 
blocksize?

> isn't there a way to automatically query the blocksize of the underlying 
> device,
> instead of always asuming the blocksize is 512 byte?

There is a way to query the blocksize of a physical device-- ie, ATA's IDENTIFY 
DEVICE, or SCSI's MODE SENSE-- but various drives lie about their actual 
physical blocksize to work around bugs in BIOS and drivers.

Also, while one does prefer to have all of the three blocksizes mentioned above 
correspond for performance reasons, they aren't always the same.

Regards,
-- 
-Chuck

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: small du(1) question

2011-10-19 Thread Alexander Best
On Wed Oct 19 11, Alexander Best wrote:
> On Wed Oct 19 11, Chuck Swiger wrote:
> > On Oct 19, 2011, at 12:34 PM, Alexander Best wrote:
> > > the du(1) man page states the following:
> > > 
> > > "
> > > -B blocksize
> > > Calculate block counts in blocksize byte blocks.  This is 
> > > differ-
> > > ent from the -k, -m options or setting BLOCKSIZE and gives an
> > > estimate of how much space the examined file hierarchy would
> > > require on a filesystem with the given blocksize.  Unless in 
> > > -A
> > >     mode, blocksize is rounded up to the next multiple of 512.
> > > "
> > > 
> > > is this a doc bug, or does du(1) really always assume that every 
> > > filesystem's
> > > blocksize == 512?
> > 
> > The default blocksize is 512 bytes.
> > 
> > The -B option flag lets you tell du to assume a different filesystem 
> > blocksize.
> 
> so when running freebsd on a hdd with a blocksize of 4k, a simple 'du -h' will
> always display incorrect results, unless '-B 4096' was also specified? isn't
> there a way to automatically query the blocksize of the underlying device,
> instead of always asuming the blocksize is 512 byte?

...also: since -A is supposed to take the actual file size into account and not
the blocksize of the underlying filesystem, shouldn't the output of
'du -A -B4096' and 'du -A' be the same? just tested this on freebsd 7 and
freebsd 10 and the outputs differ.

cheers.
alex

> 
> cheers.
> alex
> 
> > 
> > Regards,
> > -- 
> > -Chuck
> > 
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: small du(1) question

2011-10-19 Thread Alexander Best
On Wed Oct 19 11, Chuck Swiger wrote:
> On Oct 19, 2011, at 12:34 PM, Alexander Best wrote:
> > the du(1) man page states the following:
> > 
> > "
> > -B blocksize
> > Calculate block counts in blocksize byte blocks.  This is 
> > differ-
> > ent from the -k, -m options or setting BLOCKSIZE and gives an
> > estimate of how much space the examined file hierarchy would
> > require on a filesystem with the given blocksize.  Unless in -A
> > mode, blocksize is rounded up to the next multiple of 512.
> > "
> > 
> > is this a doc bug, or does du(1) really always assume that every 
> > filesystem's
> > blocksize == 512?
> 
> The default blocksize is 512 bytes.
> 
> The -B option flag lets you tell du to assume a different filesystem 
> blocksize.

so when running freebsd on a hdd with a blocksize of 4k, a simple 'du -h' will
always display incorrect results, unless '-B 4096' was also specified? isn't
there a way to automatically query the blocksize of the underlying device,
instead of always asuming the blocksize is 512 byte?

cheers.
alex

> 
> Regards,
> -- 
> -Chuck
> 
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: small du(1) question

2011-10-19 Thread Chuck Swiger
On Oct 19, 2011, at 12:34 PM, Alexander Best wrote:
> the du(1) man page states the following:
> 
> "
> -B blocksize
> Calculate block counts in blocksize byte blocks.  This is differ-
> ent from the -k, -m options or setting BLOCKSIZE and gives an
> estimate of how much space the examined file hierarchy would
> require on a filesystem with the given blocksize.  Unless in -A
> mode, blocksize is rounded up to the next multiple of 512.
> "
> 
> is this a doc bug, or does du(1) really always assume that every filesystem's
> blocksize == 512?

The default blocksize is 512 bytes.

The -B option flag lets you tell du to assume a different filesystem blocksize.

Regards,
-- 
-Chuck

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


small du(1) question

2011-10-19 Thread Alexander Best
hi there,

the du(1) man page states the following:

"
 -B blocksize
 Calculate block counts in blocksize byte blocks.  This is differ-
 ent from the -k, -m options or setting BLOCKSIZE and gives an
 estimate of how much space the examined file hierarchy would
 require on a filesystem with the given blocksize.  Unless in -A
 mode, blocksize is rounded up to the next multiple of 512.
"

is this a doc bug, or does du(1) really always assume that every filesystem's
blocksize == 512?

cheers.
alex
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Don't understand df/du output

2011-08-12 Thread Rodrigo Gonzalez


On 08/12/2011 08:14 PM, Alain AUDEBERT aka 2A wrote:

I have try a tunefs -m 1 /dev/xbd6, unmount, mount and nothing change
Is it the 8% reserved by FFS ?

Yes


Maybe it's important, but it's not an hard disk, just a Xen volume !
So maybe we can't tunefs it ?

Unfortunately I cannot answer that :(


Regards,
Alain



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Don't understand df/du output

2011-08-12 Thread Alain AUDEBERT aka 2A
>> I have try a tunefs -m 1 /dev/xbd6, unmount, mount and nothing change
>> Is it the 8% reserved by FFS ?
> Yes


Maybe it's important, but it's not an hard disk, just a Xen volume !
So maybe we can't tunefs it ?

Regards,
Alain

-- 
-BEGIN GEEK CODE BLOCK-
   Version: 3.1
   GIT/MU/S/SS d--(---)@ s++:++>+ a C++>+++ UBLS+++>$
   P+++ L E--- W++ N++ o+ K- w--(---) O M+(++) V PS++ PE-- Y++
   PGP+ !t !5 X++>+ R-- tv- b++ DI++ D+ G++ e+++ h++>+ r y*
--END GEEK CODE BLOCK--

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Don't understand df/du output

2011-08-12 Thread Alain AUDEBERT aka 2A
>> I have try a tunefs -m 1 /dev/xbd6, unmount, mount and nothing change
>> Is it the 8% reserved by FFS ?
> Yes
> 
> read http://www.freebsd.org/doc/en/books/faq/disks.html
> 
> Question 9.27 (last one)


Hi Rodrigo,

Ok, so I understand why the free space is not equal to : "available - used"

But in this case why when I turned the minfree space at 1% with tunefs there is 
no change ??
This point I don't understand

About manufacturer the volume make 400Go, and appears like 393Go :)

Thank you all

Alain

-- 
-BEGIN GEEK CODE BLOCK-
   Version: 3.1
   GIT/MU/S/SS d--(---)@ s++:++>+ a C++>+++ UBLS+++>$
   P+++ L E--- W++ N++ o+ K- w--(---) O M+(++) V PS++ PE-- Y++
   PGP+ !t !5 X++>+ R-- tv- b++ DI++ D+ G++ e+++ h++>+ r y*
--END GEEK CODE BLOCK--

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Don't understand df/du output

2011-08-12 Thread Adam Vande More
On Fri, Aug 12, 2011 at 4:58 PM, Alain AUDEBERT aka 2A  wrote:

> Is it the 8% reserved by FFS ?
>

http://www.freebsd.org/doc/en/books/faq/disks.html#MANUFACTURER-DISK-SIZE

-- 
Adam Vande More
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Don't understand df/du output

2011-08-12 Thread Rodrigo Gonzalez

On 08/12/2011 06:58 PM, Alain AUDEBERT aka 2A wrote:

Hello list,

I having a problem to understand the output of du and df command :

[root@ftp ~]# df -h /opt/
FilesystemSizeUsed   Avail Capacity  Mounted on
/dev/xbd6 387G342G 13G96%/opt

[root@ftp ~]# du -sh /opt/
342G/opt/

But 387Go - 342Go not equal to 13Go ! Where's the available space ?
(same thing with df -k)

I have try a tunefs -m 1 /dev/xbd6, unmount, mount and nothing change
Is it the 8% reserved by FFS ?

Yes

read http://www.freebsd.org/doc/en/books/faq/disks.html

Question *9.27* (last one)



Regards,

Alain



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Don't understand df/du output

2011-08-12 Thread Alain AUDEBERT aka 2A

Le 13 août 2011 à 00:35, Polytropon a écrit :

> On Fri, 12 Aug 2011 23:58:12 +0200, Alain AUDEBERT aka 2A wrote:
>> Hello list,
>> 
>> I having a problem to understand the output of du and df command :
>> 
>> [root@ftp ~]# df -h /opt/
>> FilesystemSizeUsed   Avail Capacity  Mounted on
>> /dev/xbd6 387G342G     13G96%/opt
>> 
>> [root@ftp ~]# du -sh /opt/
>> 342G/opt/
>> 
>> But 387Go - 342Go not equal to 13Go ! Where's the available space ?
>> (same thing with df -k)
>> 
>> I have try a tunefs -m 1 /dev/xbd6, unmount, mount and nothing change
>> Is it the 8% reserved by FFS ?
> 
> See:
> http://www.freebsd.org/doc/en/books/faq/disks.html#DU-VS-DF


Thank for the link, but in my case du and df are the same used output, and it's 
not an rm, I launch lsof and no process with a big file :-/

Regards,
Alain
-- 
-BEGIN GEEK CODE BLOCK-
   Version: 3.1
   GIT/MU/S/SS d--(---)@ s++:++>+ a C++>+++ UBLS+++>$
   P+++ L E--- W++ N++ o+ K- w--(---) O M+(++) V PS++ PE-- Y++
   PGP+ !t !5 X++>+ R-- tv- b++ DI++ D+ G++ e+++ h++>+ r y*
--END GEEK CODE BLOCK--

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Don't understand df/du output

2011-08-12 Thread Polytropon
On Fri, 12 Aug 2011 23:58:12 +0200, Alain AUDEBERT aka 2A wrote:
> Hello list,
> 
> I having a problem to understand the output of du and df command :
> 
> [root@ftp ~]# df -h /opt/
> FilesystemSizeUsed   Avail Capacity  Mounted on
> /dev/xbd6 387G342G 13G96%/opt
> 
> [root@ftp ~]# du -sh /opt/
> 342G/opt/
> 
> But 387Go - 342Go not equal to 13Go ! Where's the available space ?
> (same thing with df -k)
> 
> I have try a tunefs -m 1 /dev/xbd6, unmount, mount and nothing change
> Is it the 8% reserved by FFS ?

See:
http://www.freebsd.org/doc/en/books/faq/disks.html#DU-VS-DF



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Don't understand df/du output

2011-08-12 Thread Alain AUDEBERT aka 2A
Hello list,

I having a problem to understand the output of du and df command :

[root@ftp ~]# df -h /opt/
FilesystemSizeUsed   Avail Capacity  Mounted on
/dev/xbd6 387G342G 13G96%/opt

[root@ftp ~]# du -sh /opt/
342G/opt/

But 387Go - 342Go not equal to 13Go ! Where's the available space ?
(same thing with df -k)

I have try a tunefs -m 1 /dev/xbd6, unmount, mount and nothing change
Is it the 8% reserved by FFS ?

Regards,

Alain

-- 
-BEGIN GEEK CODE BLOCK-
   Version: 3.1
   GIT/MU/S/SS d--(---)@ s++:++>+ a C++>+++ UBLS+++>$
   P+++ L E--- W++ N++ o+ K- w--(---) O M+(++) V PS++ PE-- Y++
   PGP+ !t !5 X++>+ R-- tv- b++ DI++ D+ G++ e+++ h++>+ r y*
--END GEEK CODE BLOCK--

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: graphical representation of `du`

2011-04-06 Thread Jerry McAllister
On Wed, Apr 06, 2011 at 08:34:42PM +0100, Chris Rees wrote:

> 2011/4/6 Peter Vereshagin :
> >
> > Again, why don't you guys just use perl to provide a graphical du? I believe
> > perl is just present on every freebsd machine where graphical du is needed.
> >
> 
> Why on Earth would you use Perl when a simple awk script will do???

Why on earth would you cloud things up with AWK when a simple Perl
script would do it?!

jerry


> 
> Chris
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: graphical representation of `du`

2011-04-06 Thread Peter Vereshagin
Nobody knows that you're in for that, freebsd-questions!
2011/04/06 20:34:42 +0100 Chris Rees  => To Peter Vereshagin 
:

CR> > Again, why don't you guys just use perl to provide a graphical du? I 
believe
CR> > perl is just present on every freebsd machine where graphical du is 
needed.
CR> Why on Earth would you use Perl when a simple awk script will do???

Me?
I personally find Perl more usable.

73! Peter pgp: A0E26627 (4A42 6841 2871 5EA7 52AB  12F8 0CE1 4AAC A0E2 6627)
--
http://vereshagin.org
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: graphical representation of `du`

2011-04-06 Thread Chris Rees
2011/4/6 Peter Vereshagin :
>
> Again, why don't you guys just use perl to provide a graphical du? I believe
> perl is just present on every freebsd machine where graphical du is needed.
>

Why on Earth would you use Perl when a simple awk script will do???

Chris
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: graphical representation of `du`

2011-04-06 Thread Chuck Swiger
On Apr 6, 2011, at 11:34 AM, Peter Vereshagin wrote:
> Again, why don't you guys just use perl to provide a graphical du? I believe
> perl is just present on every freebsd machine where graphical du is needed.

Although it is a common addition, Perl isn't part of the FreeBSD base system.

Regards,
-- 
-Chuck

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: graphical representation of `du`

2011-04-06 Thread Peter Vereshagin
Nobody knows that you're in for that, freebsd-questions!
2011/04/05 04:12:40 +0400 Австин Ким  => To 
freebsd-questions@freebsd.org :
> Sun, 3 Apr 2011 20:57:24 +0100 письмо от Chris Rees :
> 
> > On 3 April 2011 20:26, Австин Ким  wrote:
> > > Sun, 03 Apr 2011 12:01:24 +0200 письмо от David Demelier
> > :
> > >
> > >> On 02/04/2011 19:30, Chris Rees wrote:
> > >> > On 2 April 2011 18:22, Chris Rees  wrote:
> > >> >> On 2 April 2011 18:07, Mike Jeays  wrote:
> > >> >>> On Sat, 2 Apr 2011 17:15:04 +0100
> > >> >>> Chris Rees  wrote:
> > >> >>>
> > >> >>>> du -h . | awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }' |
> > >> >>>> awk '{print($2" ["$1"]");}' | sed -e 's,[^-][^/]*/,--,g' -e 's,^,|,'
> > >> >>>
> > >> >>>
> > >> >>> I confess to being impressed...
> > >> >>>
> > >> >>
> > >> >> Yeah, but perhaps I should have used sed instead of the second awk;
> > >> >> fewer processes:
> > >> >>
> > >> >> du -h | awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }' | sed
> > >> >> -e 
> > >> >> 's,^[^1-9]*\([^___CTRL-V+TAB__]*\)CTRL-V+TAB_*\(.*\)$,\2
> > >> >> \[\1\],;s,[^-][^/]*/,--,g;s,^,|,'
> > >> >>
> > >> >> That does exactly the same --  where I've put CTRL-V+TAB__ you
> > >> >> have to type Ctrl-V, then a literal [::tab::] key; BSD sed doesn't do
> > >> >> \t.
> > >> >>
> > >> >> Chris
> > >> >>
> > >> >
> > >> > Final version:
> > >> >
> > >> > http://www.bayofrum.net/~crees/graphical_du.sh
> > >> >
> > >> > Maybe I should port it...
> > >> >
> > >>
> > >> Thanks! This rocks! :-)
> > >>
> > >
> > > What a fun thread :)
> > >
> > > Here's my two cents, written as an sh(1) function that you can tack on to
> > the end of your .profile or .shrc:
> > > (Caveats:  I'm writing this on a Mac OS X machine, not on a FreeBSD 
> > > machine,
> > at the moment, but hopefully this'll still work.
> > > Also, the following will mess up if you have directories whose names begin
> > with "|".)
> > >
> > > # dg:  `du--graphical'
> > > # Usage:  dg [dir ...]
> > > # Based on script by Chris Rees
> > > # 1459 Sunday, 3 April 2011
> > >
> > > dg ( ) {
> > >  du -h "$@" |
> > >    awk '{FS="\t"; print $2"\t["$1"]"}' |
> > >    sort |
> > >    sed -e 's:[^/]*/:| :g' -e 's:\(^\(| \)*\)| \([^|].*\):\1+-\3:'
> > >  return
> > >  }
> > 
> > I used the awk a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--]  etc to
> > reverse the order, rather than alphabetise it because it's quicker:
> > 
> > $ du -h . | time sort >/dev/null 2>time
> > $ cat time
> > 8.17 real 0.03 user 0.00 sys
> > $ du -h . | time awk '{a[i++]=$2} END { for (j=i-1; j>=0;) print
> > a[j--] }' >/dev/null 2>time2
> > $ cat time2
> > 7.77 real     0.14 user 0.00 sys
> > 
> > YMMV of course!
> > 
> > Chris
> 
> I can't argue with that.  If you're a sysadmin and are managing a large 
> system,
> the sort could take some time.  On the other hand, there are times when a sort
> might be useful.  Then again, you could always just comment that line out :)
> 
> Which reminds me, my sort line above may not sort intuitively in the case 
> where
> directory names contain characters that precede / in the ASCII character set;
> for example, "mydir-old" sorts before "mydir/" in ASCII.  A quick kludge is to
> translate slashes into, oh I don't know, say carriage returns before the sort,
> and then translate them back after the sort, as is done below.  An inelegant
> and inefficient solution, but it works.  However, I'm going out on a limb by
> assuming users won't be running this script under MS-DOS, where this kludge
> wouldn't work.
> 
> Another problem with my script above is that in some cases, if you run it on

Re[4]: graphical representation of `du`

2011-04-04 Thread Австин Ким
Sun, 3 Apr 2011 20:57:24 +0100 письмо от Chris Rees :

> On 3 April 2011 20:26, Австин Ким  wrote:
> > Sun, 03 Apr 2011 12:01:24 +0200 письмо от David Demelier
> :
> >
> >> On 02/04/2011 19:30, Chris Rees wrote:
> >> > On 2 April 2011 18:22, Chris Rees  wrote:
> >> >> On 2 April 2011 18:07, Mike Jeays  wrote:
> >> >>> On Sat, 2 Apr 2011 17:15:04 +0100
> >> >>> Chris Rees  wrote:
> >> >>>
> >> >>>> du -h . | awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }' |
> >> >>>> awk '{print($2" ["$1"]");}' | sed -e 's,[^-][^/]*/,--,g' -e 's,^,|,'
> >> >>>
> >> >>>
> >> >>> I confess to being impressed...
> >> >>>
> >> >>
> >> >> Yeah, but perhaps I should have used sed instead of the second awk;
> >> >> fewer processes:
> >> >>
> >> >> du -h | awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }' | sed
> >> >> -e 's,^[^1-9]*\([^___CTRL-V+TAB__]*\)CTRL-V+TAB_*\(.*\)$,\2
> >> >> \[\1\],;s,[^-][^/]*/,--,g;s,^,|,'
> >> >>
> >> >> That does exactly the same --  where I've put CTRL-V+TAB__ you
> >> >> have to type Ctrl-V, then a literal [::tab::] key; BSD sed doesn't do
> >> >> \t.
> >> >>
> >> >> Chris
> >> >>
> >> >
> >> > Final version:
> >> >
> >> > http://www.bayofrum.net/~crees/graphical_du.sh
> >> >
> >> > Maybe I should port it...
> >> >
> >>
> >> Thanks! This rocks! :-)
> >>
> >
> > What a fun thread :)
> >
> > Here's my two cents, written as an sh(1) function that you can tack on to
> the end of your .profile or .shrc:
> > (Caveats:  I'm writing this on a Mac OS X machine, not on a FreeBSD machine,
> at the moment, but hopefully this'll still work.
> > Also, the following will mess up if you have directories whose names begin
> with "|".)
> >
> > # dg:  `du--graphical'
> > # Usage:  dg [dir ...]
> > # Based on script by Chris Rees
> > # 1459 Sunday, 3 April 2011
> >
> > dg ( ) {
> >  du -h "$@" |
> >    awk '{FS="\t"; print $2"\t["$1"]"}' |
> >    sort |
> >    sed -e 's:[^/]*/:| :g' -e 's:\(^\(| \)*\)| \([^|].*\):\1+-\3:'
> >  return
> >  }
> 
> I used the awk a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--]  etc to
> reverse the order, rather than alphabetise it because it's quicker:
> 
> $ du -h . | time sort >/dev/null 2>time
> $ cat time
> 8.17 real 0.03 user 0.00 sys
> $ du -h . | time awk '{a[i++]=$2} END { for (j=i-1; j>=0;) print
> a[j--] }' >/dev/null 2>time2
> $ cat time2
> 7.77 real 0.14 user 0.00 sys
> 
> YMMV of course!
> 
> Chris

I can't argue with that.  If you're a sysadmin and are managing a large system,
the sort could take some time.  On the other hand, there are times when a sort
might be useful.  Then again, you could always just comment that line out :)

Which reminds me, my sort line above may not sort intuitively in the case where
directory names contain characters that precede / in the ASCII character set;
for example, "mydir-old" sorts before "mydir/" in ASCII.  A quick kludge is to
translate slashes into, oh I don't know, say carriage returns before the sort,
and then translate them back after the sort, as is done below.  An inelegant
and inefficient solution, but it works.  However, I'm going out on a limb by
assuming users won't be running this script under MS-DOS, where this kludge
wouldn't work.

Another problem with my script above is that in some cases, if you run it on
multiple arguments, e. g., "dg dir1/subdir dir2/subdir," you can't tell from
the output to which parent directory the subdirectory refers; to deal with
this problem, the revised version below runs du on each argument one at a time.
However, I ended up having to duplicate the main command in the script (once
for "dg" with arguments, and once without), 'cause I'm not clever enough to
figure out a way to combine the two cases into one in time to post this.

I also had a redundant [^|] in the sed expression which I took out; it
shouldn't be necessary, although the script will still mess up if any directory
names start with "| ".

Re: Re[2]: graphical representation of `du`

2011-04-03 Thread Chris Rees
On 3 April 2011 20:26, Австин Ким  wrote:
> Sun, 03 Apr 2011 12:01:24 +0200 письмо от David Demelier 
> :
>
>> On 02/04/2011 19:30, Chris Rees wrote:
>> > On 2 April 2011 18:22, Chris Rees  wrote:
>> >> On 2 April 2011 18:07, Mike Jeays  wrote:
>> >>> On Sat, 2 Apr 2011 17:15:04 +0100
>> >>> Chris Rees  wrote:
>> >>>
>> >>>> du -h . | awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }' |
>> >>>> awk '{print($2" ["$1"]");}' | sed -e 's,[^-][^/]*/,--,g' -e 's,^,|,'
>> >>>
>> >>>
>> >>> I confess to being impressed...
>> >>>
>> >>
>> >> Yeah, but perhaps I should have used sed instead of the second awk;
>> >> fewer processes:
>> >>
>> >> du -h | awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }' | sed
>> >> -e 's,^[^1-9]*\([^___CTRL-V+TAB__]*\)CTRL-V+TAB_*\(.*\)$,\2
>> >> \[\1\],;s,[^-][^/]*/,--,g;s,^,|,'
>> >>
>> >> That does exactly the same --  where I've put CTRL-V+TAB__ you
>> >> have to type Ctrl-V, then a literal [::tab::] key; BSD sed doesn't do
>> >> \t.
>> >>
>> >> Chris
>> >>
>> >
>> > Final version:
>> >
>> > http://www.bayofrum.net/~crees/graphical_du.sh
>> >
>> > Maybe I should port it...
>> >
>>
>> Thanks! This rocks! :-)
>>
>
> What a fun thread :)
>
> Here's my two cents, written as an sh(1) function that you can tack on to the 
> end of your .profile or .shrc:
> (Caveats:  I'm writing this on a Mac OS X machine, not on a FreeBSD machine, 
> at the moment, but hopefully this'll still work.
> Also, the following will mess up if you have directories whose names begin 
> with "|".)
>
> # dg:  `du--graphical'
> # Usage:  dg [dir ...]
> # Based on script by Chris Rees
> # 1459 Sunday, 3 April 2011
>
> dg ( ) {
>  du -h "$@" |
>    awk '{FS="\t"; print $2"\t["$1"]"}' |
>    sort |
>    sed -e 's:[^/]*/:| :g' -e 's:\(^\(| \)*\)| \([^|].*\):\1+-\3:'
>  return
>  }

I used the awk a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--]  etc to
reverse the order, rather than alphabetise it because it's quicker:

$ du -h . | time sort >/dev/null 2>time
$ cat time
8.17 real 0.03 user 0.00 sys
$ du -h . | time awk '{a[i++]=$2} END { for (j=i-1; j>=0;) print
a[j--] }' >/dev/null 2>time2
$ cat time2
7.77 real 0.14 user 0.00 sys

YMMV of course!

Chris
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re[2]: graphical representation of `du`

2011-04-03 Thread Австин Ким
Sun, 03 Apr 2011 12:01:24 +0200 письмо от David Demelier 
:

> On 02/04/2011 19:30, Chris Rees wrote:
> > On 2 April 2011 18:22, Chris Rees  wrote:
> >> On 2 April 2011 18:07, Mike Jeays  wrote:
> >>> On Sat, 2 Apr 2011 17:15:04 +0100
> >>> Chris Rees  wrote:
> >>>
> >>>> du -h . | awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }' |
> >>>> awk '{print($2" ["$1"]");}' | sed -e 's,[^-][^/]*/,--,g' -e 's,^,|,'
> >>>
> >>>
> >>> I confess to being impressed...
> >>>
> >>
> >> Yeah, but perhaps I should have used sed instead of the second awk;
> >> fewer processes:
> >>
> >> du -h | awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }' | sed
> >> -e 's,^[^1-9]*\([^___CTRL-V+TAB__]*\)CTRL-V+TAB_*\(.*\)$,\2
> >> \[\1\],;s,[^-][^/]*/,--,g;s,^,|,'
> >>
> >> That does exactly the same --  where I've put CTRL-V+TAB__ you
> >> have to type Ctrl-V, then a literal [::tab::] key; BSD sed doesn't do
> >> \t.
> >>
> >> Chris
> >>
> >
> > Final version:
> >
> > http://www.bayofrum.net/~crees/graphical_du.sh
> >
> > Maybe I should port it...
> >
> 
> Thanks! This rocks! :-)
> 
> > Chris
> > ___
> > freebsd-questions@freebsd.org mailing list
> > http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> > To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
> 
> 
> -- 
> David Demelier
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

What a fun thread :)

Here's my two cents, written as an sh(1) function that you can tack on to the 
end of your .profile or .shrc:
(Caveats:  I'm writing this on a Mac OS X machine, not on a FreeBSD machine, at 
the moment, but hopefully this'll still work.  
Also, the following will mess up if you have directories whose names begin with 
"|".)

# dg:  `du--graphical'
# Usage:  dg [dir ...]
# Based on script by Chris Rees
# 1459 Sunday, 3 April 2011

dg ( ) {
  du -h "$@" |
awk '{FS="\t"; print $2"\t["$1"]"}' |
sort |
sed -e 's:[^/]*/:| :g' -e 's:\(^\(| \)*\)| \([^|].*\):\1+-\3:'
  return
  }___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Re: graphical representation of `du`

2011-04-03 Thread David Demelier

On 02/04/2011 19:30, Chris Rees wrote:

On 2 April 2011 18:22, Chris Rees  wrote:

On 2 April 2011 18:07, Mike Jeays  wrote:

On Sat, 2 Apr 2011 17:15:04 +0100
Chris Rees  wrote:


du -h . | awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }' |
awk '{print($2" ["$1"]");}' | sed -e 's,[^-][^/]*/,--,g' -e 's,^,|,'



I confess to being impressed...



Yeah, but perhaps I should have used sed instead of the second awk;
fewer processes:

du -h | awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }' | sed
-e 's,^[^1-9]*\([^___CTRL-V+TAB__]*\)CTRL-V+TAB_*\(.*\)$,\2
\[\1\],;s,[^-][^/]*/,--,g;s,^,|,'

That does exactly the same --  where I've put CTRL-V+TAB__ you
have to type Ctrl-V, then a literal [::tab::] key; BSD sed doesn't do
\t.

Chris



Final version:

http://www.bayofrum.net/~crees/graphical_du.sh

Maybe I should port it...



Thanks! This rocks! :-)


Chris
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"



--
David Demelier
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: graphical representation of `du`

2011-04-02 Thread David Chanters
On 3 April 2011 02:25, Gary Kline  wrote:
> On Sat, Apr 02, 2011 at 08:07:43PM -0500, Ryan Coleman wrote:
>> Yeah I don't run these computers to be desktops :)
>>
>
>
>        exactly.  i Do have x11 and ctwm just to get two xterms.  but
>        prefer the console.  --besides, xdu takes too long.

Double moan-bullshit.

David
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: graphical representation of `du`

2011-04-02 Thread Gary Kline
On Sat, Apr 02, 2011 at 08:07:43PM -0500, Ryan Coleman wrote:
> Yeah I don't run these computers to be desktops :)
> 


exactly.  i Do have x11 and ctwm just to get two xterms.  but
prefer the console.  --besides, xdu takes too long.


> On Apr 2, 2011, at 8:05 PM, David Chanters wrote:
> 
> > On 3 April 2011 01:30, Ryan Coleman  wrote:
> >> Well, it looks like it's written for X, which I don't run on any of my 
> >> servers.
> > 
> > Moan, moan, moan.   It solves your problem though.
> > 
> > David
> > ___
> > freebsd-questions@freebsd.org mailing list
> > http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> > To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
> 
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
> 

-- 
 Gary Kline  kl...@thought.org  http://www.thought.org  Public Service Unix
   Journey Toward the Dawn, E-Book: http://www.thought.org
  The 7.98a release of Jottings: http://jottings.thought.org

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: graphical representation of `du`

2011-04-02 Thread Ryan Coleman
Yeah I don't run these computers to be desktops :)

On Apr 2, 2011, at 8:05 PM, David Chanters wrote:

> On 3 April 2011 01:30, Ryan Coleman  wrote:
>> Well, it looks like it's written for X, which I don't run on any of my 
>> servers.
> 
> Moan, moan, moan.   It solves your problem though.
> 
> David
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: graphical representation of `du`

2011-04-02 Thread David Chanters
On 3 April 2011 01:30, Ryan Coleman  wrote:
> Well, it looks like it's written for X, which I don't run on any of my 
> servers.

Moan, moan, moan.   It solves your problem though.

David
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: graphical representation of `du`

2011-04-02 Thread Ryan Coleman
Well, it looks like it's written for X, which I don't run on any of my servers.

Thanks, though.

On Apr 2, 2011, at 6:50 PM, David Chanters wrote:

> Hi
> 
> On 2 April 2011 15:20, Ryan Coleman  wrote:
>> I found this command:
>> ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' 
>> -e 's/-/|/'
> 
> What about xdu?
> 
> http://sd.wareonearth.com/~phil/xdu/
> 
> David
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: graphical representation of `du`

2011-04-02 Thread perryh
Chris Rees  wrote:

> Maybe I should port it...

+1
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: graphical representation of `du`

2011-04-02 Thread David Chanters
Hi

On 2 April 2011 15:20, Ryan Coleman  wrote:
> I found this command:
> ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 
> 's/-/|/'

What about xdu?

http://sd.wareonearth.com/~phil/xdu/

David
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: graphical representation of `du`

2011-04-02 Thread Gary Kline
On Sat, Apr 02, 2011 at 06:30:15PM +0100, Chris Rees wrote:
> On 2 April 2011 18:22, Chris Rees  wrote:
> > On 2 April 2011 18:07, Mike Jeays  wrote:
> >> On Sat, 2 Apr 2011 17:15:04 +0100
> >> Chris Rees  wrote:
> >>
> >>> du -h . | awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }' |
> >>> awk '{print($2" ["$1"]");}' | sed -e 's,[^-][^/]*/,--,g' -e 's,^,|,'
> >>
> >>
> >> I confess to being impressed...
> >>
> >
> > Yeah, but perhaps I should have used sed instead of the second awk;
> > fewer processes:
> >
> > du -h | awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }' | sed
> > -e 's,^[^1-9]*\([^___CTRL-V+TAB__]*\)CTRL-V+TAB_*\(.*\)$,\2
> > \[\1\],;s,[^-][^/]*/,--,g;s,^,|,'
> >
> > That does exactly the same --  where I've put CTRL-V+TAB__ you
> > have to type Ctrl-V, then a literal [::tab::] key; BSD sed doesn't do
> > \t.
> >
> > Chris
> >
> 
> Final version:
> 
> http://www.bayofrum.net/~crees/graphical_du.sh
> 
> Maybe I should port it...
> 
> Chris


PULeesese DO port that .  [!!]

gary


> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
> 

-- 
 Gary Kline  kl...@thought.org  http://www.thought.org  Public Service Unix
The 7.98a release of Jottings: http://jottings.thought.org/index.php
   http://journey.thought.org
 ethic 
Coming soon to http://transfinite.thought.org: On_Suicide




___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: graphical representation of `du`

2011-04-02 Thread Ryan Coleman
Wow... You rock!

Thanks so much!

On Apr 2, 2011, at 12:30 PM, Chris Rees wrote:

> On 2 April 2011 18:22, Chris Rees  wrote:
>> On 2 April 2011 18:07, Mike Jeays  wrote:
>>> On Sat, 2 Apr 2011 17:15:04 +0100
>>> Chris Rees  wrote:
>>> 
>>>> du -h . | awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }' |
>>>> awk '{print($2" ["$1"]");}' | sed -e 's,[^-][^/]*/,--,g' -e 's,^,|,'
>>> 
>>> 
>>> I confess to being impressed...
>>> 
>> 
>> Yeah, but perhaps I should have used sed instead of the second awk;
>> fewer processes:
>> 
>> du -h | awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }' | sed
>> -e 's,^[^1-9]*\([^___CTRL-V+TAB__]*\)CTRL-V+TAB_*\(.*\)$,\2
>> \[\1\],;s,[^-][^/]*/,--,g;s,^,|,'
>> 
>> That does exactly the same --  where I've put CTRL-V+TAB__ you
>> have to type Ctrl-V, then a literal [::tab::] key; BSD sed doesn't do
>> \t.
>> 
>> Chris
>> 
> 
> Final version:
> 
> http://www.bayofrum.net/~crees/graphical_du.sh
> 
> Maybe I should port it...
> 
> Chris
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: graphical representation of `du`

2011-04-02 Thread Mike Jeays
On Sat, 2 Apr 2011 17:15:04 +0100
Chris Rees  wrote:

> du -h . | awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }' |
> awk '{print($2" ["$1"]");}' | sed -e 's,[^-][^/]*/,--,g' -e 's,^,|,'


I confess to being impressed...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: graphical representation of `du`

2011-04-02 Thread Chris Rees
On 2 April 2011 18:22, Chris Rees  wrote:
> On 2 April 2011 18:07, Mike Jeays  wrote:
>> On Sat, 2 Apr 2011 17:15:04 +0100
>> Chris Rees  wrote:
>>
>>> du -h . | awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }' |
>>> awk '{print($2" ["$1"]");}' | sed -e 's,[^-][^/]*/,--,g' -e 's,^,|,'
>>
>>
>> I confess to being impressed...
>>
>
> Yeah, but perhaps I should have used sed instead of the second awk;
> fewer processes:
>
> du -h | awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }' | sed
> -e 's,^[^1-9]*\([^___CTRL-V+TAB__]*\)CTRL-V+TAB_*\(.*\)$,\2
> \[\1\],;s,[^-][^/]*/,--,g;s,^,|,'
>
> That does exactly the same --  where I've put CTRL-V+TAB__ you
> have to type Ctrl-V, then a literal [::tab::] key; BSD sed doesn't do
> \t.
>
> Chris
>

Final version:

http://www.bayofrum.net/~crees/graphical_du.sh

Maybe I should port it...

Chris
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: graphical representation of `du`

2011-04-02 Thread Chris Rees
On 2 April 2011 18:07, Mike Jeays  wrote:
> On Sat, 2 Apr 2011 17:15:04 +0100
> Chris Rees  wrote:
>
>> du -h . | awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }' |
>> awk '{print($2" ["$1"]");}' | sed -e 's,[^-][^/]*/,--,g' -e 's,^,|,'
>
>
> I confess to being impressed...
>

Yeah, but perhaps I should have used sed instead of the second awk;
fewer processes:

du -h | awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }' | sed
-e 's,^[^1-9]*\([^___CTRL-V+TAB__]*\)CTRL-V+TAB_*\(.*\)$,\2
\[\1\],;s,[^-][^/]*/,--,g;s,^,|,'

That does exactly the same --  where I've put CTRL-V+TAB__ you
have to type Ctrl-V, then a literal [::tab::] key; BSD sed doesn't do
\t.

Chris
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: graphical representation of `du`

2011-04-02 Thread Chris Rees
On 2 April 2011 15:20, Ryan Coleman  wrote:
> I found this command:
> ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 
> 's/-/|/'
>
> Which makes this:
>   |-Mar17
>   |---1300074369-chow
>   |-download
>   |---small
>   |---1300421616-Cunningham
>   |-download
>   |---small
>
> But I want to use `du` instead to convert this
> 2.0M    ./Mar17/1300074369-chow/download/small
> 2.0M    ./Mar17/1300074369-chow/download
> 2.0M    ./Mar17/1300074369-chow
> 2.1M    ./Mar17/1300421616-Cunningham/download/small
> 2.1M    ./Mar17/1300421616-Cunningham/download
> 2.1M    ./Mar17/1300421616-Cunningham
> 4.1M    ./Mar17
>
> into this:
>   |-Mar17 [4.3M]
>   |---1300074369-chow [2.0M]
>   |-download [2.0M]
>   |---small [2.0M]
>   |---1300421616-Cunningham [2.1M]
>   |-download [2.1M]
>   |---small [2.1M]
>
>
> I realize it does it backwards and I can live with that...  OR mix the two to 
> run the first command and run another command to get the folders total size 
> or something... you know?
>

du -h . | awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }' |
awk '{print($2" ["$1"]");}' | sed -e 's,[^-][^/]*/,--,g' -e 's,^,|,'

Does it forwards :P

[crees@zeus]~/workspace/ports% du -h . | awk '{a[i++]=$0} END {for
(j=i-1; j>=0;) print a[j--] }' | awk '{print($2" ["$1"]");}' | sed -e
's,[^-][^/]*/,--,g' -e 's,^,|,'
|. [445K]
|--net-mgmt [81K]
|CVS [5.5K]
|zabbix-server [74K]
|--files [11K]
|CVS [4.5K]
|--CVS [4.5K]
... etc...
|--net [31K]
|pppoa [24K]
|--CVS [4.5K]
|--files [12K]
|CVS [4.5K]
|CVS [5.5K]
[crees@zeus]~/workspace/ports%

Any refinements requested I'll have a look at.

Chris
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


graphical representation of `du`

2011-04-02 Thread Ryan Coleman
I found this command:
ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 
's/-/|/' 

Which makes this:
   |-Mar17
   |---1300074369-chow
   |-download
   |---small
   |---1300421616-Cunningham
   |-----download
   |---small

But I want to use `du` instead to convert this
2.0M./Mar17/1300074369-chow/download/small
2.0M./Mar17/1300074369-chow/download
2.0M./Mar17/1300074369-chow
2.1M./Mar17/1300421616-Cunningham/download/small
2.1M./Mar17/1300421616-Cunningham/download
2.1M./Mar17/1300421616-Cunningham
4.1M./Mar17

into this:
   |-Mar17 [4.3M]
   |---1300074369-chow [2.0M]
   |-download [2.0M]
   |---small [2.0M]
   |---1300421616-Cunningham [2.1M]
   |-download [2.1M]
   |---small [2.1M]


I realize it does it backwards and I can live with that...  OR mix the two to 
run the first command and run another command to get the folders total size or 
something... you know?

Thanks for the help,
Ryan___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: / file system is full, but du does not show that it's full

2011-02-28 Thread c0re
2011/2/28 Robert Bonomi :
>> From owner-freebsd-questi...@freebsd.org  Mon Feb 28 05:31:46 2011
>> Date: Mon, 28 Feb 2011 14:24:30 +0300
>> From: c0re 
>> To: Matthew Seaman 
>> Cc: FreeBSD 
>> Subject: Re: / file system is full, but du does not show that it's full
>>
>> 2011/1/6 Matthew Seaman :
>> > On 06/01/2011 11:26, c0re wrote:
>> >> # df -h
>> >> Filesystem     Size    Used   Avail Capacity  Mounted on
>> >> /dev/ad0s1a    496M    466M   -9.8M   102%    /
>> >>
>> >> So it's full.
>> >>
>> >> But by du it's not appeared to be full
>> >>
>> >>
>> >> # du -hxd 1 /
>> >> 2.0K    /.snap
>> >> 512B    /dev
>> >> 2.0K    /tmp
>> >> 2.0K    /usr
>> >> 2.0K    /var
>> >> 1.9M    /etc
>> >> 2.0K    /cdrom
>> >> 2.0K    /dist
>> >> 1.0M    /bin
>> >> 131M    /boot
>> >>  10M    /lib
>> >> 356K    /libexec
>> >> 2.0K    /media
>> >>  12K    /mnt
>> >> 2.0K    /proc
>> >> 7.2M    /rescue
>> >> 296K    /root
>> >> 4.7M    /sbin
>> >> 4.0K    /lost+found
>> >> 157M    /
>> >>
>> >
>> > Do you have partitions mounted at /tmp, /usr, /var etc?  Does the
>> > output of your du command change if you unmount those partitions? (It
>> > might be an idea to boot into a livefs CD or DVD given that du(1) lives
>> > in /usr/bin, so a bit tricky to unmount /usr and then run du)
>> >
>> > My guess is that you've at one time created files beneath what is
>> > usually a mount point.  Mounting the partition over them makes those
>> > files inaccessible, but they still take up space on the drive.
>> >
>> >        Cheers,
>> >
>> >        Matthew
>> >
>> > --
>> > Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
>> >                                                  Flat 3
>> > PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate JID:
>> > matt...@infracaninophile.co.uk               Kent, CT11 9PW
>> >
>> >
>>
>> At last I found time to check it. Booted with frenzy life cd, mounted
>> only / partition and saw trash
>> /var/spool. Deleted it and it solved problem.
>> But later was and idea to mount device of / (/dev/da0s1a) as /mnt/root
>> and just delete those files without need of livecd. It works in Linux.
>> But in freebsd i got
>>
>> # mount /dev/da0s1a /mnt/root/
>> mount: /dev/da0s1a : Operation not permitted
>>
>> So only single user mode or live cd could solve it.
>
> *NOT* true.  Stopping any daemons that were using "/var/spooll", and then
> umount(1)-ing it would have done the trick from multi-user mode.
>

Yeah, not true.

Checked with lsof /var and it was used by these daemons:

devd
syslogd
rpcbind
snmpd
mysqld
httpd
sendmail
cron

Yes, I can stop them all,  but was not sure about stopping devd...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: / file system is full, but du does not show that it's full

2011-02-28 Thread Arthur Chance

On 02/28/11 12:47, Polytropon wrote:

On Mon, 28 Feb 2011 13:29:59 +0100, Damien Fleuriot  wrote:

Slice a (as in: da0s1a) is very likely his /

/var is usually slice f


Terminology: Slices are with numbers, partitions are with letters. :-)

E. g. da0s1 is the FreeBSD slice, its partition a = da0s1a is /,
while /var corresponds to partition da0s1f.


Unless you've got GPT disks where there are usually only partitions and 
they're numbered:


arthur@fileserver> gpart show ada5
=>   34  976773101  ada5  GPT  (466G)
 34  6- free -  (3.0K)
 40 64 1  freebsd-boot  (32K)
1042097152 2  freebsd-ufs  (1.0G)
20972562097152 3  freebsd-ufs  (1.0G)
41944088388608 4  freebsd-swap  (4.0G)
   12583016  964190119 5  freebsd-ufs  (460G)

arthur@fileserver> ls /dev/ada5*
/dev/ada5   /dev/ada5p1 /dev/ada5p2 /dev/ada5p3 /dev/ada5p4 
/dev/ada5p5

Personally I prefer labelling everything, which GPT makes easier.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: / file system is full, but du does not show that it's full

2011-02-28 Thread Polytropon
On Mon, 28 Feb 2011 13:29:59 +0100, Damien Fleuriot  wrote:
> Slice a (as in: da0s1a) is very likely his /
> 
> /var is usually slice f

Terminology: Slices are with numbers, partitions are with letters. :-)

E. g. da0s1 is the FreeBSD slice, its partition a = da0s1a is /,
while /var corresponds to partition da0s1f.


-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: / file system is full, but du does not show that it's full

2011-02-28 Thread Chris Rees
On 28 February 2011 12:29, Damien Fleuriot  wrote:
> On 2/28/11 1:27 PM, Chris Rees wrote:
>> On 28 February 2011 12:26, Chris Rees  wrote:
>
> # mount /dev/da0s1a /mnt/root/
> mount: /dev/da0s1a : Operation not permitted
>
> So only single user mode or live cd could solve it.

 *NOT* true.  Stopping any daemons that were using "/var/spooll", and then
 umount(1)-ing it would have done the trick from multi-user mode.
>>>
>>> umount /   ???
>>>
>>> Chris
>>
>> Er, caffeine overdose.
>>
>> I guess you meant:
>>
>> # umount /var
> Slice a (as in: da0s1a) is very likely his /
>
> /var is usually slice f

Yeah, that's why I sent the first email.

However, it's now clear to me that c0re wanted to remount his / on a
different partition to delete a file hidden by /var.

Hence the suggestion from Robert to umount /var.

Chris
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: / file system is full, but du does not show that it's full

2011-02-28 Thread Damien Fleuriot
On 2/28/11 1:27 PM, Chris Rees wrote:
> On 28 February 2011 12:26, Chris Rees  wrote:

 # mount /dev/da0s1a /mnt/root/
 mount: /dev/da0s1a : Operation not permitted

 So only single user mode or live cd could solve it.
>>>
>>> *NOT* true.  Stopping any daemons that were using "/var/spooll", and then
>>> umount(1)-ing it would have done the trick from multi-user mode.
>>
>> umount /   ???
>>
>> Chris
> 
> Er, caffeine overdose.
> 
> I guess you meant:
> 
> # umount /var
> 
> 
> 
> I'll hide now.
> 
> Chris


Slice a (as in: da0s1a) is very likely his /

/var is usually slice f
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: / file system is full, but du does not show that it's full

2011-02-28 Thread Chris Rees
On 28 February 2011 12:26, Chris Rees  wrote:
>> >
>> > # mount /dev/da0s1a /mnt/root/
>> > mount: /dev/da0s1a : Operation not permitted
>> >
>> > So only single user mode or live cd could solve it.
>>
>> *NOT* true.  Stopping any daemons that were using "/var/spooll", and then
>> umount(1)-ing it would have done the trick from multi-user mode.
>
> umount /   ???
>
> Chris

Er, caffeine overdose.

I guess you meant:

# umount /var



I'll hide now.

Chris
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: / file system is full, but du does not show that it's full

2011-02-28 Thread Damien Fleuriot


On 2/28/11 12:24 PM, c0re wrote:
> 2011/1/6 Matthew Seaman :
>> On 06/01/2011 11:26, c0re wrote:
>>> # df -h
>>> Filesystem SizeUsed   Avail Capacity  Mounted on
>>> /dev/ad0s1a496M466M   -9.8M   102%/
>>>
>>> So it's full.
>>>
>>> But by du it's not appeared to be full
>>>
>>>
>>> # du -hxd 1 /
>>> 2.0K/.snap
>>> 512B/dev
>>> 2.0K/tmp
>>> 2.0K/usr
>>> 2.0K/var
>>> 1.9M/etc
>>> 2.0K/cdrom
>>> 2.0K/dist
>>> 1.0M/bin
>>> 131M/boot
>>>  10M/lib
>>> 356K/libexec
>>> 2.0K/media
>>>  12K/mnt
>>> 2.0K/proc
>>> 7.2M/rescue
>>> 296K/root
>>> 4.7M/sbin
>>> 4.0K/lost+found
>>> 157M    /
>>>
>>
>> Do you have partitions mounted at /tmp, /usr, /var etc?  Does the output
>> of your du command change if you unmount those partitions?
>> (It might be an idea to boot into a livefs CD or DVD given that du(1)
>> lives in /usr/bin, so a bit tricky to unmount /usr and then run du)
>>
>> My guess is that you've at one time created files beneath what is
>> usually a mount point.  Mounting the partition over them makes those
>> files inaccessible, but they still take up space on the drive.
>>
>>Cheers,
>>
>>Matthew
>>
>> --
>> Dr Matthew J Seaman MA, D.Phil.   7 Priory Courtyard
>>  Flat 3
>> PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
>> JID: matt...@infracaninophile.co.uk   Kent, CT11 9PW
>>
>>
> 
> At last I found time to check it.
> Booted with frenzy life cd, mounted only / partition and saw trash
> /var/spool. Deleted it and it solved problem.
> But later was and idea to mount device of / (/dev/da0s1a) as /mnt/root
> and just delete those files without need of livecd. It works in Linux.
> But in freebsd i got
> 
> # mount /dev/da0s1a /mnt/root/
> mount: /dev/da0s1a : Operation not permitted
> 
> So only single user mode or live cd could solve it.
> 
> Thanks Matthew for an idea!


You're not really trying to umount / on a running system are you ?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: / file system is full, but du does not show that it's full

2011-02-28 Thread Chris Rees
On 28 Feb 2011 12:12, "Robert Bonomi"  wrote:
>
> > From owner-freebsd-questi...@freebsd.org  Mon Feb 28 05:31:46 2011
> > Date: Mon, 28 Feb 2011 14:24:30 +0300
> > From: c0re 
> > To: Matthew Seaman 
> > Cc: FreeBSD 
> > Subject: Re: / file system is full, but du does not show that it's full
> >
> > 2011/1/6 Matthew Seaman :
> > > On 06/01/2011 11:26, c0re wrote:
> > >> # df -h
> > >> Filesystem SizeUsed   Avail Capacity  Mounted on
> > >> /dev/ad0s1a496M466M   -9.8M   102%    /
> > >>
> > >> So it's full.
> > >>
> > >> But by du it's not appeared to be full
> > >>
> > >>
> > >> # du -hxd 1 /
> > >> 2.0K/.snap
> > >> 512B/dev
> > >> 2.0K/tmp
> > >> 2.0K/usr
> > >> 2.0K/var
> > >> 1.9M/etc
> > >> 2.0K/cdrom
> > >> 2.0K/dist
> > >> 1.0M/bin
> > >> 131M/boot
> > >>  10M/lib
> > >> 356K/libexec
> > >> 2.0K/media
> > >>  12K/mnt
> > >> 2.0K/proc
> > >> 7.2M/rescue
> > >> 296K/root
> > >> 4.7M/sbin
> > >> 4.0K/lost+found
> > >> 157M/
> > >>
> > >
> > > Do you have partitions mounted at /tmp, /usr, /var etc?  Does the
> > > output of your du command change if you unmount those partitions? (It
> > > might be an idea to boot into a livefs CD or DVD given that du(1)
lives
> > > in /usr/bin, so a bit tricky to unmount /usr and then run du)
> > >
> > > My guess is that you've at one time created files beneath what is
> > > usually a mount point.  Mounting the partition over them makes those
> > > files inaccessible, but they still take up space on the drive.
> > >
> > >Cheers,
> > >
> > >Matthew
> > >
> > > --
> > > Dr Matthew J Seaman MA, D.Phil.   7 Priory Courtyard
> > >  Flat 3
> > > PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate JID:
> > > matt...@infracaninophile.co.uk   Kent, CT11 9PW
> > >
> > >
> >
> > At last I found time to check it. Booted with frenzy life cd, mounted
> > only / partition and saw trash
> > /var/spool. Deleted it and it solved problem.
> > But later was and idea to mount device of / (/dev/da0s1a) as /mnt/root
> > and just delete those files without need of livecd. It works in Linux.
> > But in freebsd i got
> >
> > # mount /dev/da0s1a /mnt/root/
> > mount: /dev/da0s1a : Operation not permitted
> >
> > So only single user mode or live cd could solve it.
>
> *NOT* true.  Stopping any daemons that were using "/var/spooll", and then
> umount(1)-ing it would have done the trick from multi-user mode.
>
>
>

umount /   ???

Chris
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: / file system is full, but du does not show that it's full

2011-02-28 Thread Robert Bonomi
> From owner-freebsd-questi...@freebsd.org  Mon Feb 28 05:31:46 2011
> Date: Mon, 28 Feb 2011 14:24:30 +0300
> From: c0re 
> To: Matthew Seaman 
> Cc: FreeBSD 
> Subject: Re: / file system is full, but du does not show that it's full
>
> 2011/1/6 Matthew Seaman :
> > On 06/01/2011 11:26, c0re wrote:
> >> # df -h
> >> Filesystem SizeUsed   Avail Capacity  Mounted on
> >> /dev/ad0s1a496M466M   -9.8M   102%/
> >>
> >> So it's full.
> >>
> >> But by du it's not appeared to be full
> >>
> >>
> >> # du -hxd 1 /
> >> 2.0K/.snap
> >> 512B/dev
> >> 2.0K/tmp
> >> 2.0K/usr
> >> 2.0K/var
> >> 1.9M/etc
> >> 2.0K/cdrom
> >> 2.0K/dist
> >> 1.0M/bin
> >> 131M/boot
> >>  10M/lib
> >> 356K/libexec
> >> 2.0K/media
> >>  12K/mnt
> >> 2.0K/proc
> >> 7.2M/rescue
> >> 296K    /root
> >> 4.7M/sbin
> >> 4.0K/lost+found
> >> 157M/
> >>
> >
> > Do you have partitions mounted at /tmp, /usr, /var etc?  Does the 
> > output of your du command change if you unmount those partitions? (It 
> > might be an idea to boot into a livefs CD or DVD given that du(1) lives 
> > in /usr/bin, so a bit tricky to unmount /usr and then run du)
> >
> > My guess is that you've at one time created files beneath what is 
> > usually a mount point.  Mounting the partition over them makes those 
> > files inaccessible, but they still take up space on the drive.
> >
> >Cheers,
> >
> >Matthew
> >
> > --
> > Dr Matthew J Seaman MA, D.Phil.   7 Priory Courtyard
> >  Flat 3
> > PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate JID: 
> > matt...@infracaninophile.co.uk   Kent, CT11 9PW
> >
> >
>
> At last I found time to check it. Booted with frenzy life cd, mounted 
> only / partition and saw trash
> /var/spool. Deleted it and it solved problem.
> But later was and idea to mount device of / (/dev/da0s1a) as /mnt/root 
> and just delete those files without need of livecd. It works in Linux. 
> But in freebsd i got
>
> # mount /dev/da0s1a /mnt/root/
> mount: /dev/da0s1a : Operation not permitted
>
> So only single user mode or live cd could solve it.

*NOT* true.  Stopping any daemons that were using "/var/spooll", and then
umount(1)-ing it would have done the trick from multi-user mode.


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: / file system is full, but du does not show that it's full

2011-02-28 Thread c0re
2011/1/6 Matthew Seaman :
> On 06/01/2011 11:26, c0re wrote:
>> # df -h
>> Filesystem     Size    Used   Avail Capacity  Mounted on
>> /dev/ad0s1a    496M    466M   -9.8M   102%    /
>>
>> So it's full.
>>
>> But by du it's not appeared to be full
>>
>>
>> # du -hxd 1 /
>> 2.0K    /.snap
>> 512B    /dev
>> 2.0K    /tmp
>> 2.0K    /usr
>> 2.0K    /var
>> 1.9M    /etc
>> 2.0K    /cdrom
>> 2.0K    /dist
>> 1.0M    /bin
>> 131M    /boot
>>  10M    /lib
>> 356K    /libexec
>> 2.0K    /media
>>  12K    /mnt
>> 2.0K    /proc
>> 7.2M    /rescue
>> 296K    /root
>> 4.7M    /sbin
>> 4.0K    /lost+found
>> 157M    /
>>
>
> Do you have partitions mounted at /tmp, /usr, /var etc?  Does the output
> of your du command change if you unmount those partitions?
> (It might be an idea to boot into a livefs CD or DVD given that du(1)
> lives in /usr/bin, so a bit tricky to unmount /usr and then run du)
>
> My guess is that you've at one time created files beneath what is
> usually a mount point.  Mounting the partition over them makes those
> files inaccessible, but they still take up space on the drive.
>
>        Cheers,
>
>        Matthew
>
> --
> Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
>                                                  Flat 3
> PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
> JID: matt...@infracaninophile.co.uk               Kent, CT11 9PW
>
>

At last I found time to check it.
Booted with frenzy life cd, mounted only / partition and saw trash
/var/spool. Deleted it and it solved problem.
But later was and idea to mount device of / (/dev/da0s1a) as /mnt/root
and just delete those files without need of livecd. It works in Linux.
But in freebsd i got

# mount /dev/da0s1a /mnt/root/
mount: /dev/da0s1a : Operation not permitted

So only single user mode or live cd could solve it.

Thanks Matthew for an idea!
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: / file system is full, but du does not show that it's full

2011-01-06 Thread Peter Vereshagin
Concrete jungle, oh freebsd-questions, you've got to do your best...
2011/01/06 17:19:05 +0300 c0re  => To FreeBSD :
cr> > Another place to look for wasted space is filesystem snapshots, if any. 
They
cr> > can be created implicitly, e. g., by fsck.
cr> Yeah, I checked /.snap - nothing there.

snapshot is represented as a file of a special type that can be located
anywhere oin a file system, not only the /.snap/. Try snainfo -a.

73! Peter pgp: A0E26627 (4A42 6841 2871 5EA7 52AB  12F8 0CE1 4AAC A0E2 6627)
--
http://vereshagin.org
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: / file system is full, but du does not show that it's full

2011-01-06 Thread Svein Skogen (Listmail account)
On 06.01.2011 15:19, c0re wrote:
>> why not to restart your httpd and mysqld?
>> This may release your unused filehandles.
> As I said I've restarted whole server, so nothing there to release at all.
> 
>> Another place to look for wasted space is filesystem snapshots, if any. They
>> can be created implicitly, e. g., by fsck.
> Yeah, I checked /.snap - nothing there.

Reboot into single user mode, and check with du -hs /* before the system
mounts other FS'es than /

//Svein

-- 
+---+---
  /"\   |Svein Skogen   | sv...@d80.iso100.no
  \ /   |Solberg Østli 9| PGP Key:  0xE5E76831
   X|2020 Skedsmokorset | sv...@jernhuset.no
  / \   |Norway | PGP Key:  0xCE96CE13
|   | sv...@stillbilde.net
 ascii  |   | PGP Key:  0x58CD33B6
 ribbon |System Admin   | svein-listm...@stillbilde.net
Campaign|stillbilde.net | PGP Key:  0x22D494A4
+---+---
|msn messenger: | Mobile Phone: +47 907 03 575
|sv...@jernhuset.no | RIPE handle:SS16503-RIPE
+---+---
A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

 Picture Gallery:
  https://gallery.stillbilde.net/v/svein/




signature.asc
Description: OpenPGP digital signature


Re: / file system is full, but du does not show that it's full

2011-01-06 Thread c0re
> why not to restart your httpd and mysqld?
> This may release your unused filehandles.
As I said I've restarted whole server, so nothing there to release at all.

> Another place to look for wasted space is filesystem snapshots, if any. They
> can be created implicitly, e. g., by fsck.
Yeah, I checked /.snap - nothing there.

> And... why lsof and not fstat(1)?
As I mentioned - fstat does not show full path including filename like
lsof does.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: / file system is full, but du does not show that it's full

2011-01-06 Thread Chris Rees
Server has been rebooted before to try this.

Chris



Sorry for top-posting, Android won't let me quote, but K-9 can't yet do
threading.
On 6 Jan 2011 14:06, "Peter Vereshagin"  wrote:
> Concrete jungle, oh freebsd-questions, you've got to do your best...
> 2011/01/06 16:57:34 +0300 Peter Vereshagin  => To
freebsd-questions@freebsd.org :
> PV> This may release your unused filehandles.
>
> used but unlinked, really, oops.
>
> 73! Peter pgp: A0E26627 (4A42 6841 2871 5EA7 52AB 12F8 0CE1 4AAC A0E2
6627)
> --
> http://vereshagin.org
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "
freebsd-questions-unsubscr...@freebsd.org"
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: / file system is full, but du does not show that it's full

2011-01-06 Thread Peter Vereshagin
Concrete jungle, oh freebsd-questions, you've got to do your best...
2011/01/06 16:57:34 +0300 Peter Vereshagin  => To 
freebsd-questions@freebsd.org :
PV> This may release your unused filehandles.

used but unlinked, really, oops.

73! Peter pgp: A0E26627 (4A42 6841 2871 5EA7 52AB  12F8 0CE1 4AAC A0E2 6627)
--
http://vereshagin.org
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: / file system is full, but du does not show that it's full

2011-01-06 Thread Peter Vereshagin
Concrete jungle, oh freebsd-questions, you've got to do your best...
2011/01/06 15:06:18 +0300 c0re  => To FreeBSD :

cr> # lsof /

why not to restart your httpd and mysqld?
This may release your unused filehandles.
Another place to look for wasted space is filesystem snapshots, if any. They
can be created implicitly, e. g., by fsck.
And... why lsof and not fstat(1)?

73! Peter pgp: A0E26627 (4A42 6841 2871 5EA7 52AB  12F8 0CE1 4AAC A0E2 6627)
--
http://vereshagin.org
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: / file system is full, but du does not show that it's full

2011-01-06 Thread c0re
2011/1/6 Matthew Seaman :
> On 06/01/2011 11:26, c0re wrote:
>> # df -h
>> Filesystem     Size    Used   Avail Capacity  Mounted on
>> /dev/ad0s1a    496M    466M   -9.8M   102%    /
>>
>> So it's full.
>>
>> But by du it's not appeared to be full
>>
>>
>> # du -hxd 1 /
>> 2.0K    /.snap
>> 512B    /dev
>> 2.0K    /tmp
>> 2.0K    /usr
>> 2.0K    /var
>> 1.9M    /etc
>> 2.0K    /cdrom
>> 2.0K    /dist
>> 1.0M    /bin
>> 131M    /boot
>>  10M    /lib
>> 356K    /libexec
>> 2.0K    /media
>>  12K    /mnt
>> 2.0K    /proc
>> 7.2M    /rescue
>> 296K    /root
>> 4.7M    /sbin
>> 4.0K    /lost+found
>> 157M    /
>>
>
> Do you have partitions mounted at /tmp, /usr, /var etc?  Does the output
> of your du command change if you unmount those partitions?
> (It might be an idea to boot into a livefs CD or DVD given that du(1)
> lives in /usr/bin, so a bit tricky to unmount /usr and then run du)
>
> My guess is that you've at one time created files beneath what is
> usually a mount point.  Mounting the partition over them makes those
> files inaccessible, but they still take up space on the drive.
>
>        Cheers,
>
>        Matthew
>
> --
> Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
>                                                  Flat 3
> PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
> JID: matt...@infracaninophile.co.uk               Kent, CT11 9PW
>
>

Nice idea! But I can't check it now - server is may hundred km away
and no KVM aviable. Will check it 1 or 2 weeks later. Checked only
/tmp - it was ok, no files there after unmount.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: / file system is full, but du does not show that it's full

2011-01-06 Thread c0re
2011/1/6 Ryan Coleman :
> What about filehandlers?
>
> On Jan 6, 2011, at 5:26 AM, c0re wrote:
>
>> # df -h
>> Filesystem     Size    Used   Avail Capacity  Mounted on
>> /dev/ad0s1a    496M    466M   -9.8M   102%    /
>>
>> So it's full.
>>
>> But by du it's not appeared to be full
>>
>>
>> # du -hxd 1 /
>> 2.0K    /.snap
>> 512B    /dev
>> 2.0K    /tmp
>> 2.0K    /usr
>> 2.0K    /var
>> 1.9M    /etc
>> 2.0K    /cdrom
>> 2.0K    /dist
>> 1.0M    /bin
>> 131M    /boot
>> 10M    /lib
>> 356K    /libexec
>> 2.0K    /media
>> 12K    /mnt
>> 2.0K    /proc
>> 7.2M    /rescue
>> 296K    /root
>> 4.7M    /sbin
>> 4.0K    /lost+found
>> 157M    /
>>
>>
>> I know that something (like running process) can hold file so it's
>> actually are not deleted. I rebooted server. But this not helped, so
>> it's not a process holding file.
>>
>> Checked with fsck
>>
>> # fsck /
>> ** /dev/ad0s1a (NO WRITE)
>> ** Last Mounted on /
>> ** Root file system
>> ** Phase 1 - Check Blocks and Sizes
>> ** Phase 2 - Check Pathnames
>> ** Phase 3 - Check Connectivity
>> ** Phase 4 - Check Reference Counts
>> ** Phase 5 - Check Cyl groups
>> 47268 files, 238539 used, 15276 free (6684 frags, 1074 blocks, 2.6%
>> fragmentation)
>>
>> No problems here.
>>
>>
>> # uname -a
>> FreeBSD host.domain.com 7.3-RELEASE-p4 FreeBSD 7.3-RELEASE-p4 #0: Tue
>> Dec 28 13:55:47 MSK 2010
>> r...@host.domain.com:/usr/obj/usr/src/sys/MYKERNEL  i386
>>
>> What's the problem here? Why df says that filesystem is full? Other
>> command may also say that can't write because file system is full.
>> ___
>> freebsd-questions@freebsd.org mailing list
>> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>> To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
>
>

fstat does not show full filepath so I uses lsof from ports
lsof does not show anything criminal

# lsof /
COMMANDPID   USER   FD   TYPE DEVICE SIZE/OFF  NODE NAME
init 1   root  cwd   VDIR   0,81  512 2 /
init 1   root  rtd   VDIR   0,81  512 2 /
init 1   root  txt   VREG   0,81   632348 33074 /sbin/init
firmware 5   root  cwd   VDIR   0,81  512 2 /
firmware 5   root  rtd   VDIR   0,81  512 2 /
adjkerntz  145   root  cwd   VDIR   0,81  512 2 /
adjkerntz  145   root  rtd   VDIR   0,81  512 2 /
adjkerntz  145   root  txt   VREG   0,81 7448 16481 /sbin/adjkerntz
adjkerntz  145   root  txt   VREG   0,81   189172 50770 /libexec/ld-elf.so.1
adjkerntz  145   root  txt   VREG   0,81  1067248 50739 /lib/libc.so.7
devd   487   root  cwd   VDIR   0,81  512 2 /
devd   487   root  rtd   VDIR   0,81  512 2 /
devd   487   root  txt   VREG   0,81   369684 32969 /sbin/devd
syslogd564   root  cwd   VDIR   0,81  512 2 /
syslogd564   root  rtd   VDIR   0,81  512 2 /
syslogd564   root  txt   VREG   0,81   189172 50770 /libexec/ld-elf.so.1
syslogd564   root  txt   VREG   0,8155240 50747 /lib/libutil.so.7
syslogd564   root  txt   VREG   0,81  1067248 50739 /lib/libc.so.7
rpcbind650   root  cwd   VDIR   0,81  512 2 /
rpcbind650   root  rtd   VDIR   0,81  512 2 /
rpcbind650   root  txt   VREG   0,81   189172 50770 /libexec/ld-elf.so.1
rpcbind650   root  txt   VREG   0,8155240 50747 /lib/libutil.so.7
rpcbind650   root  txt   VREG   0,81  1067248 50739 /lib/libc.so.7
snmpd  690   root  cwd   VDIR   0,81  512 2 /
snmpd  690   root  rtd   VDIR   0,81  512 2 /
snmpd  690   root  txt   VREG   0,81   189172 50770 /libexec/ld-elf.so.1
snmpd  690   root  txt   VREG   0,8132024 50740 /lib/libcrypt.so.4
snmpd  690   root  txt   VREG   0,8155240 50747 /lib/libutil.so.7
snmpd  690   root  txt   VREG   0,8192720 50743 /lib/libm.so.5
snmpd  690   root  txt   VREG   0,8129916 50741 /lib/libkvm.so.4
snmpd  690   root  txt   VREG   0,8118788 50761 /lib/libdevstat.so.6
snmpd  690   root  txt   VREG   0,81  1417668 50595 /lib/libcrypto.so.5
snmpd  690   root  txt   VREG   0,81  1067248 50739 /lib/libc.so.7
sh 751  mysql  cwd   VDIR   0,81  512 2 /
sh 751  mysql  rtd   VDIR   0,81  512 2 /
sh 751  mysql  txt   VREG   0,81   115388 33069 /bin/sh
sh 751  mysql  txt   VREG   0,81   189172 50770 /libexec/ld-elf.so.1
sh 751  mysql  txt   VREG   0,8188492 50751 /lib/libedit.so.6
sh 751  mysql  txt   VREG   0,81  

Re: / file system is full, but du does not show that it's full

2011-01-06 Thread Matthew Seaman
On 06/01/2011 11:26, c0re wrote:
> # df -h
> Filesystem SizeUsed   Avail Capacity  Mounted on
> /dev/ad0s1a496M466M   -9.8M   102%/
> 
> So it's full.
> 
> But by du it's not appeared to be full
> 
> 
> # du -hxd 1 /
> 2.0K/.snap
> 512B/dev
> 2.0K/tmp
> 2.0K/usr
> 2.0K/var
> 1.9M/etc
> 2.0K/cdrom
> 2.0K/dist
> 1.0M/bin
> 131M/boot
>  10M/lib
> 356K/libexec
> 2.0K/media
>  12K/mnt
> 2.0K/proc
> 7.2M/rescue
> 296K/root
> 4.7M/sbin
> 4.0K/lost+found
> 157M/
> 

Do you have partitions mounted at /tmp, /usr, /var etc?  Does the output
of your du command change if you unmount those partitions?
(It might be an idea to boot into a livefs CD or DVD given that du(1)
lives in /usr/bin, so a bit tricky to unmount /usr and then run du)

My guess is that you've at one time created files beneath what is
usually a mount point.  Mounting the partition over them makes those
files inaccessible, but they still take up space on the drive.

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.   7 Priory Courtyard
  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
JID: matt...@infracaninophile.co.uk   Kent, CT11 9PW



signature.asc
Description: OpenPGP digital signature


Re: / file system is full, but du does not show that it's full

2011-01-06 Thread Ryan Coleman
What about filehandlers?

On Jan 6, 2011, at 5:26 AM, c0re wrote:

> # df -h
> Filesystem SizeUsed   Avail Capacity  Mounted on
> /dev/ad0s1a496M466M   -9.8M   102%/
> 
> So it's full.
> 
> But by du it's not appeared to be full
> 
> 
> # du -hxd 1 /
> 2.0K/.snap
> 512B/dev
> 2.0K/tmp
> 2.0K/usr
> 2.0K/var
> 1.9M/etc
> 2.0K/cdrom
> 2.0K/dist
> 1.0M/bin
> 131M/boot
> 10M/lib
> 356K/libexec
> 2.0K/media
> 12K/mnt
> 2.0K/proc
> 7.2M/rescue
> 296K/root
> 4.7M/sbin
> 4.0K/lost+found
> 157M/
> 
> 
> I know that something (like running process) can hold file so it's
> actually are not deleted. I rebooted server. But this not helped, so
> it's not a process holding file.
> 
> Checked with fsck
> 
> # fsck /
> ** /dev/ad0s1a (NO WRITE)
> ** Last Mounted on /
> ** Root file system
> ** Phase 1 - Check Blocks and Sizes
> ** Phase 2 - Check Pathnames
> ** Phase 3 - Check Connectivity
> ** Phase 4 - Check Reference Counts
> ** Phase 5 - Check Cyl groups
> 47268 files, 238539 used, 15276 free (6684 frags, 1074 blocks, 2.6%
> fragmentation)
> 
> No problems here.
> 
> 
> # uname -a
> FreeBSD host.domain.com 7.3-RELEASE-p4 FreeBSD 7.3-RELEASE-p4 #0: Tue
> Dec 28 13:55:47 MSK 2010
> r...@host.domain.com:/usr/obj/usr/src/sys/MYKERNEL  i386
> 
> What's the problem here? Why df says that filesystem is full? Other
> command may also say that can't write because file system is full.
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


/ file system is full, but du does not show that it's full

2011-01-06 Thread c0re
# df -h
Filesystem SizeUsed   Avail Capacity  Mounted on
/dev/ad0s1a496M466M   -9.8M   102%/

So it's full.

But by du it's not appeared to be full


# du -hxd 1 /
2.0K/.snap
512B/dev
2.0K/tmp
2.0K/usr
2.0K/var
1.9M/etc
2.0K/cdrom
2.0K/dist
1.0M/bin
131M/boot
 10M/lib
356K/libexec
2.0K/media
 12K/mnt
2.0K/proc
7.2M/rescue
296K/root
4.7M/sbin
4.0K/lost+found
157M/


I know that something (like running process) can hold file so it's
actually are not deleted. I rebooted server. But this not helped, so
it's not a process holding file.

Checked with fsck

# fsck /
** /dev/ad0s1a (NO WRITE)
** Last Mounted on /
** Root file system
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
47268 files, 238539 used, 15276 free (6684 frags, 1074 blocks, 2.6%
fragmentation)

No problems here.


# uname -a
FreeBSD host.domain.com 7.3-RELEASE-p4 FreeBSD 7.3-RELEASE-p4 #0: Tue
Dec 28 13:55:47 MSK 2010
r...@host.domain.com:/usr/obj/usr/src/sys/MYKERNEL  i386

What's the problem here? Why df says that filesystem is full? Other
command may also say that can't write because file system is full.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: discrepancies in disk usage between df and du

2010-02-12 Thread Fernan Aguero
On Fri, Feb 12, 2010 at 8:53 PM, Paul Schmehl  wrote:
> You have a file locking problem.  du shows disk in use, but df shows disk
> committed.  Use lsof to identify the file that has disk space reserved but
> no longer exists.  man (8) lsof

Thanks Paul for the suggestion. I've tried both lsof and fstat, and
can't really see anything wrong in the output ...

1. Can't install lsof from ports, apparently

===>   Registering installation for lsof-4.83C,4
/var: write failed, filesystem is full
cp: /var/db/pkg/lsof-4.83C,4/+MTREE_DIRS: No space left on device
*** Error code 1

I say 'apparently' because in spite of the error message, /var/db/pkg
gets written anyway:

omega# ls -l /var/db/pkg/lsof-4.83C,4/
total 6
-rw-r--r--  1 root  wheel57 Feb 13 01:22 +COMMENT
-rw-r--r--  1 root  wheel  1435 Feb 13 01:22 +CONTENTS
-rw-r--r--  1 root  wheel   386 Feb 13 01:22 +DESC
-rw-r--r--  1 root  wheel 0 Feb 13 01:22 +MTREE_DIRS

And lsof is installed at /usr/local/sbin/lsof, as expected.

2. Let's see what lsof shows:

omega# lsof +D /var/
COMMANDPID  USER   FD   TYPE DEVICE SIZE/OFFNODE NAME
devd   464  root4u  unix 0xff0005d03b40  0t0
/var/run/devd.pipe
devd   464  root5w  VREG   0,943   47122
/var/run/devd.pid
sendmail   804  root  cwd   VDIR   0,94  512 1295363
/var/spool/mqueue
sendmail   804  root5w  VREG   0,94   78   47115
/var/run/sendmail.pid
sendmail   808 smmsp  cwd   VDIR   0,94  512 1295366
/var/spool/clientmqueue
sendmail   808 smmsp4w  VREG   0,940 1295368
/var/spool/clientmqueue/sm-client.pid
cron   814  root  cwd   VDIR   0,94  512   23552 /var/cron
cron   814  root3w  VREG   0,943   47117
/var/run/cron.pid
csh   6741 paula  cwd   VDIR   0,94 4096  117760 /var/log
syslogd  70526  root3w  VREG   0,945   47111
/var/run/syslog.pid
syslogd  70526  root4u  unix 0xff0024a00b40  0t0
/var/run/log
syslogd  70526  root5u  unix 0xff0013ee9870  0t0
/var/run/logpriv
syslogd  70526  root   11w  VREG   0,9451176  117901
/var/log/messages
syslogd  70526  root   12w  VREG   0,94   60  117771
/var/log/security
syslogd  70526  root   13w  VREG   0,9486008  117780
/var/log/auth.log
syslogd  70526  root   14w  VREG   0,94 2036  117877
/var/log/maillog
syslogd  70526  root   15w  VREG   0,94   60  117767
/var/log/lpd-errs
syslogd  70526  root   16w  VREG   0,94   60  117773
/var/log/xferlog
syslogd  70526  root   17w  VREG   0,9434783  117859
/var/log/cron
syslogd  70526  root   18w  VREG   0,94   93  117766
/var/log/debug.log
syslogd  70526  root   19w  VREG   0,94   60  117772
/var/log/slip.log
syslogd  70526  root   20w  VREG   0,94   60  117770
/var/log/ppp.log

3. fstat comes built-in,

omega# fstat -f /var/
USER CMD  PID   FD MOUNT  INUM MODE SZ|DV R/W
root syslogd705263 /var  47111 -rw---   5  w
root syslogd70526   11 /var 117901 -rw-r--r--   51176  w
root syslogd70526   12 /var 117771 -rw---  60  w
root syslogd70526   13 /var 117780 -rw---   86008  w
root syslogd70526   14 /var 117877 -rw-r-2036  w
root syslogd70526   15 /var 117767 -rw-r--r--  60  w
root syslogd70526   16 /var 117773 -rw---  60  w
root syslogd70526   17 /var 117859 -rw---   34783  w
root syslogd70526   18 /var 117766 -rw---  93  w
root syslogd70526   19 /var 117772 -rw-r-  60  w
root syslogd70526   20 /var 117770 -rw-r-  60  w
paulacsh 6741   wd /var 117760 drwxr-xr-x4096  r
root cron 814   wd /var  23552 drwxr-x--- 512  r
root cron 8143 /var  47117 -rw---   3  w
smmspsendmail 808   wd /var 1295366 drwxrwx--- 512  r
smmspsendmail 8084 /var 1295368 -rw---   0  w
root sendmail 804   wd /var 1295363 drwxr-xr-x 512  r
root sendmail 8045 /var  47115 -rw---  78  w
root devd 4645 /var  47122 -rw---   3  w

I can see nothing here ...

4. But still, disk is full ... or is it?

omega# df -h
FilesystemSizeUsed   Avail Capacity  Mounted on
/dev/mirror/gm0s1f 18G 18G   -1.5G   109%/var

Thanks for any further advice,

--
fernan


> --On February 12, 2010 5:39:44 PM -0300 Fernan Aguero
>  wrote:
>
>> Hi,
>>
>> I have a box (7.2-STABLE, amd64) that is currently showing some disk
>> usage problems. It all started with apache generating huge l

Re: discrepancies in disk usage between df and du

2010-02-12 Thread Paul Schmehl
You have a file locking problem.  du shows disk in use, but df shows disk 
committed.  Use lsof to identify the file that has disk space reserved but 
no longer exists.  man (8) lsof


--On February 12, 2010 5:39:44 PM -0300 Fernan Aguero 
 wrote:



Hi,

I have a box (7.2-STABLE, amd64) that is currently showing some disk
usage problems. It all started with apache generating huge logs from
one of the mod_perl applications that is undergoing testing. So the
/var partition was getting full.

We removed all logs that were causing the problem, but even though du
shows some 700 Mb of usage, df shows that the disk is full (-1.5 Gb):

[fer...@omega ~] sudo du -hc -d1 /var/
Password:
2.0K/var/.snap
423M/var/account
6.0K/var/at
2.0K/var/audit
 18K/var/backups
4.0K/var/crash
6.0K/var/cron
 53M/var/db
2.0K/var/empty
2.0K/var/heimdal
219M/var/log
 14M/var/mail
4.0K/var/msgs
 48K/var/named
2.0K/var/preserve
 44K/var/run
2.0K/var/rwho
 16K/var/spool
 76K/var/tmp
 24K/var/yp
2.0K/var/games
710M/var/
710Mtotal

[fer...@omega ~] df -h
FilesystemSizeUsed   Avail Capacity  Mounted on
/dev/mirror/gm0s1f 18G 18G   -1.5G   109%/var

I've been googling around, and I understand why df and du might be
reporting disk usage differently. However, I can't solve this issue
and reclaim unused disk space ... applications (apache, mod_perl) are
prevented to write to /var and this is causing us problems.

We've already tried rebooting the box, restarting the syslog,
newsyslog daemons, to no avail. df keeps showing >100% disk usage
(-1.5 Gb of remaining disk space) in all cases. We've even rebooted
the box with all apache instances turned off in rc.conf ... i.e.
without any but the most basic services running (sshd) ...

This box is essentially a web server, no other services are being run.

Any suggestions as to what to try next?

Thanks in advance,




Paul Schmehl, If it isn't already
obvious, my opinions are my own
and not those of my employer.
**
WARNING: Check the headers before replying

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


discrepancies in disk usage between df and du

2010-02-12 Thread Fernan Aguero
Hi,

I have a box (7.2-STABLE, amd64) that is currently showing some disk
usage problems. It all started with apache generating huge logs from
one of the mod_perl applications that is undergoing testing. So the
/var partition was getting full.

We removed all logs that were causing the problem, but even though du
shows some 700 Mb of usage, df shows that the disk is full (-1.5 Gb):

[fer...@omega ~] sudo du -hc -d1 /var/
Password:
2.0K/var/.snap
423M/var/account
6.0K/var/at
2.0K/var/audit
 18K/var/backups
4.0K/var/crash
6.0K/var/cron
 53M/var/db
2.0K/var/empty
2.0K/var/heimdal
219M/var/log
 14M/var/mail
4.0K/var/msgs
 48K/var/named
2.0K/var/preserve
 44K/var/run
2.0K/var/rwho
 16K/var/spool
 76K/var/tmp
 24K/var/yp
2.0K/var/games
710M/var/
710Mtotal

[fer...@omega ~] df -h
FilesystemSizeUsed   Avail Capacity  Mounted on
/dev/mirror/gm0s1f 18G 18G   -1.5G   109%/var

I've been googling around, and I understand why df and du might be
reporting disk usage differently. However, I can't solve this issue
and reclaim unused disk space ... applications (apache, mod_perl) are
prevented to write to /var and this is causing us problems.

We've already tried rebooting the box, restarting the syslog,
newsyslog daemons, to no avail. df keeps showing >100% disk usage
(-1.5 Gb of remaining disk space) in all cases. We've even rebooted
the box with all apache instances turned off in rc.conf ... i.e.
without any but the most basic services running (sshd) ...

This box is essentially a web server, no other services are being run.

Any suggestions as to what to try next?

Thanks in advance,

-- 
fernan
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: df -k vs. du -s

2009-08-13 Thread Jerry McAllister
On Thu, Aug 13, 2009 at 01:37:00PM -0700, Don O'Neil wrote:

> My /var partition is showing a different value for a df -k on the file
> system vs a du -s on the file system:
> 
> df -k
> Filesystem1K-blocks  Used Avail Capacity  Mounted on
> /dev/ad0s1a 202603088954497440448%/
> devfs 1 1 0   100%/dev
> /dev/ad0s1e 2026030   964   1862984 0%/tmp
> /dev/ad0s1d 8122126   1997988   547436827%/usr
> /dev/ad0s1f 8122126   5301938   217041871%/var
> 
> du -s /var
> 993261  /var
> 
> Any ideas why I would see this? Where is the other 4+G? Do I have a bunch of
> bad sectors in the file system or is it majorly fragmented? If so, how do I
> find out what the problem is?
> 
> The other partitions match between the df and du... I'm running 6.1 if that
> makes a difference.

Makes no difference.
This has been answered so many times on this list that people may
not respond at all.  It should easily be found by searching the
archive and I think there is a FAQ on the FreeBSD web site about it.

So, have fun searching.

jerry


> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: df -k vs. du -s

2009-08-13 Thread Mel Flynn
On Thursday 13 August 2009 12:37:00 Don O'Neil wrote:
> My /var partition is showing a different value for a df -k on the file
> system vs a du -s on the file system:

FAQ. Search = good(tm).
http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/disks.html#DU-VS-DF
-- 
Mel
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


df -k vs. du -s

2009-08-13 Thread Don O'Neil
My /var partition is showing a different value for a df -k on the file
system vs a du -s on the file system:

df -k
Filesystem1K-blocks  Used Avail Capacity  Mounted on
/dev/ad0s1a 202603088954497440448%/
devfs 1 1 0   100%/dev
/dev/ad0s1e 2026030   964   1862984 0%/tmp
/dev/ad0s1d 8122126   1997988   547436827%/usr
/dev/ad0s1f 8122126   5301938   217041871%/var

du -s /var
993261  /var

Any ideas why I would see this? Where is the other 4+G? Do I have a bunch of
bad sectors in the file system or is it majorly fragmented? If so, how do I
find out what the problem is?

The other partitions match between the df and du... I'm running 6.1 if that
makes a difference.


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: differences of disk usage between du and quota binaries

2009-02-07 Thread Nicolas Letellier
On Fri, 6 Feb 2009 20:12:56 +
RW  wrote:

> On Fri, 6 Feb 2009 20:13:17 +0100
> Nicolas Letellier  wrote:
> 
> > Hello.
> > 
> > I use FreeBSD 6.3. I set quota to my fs.
> > But, when I print disk usage with du -sh, I have:
> > 
> >..
> > 
> > Why this difference? (633M against 648264)
> >
> 
> Try dividing 648264 by 1024.

Ok.

Thanks a lot for your response.

Regards.

-- 
 -Nicolas.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: differences of disk usage between du and quota binaries

2009-02-06 Thread RW
On Fri, 6 Feb 2009 20:13:17 +0100
Nicolas Letellier  wrote:

> Hello.
> 
> I use FreeBSD 6.3. I set quota to my fs.
> But, when I print disk usage with du -sh, I have:
> 
>..
> 
> Why this difference? (633M against 648264)
>

Try dividing 648264 by 1024.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: differences of disk usage between du and quota binaries

2009-02-06 Thread Glen Barber
On Fri, Feb 6, 2009 at 2:33 PM, Glen Barber  wrote:
> On Fri, Feb 6, 2009 at 2:13 PM, Nicolas Letellier  
> wrote:
>> Hello.
>>
>> I use FreeBSD 6.3. I set quota to my fs.
>> But, when I print disk usage with du -sh, I have:
>>
>> r...@domain sites $  du -sh folder
>> 633Mfolder
>>
>> But, when I print disk usage with quota -u user, I have:
>>
>> isk quotas for user user (uid 2002):
>> Filesystem   usage   quota   limit   grace   files   quota   limit   
>> grace
>>   /var  648264  70  702963   0   0
>>
>>
>> Why this difference? (633M against 648264)
>>
>
> Because 633Mb is 648264 (roughly) bytes.  (648264 / 1024)
>
> Regards,
>
Well, I never really answered the 'why' part of your question -- the
'-h' flag prints 'human readable' output -- ie, in MB instead of
bytes.

-- 
Glen Barber
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: differences of disk usage between du and quota binaries

2009-02-06 Thread Glen Barber
On Fri, Feb 6, 2009 at 2:13 PM, Nicolas Letellier  wrote:
> Hello.
>
> I use FreeBSD 6.3. I set quota to my fs.
> But, when I print disk usage with du -sh, I have:
>
> r...@domain sites $  du -sh folder
> 633Mfolder
>
> But, when I print disk usage with quota -u user, I have:
>
> isk quotas for user user (uid 2002):
> Filesystem   usage   quota   limit   grace   files   quota   limit   grace
>   /var  648264  70  702963   0   0
>
>
> Why this difference? (633M against 648264)
>

Because 633Mb is 648264 (roughly) bytes.  (648264 / 1024)

Regards,

-- 
Glen Barber
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


differences of disk usage between du and quota binaries

2009-02-06 Thread Nicolas Letellier
Hello.

I use FreeBSD 6.3. I set quota to my fs.
But, when I print disk usage with du -sh, I have:

r...@domain sites $  du -sh folder
633Mfolder

But, when I print disk usage with quota -u user, I have:

isk quotas for user user (uid 2002):
 Filesystem   usage   quota   limit   grace   files   quota   limit   grace
   /var  648264  70  702963   0   0


Why this difference? (633M against 648264)

Regards,

-- 
 -Nicolas.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: df & du showing different usages for /var

2008-02-06 Thread Wojciech Puchar
clean things up and ensure that it didn't happen again. Using the "du" 
command to look for offending directories and files, I wiped out a bunch of 
old Apache and Qmail logs...and then found that I was still using 90% of the


you forgot to restart apache and qmail.
and they keep these logs open.

in unix you may delete open file, but it will be actually deleted when 
closed.

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


Re: df & du showing different usages for /var

2008-02-06 Thread Wojciech Puchar


These wildly different results have me confused. How in the world can there 
be a ~1.2GB difference between the disk space in use as reported by these two 
tools? Which is right? More importantly, how do I fix this?


1) there is 1.2GB files open but deleted
2) there are snapshots


i don't know other explanation
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: df & du showing different usages for /var

2008-02-06 Thread alex

After nearly running out of space on my /var partition recently, I went
in to clean things up and ensure that it didn't happen again. Using the
"du" command to look for offending directories and files, I wiped out a
bunch of old Apache and Qmail logs...and then found that I was still
using 90% of the partition. So I cd'd over to /var, and got this rather
surprising set of results:

[EMAIL PROTECTED] /var]$ sudo du -sh
395M.
[EMAIL PROTECTED] /var]$ df -h
Filesystem SizeUsed   Avail Capacity  Mounted on
/dev/ad4s1a484M126M320M28%/
devfs  1.0K1.0K  0B   100%/dev
/dev/ad4s1f269G 40G207G16%/data
/dev/ad4s1d9.7G7.2G1.7G81%/usr
/dev/ad4s1e1.9G1.6G173M90%/var

These wildly different results have me confused. How in the world can
there be a ~1.2GB difference between the disk space in use as reported
by these two tools?


Because they calculate the space differently.


Which is right?


They're both right ... in the manner that they calculate it.


More importantly, how do I fix this?


Well, this depends on your definition of "fix".

If you mean fix du and dh, there's nothing to fix, they're doing their
job exactly correctly.  du calculates the used space by looking at each
file in each directory.  df calculates it by looking at low-level ffs
data.

If you have one program with a file open, and delete that file with
another program, you create a discrepancy between how df and du operate.
Since there is no longer a directory entry, du doesn't count the space,
but since the other program still has the file open, the filesystem still
has the space allocated and used, so df sees the space.  This is the
correct behaviour.

If you mean, how do I actually free up space, the answer could come in
a number of ways.  Generally, the easiest thing to do is just reboot the
system.  Whatever program has space reserved will exit and the filesystem
will reclaim it.  (If the space doesn't free up after a reboot, something
else is wrong)

If a reboot isn't an option, you can often figure out what's going on
by comparing the list of open files provided by fstat with a list of
files that you were deleting.  You might then be able to free up the
space simply by restarting a single program: possibly Apache or qmail.


Thanks for such a thorough and prompt response. Given Erik's reply, it 
looks like I've inadverdently asked an FAQ...and reading the entry he 
pointed me to, it makes perfect sense what's going on, and a simple 
restart of Apache fixed things up.


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


Re: df & du showing different usages for /var

2008-02-06 Thread Bill Moran
In response to [EMAIL PROTECTED]:

> After nearly running out of space on my /var partition recently, I went 
> in to clean things up and ensure that it didn't happen again. Using the 
> "du" command to look for offending directories and files, I wiped out a 
> bunch of old Apache and Qmail logs...and then found that I was still 
> using 90% of the partition. So I cd'd over to /var, and got this rather 
> surprising set of results:
> 
> [EMAIL PROTECTED] /var]$ sudo du -sh
> 395M.
> [EMAIL PROTECTED] /var]$ df -h
> Filesystem SizeUsed   Avail Capacity  Mounted on
> /dev/ad4s1a484M126M320M28%/
> devfs  1.0K1.0K  0B   100%/dev
> /dev/ad4s1f269G 40G207G16%/data
> /dev/ad4s1d9.7G7.2G1.7G81%/usr
> /dev/ad4s1e1.9G1.6G173M90%/var
> 
> These wildly different results have me confused. How in the world can 
> there be a ~1.2GB difference between the disk space in use as reported 
> by these two tools?

Because they calculate the space differently.

> Which is right?

They're both right ... in the manner that they calculate it.

> More importantly, how do I fix this?

Well, this depends on your definition of "fix".

If you mean fix du and dh, there's nothing to fix, they're doing their
job exactly correctly.  du calculates the used space by looking at each
file in each directory.  df calculates it by looking at low-level ffs
data.

If you have one program with a file open, and delete that file with
another program, you create a discrepancy between how df and du operate.
Since there is no longer a directory entry, du doesn't count the space,
but since the other program still has the file open, the filesystem still
has the space allocated and used, so df sees the space.  This is the
correct behaviour.

If you mean, how do I actually free up space, the answer could come in
a number of ways.  Generally, the easiest thing to do is just reboot the
system.  Whatever program has space reserved will exit and the filesystem
will reclaim it.  (If the space doesn't free up after a reboot, something
else is wrong)

If a reboot isn't an option, you can often figure out what's going on
by comparing the list of open files provided by fstat with a list of
files that you were deleting.  You might then be able to free up the
space simply by restarting a single program: possibly Apache or qmail.

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


Re: df & du showing different usages for /var

2008-02-06 Thread Erik Trulsson
On Wed, Feb 06, 2008 at 02:28:43PM -0500, [EMAIL PROTECTED] wrote:
> After nearly running out of space on my /var partition recently, I went in 
> to clean things up and ensure that it didn't happen again. Using the "du" 
> command to look for offending directories and files, I wiped out a bunch of 
> old Apache and Qmail logs...and then found that I was still using 90% of 
> the partition. So I cd'd over to /var, and got this rather surprising set 
> of results:
> 
> [EMAIL PROTECTED] /var]$ sudo du -sh
> 395M.
> [EMAIL PROTECTED] /var]$ df -h
> Filesystem SizeUsed   Avail Capacity  Mounted on
> /dev/ad4s1a484M126M320M28%/
> devfs  1.0K1.0K  0B   100%/dev
> /dev/ad4s1f269G 40G207G16%/data
> /dev/ad4s1d9.7G7.2G1.7G81%/usr
> /dev/ad4s1e1.9G1.6G173M90%/var
> 
> These wildly different results have me confused. How in the world can there 
> be a ~1.2GB difference between the disk space in use as reported by these 
> two tools? Which is right? More importantly, how do I fix this?


http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/disks.html#DU-VS-DF





-- 

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


df & du showing different usages for /var

2008-02-06 Thread alex
After nearly running out of space on my /var partition recently, I went 
in to clean things up and ensure that it didn't happen again. Using the 
"du" command to look for offending directories and files, I wiped out a 
bunch of old Apache and Qmail logs...and then found that I was still 
using 90% of the partition. So I cd'd over to /var, and got this rather 
surprising set of results:


[EMAIL PROTECTED] /var]$ sudo du -sh
395M.
[EMAIL PROTECTED] /var]$ df -h
Filesystem SizeUsed   Avail Capacity  Mounted on
/dev/ad4s1a484M126M320M28%/
devfs  1.0K1.0K  0B   100%/dev
/dev/ad4s1f269G 40G207G16%/data
/dev/ad4s1d9.7G7.2G1.7G81%/usr
/dev/ad4s1e1.9G1.6G173M90%/var

These wildly different results have me confused. How in the world can 
there be a ~1.2GB difference between the disk space in use as reported 
by these two tools? Which is right? More importantly, how do I fix this?


Thanks,
Alex Kirk

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


Re: Fast du

2006-05-17 Thread cpghost
On Thu, May 18, 2006 at 01:37:47AM +0200, Albert Shih wrote:
>  Le 17/05/2006 ? 18:17:54-0400, Charles Swiger a ?crit
> > On May 17, 2006, at 5:35 PM, Albert Shih wrote:
> > >I search some technics/command/anything can make very fast ?du?  
> > >especialy
> > >when in the file system there are lot of lot of hard-link.

I know no solution to this... just a few random thoughts:

If you didn't have subdirs and hard links, you could cache the
results of slow-du somewhere, and look up the results there,
updating the cache only if directory m_time(s) changed. Let

du-cache := { (dir-ino, (du-value, timestamp)) |
  dir-ino is directory inode number [key of cache],
  du-value is disk usage of dir-ino,
  taken at timestamp }

But with subdirs, you need to take care of recursion; and that
makes bookkeeping the du-cache somewhat more complicated.

With hard-links, esp. across directories; you need an additional
hard-link cache; and AFAICS there's no way to have that automatically
updated, when a hard-linked file changes size elsewhere...

...unless you decide to add some hooks to VFS(9). But if you go this
route, you could as well hook up the entire fast-du bookkeeping at
VFS level, but that's most likely a major undertaking (if you
do, remember quota(1)).

If you don't need absolute accuracy 100% of the time, you could
build a du-cache once every few days or so, just like locate(1)'s
database; and use directory timestamps to incrementally update it,
so it would only take a lot of time the first time to build, and
hopefully relatively less time subsequently (depending on usage
pattern, of course).

> Albert SHIH
> Universite de Paris 7 (Denis DIDEROT)
> U.F.R. de Mathematiques.
> 7 i?me ?tage, plateau D, bureau 10

-cpghost.

-- 
Cordula's Web. http://www.cordula.ws/
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Fast du

2006-05-17 Thread Albert Shih
 Le 17/05/2006 à 18:17:54-0400, Charles Swiger a écrit
> On May 17, 2006, at 5:35 PM, Albert Shih wrote:
> >I search some technics/command/anything can make very fast «du»  
> >especialy
> >when in the file system there are lot of lot of hard-link.
> 
> Set up a swap-based RAM disk and run your du commands against files  
> on that...?

What ? I don't understand. I must do many time a «du» on a 2 To
filesystem... I think it's pretty hard to do that on ram. 
> 
> Otherwise, if you have to do the work against stuff on a hard drive,  
> try to do single-threaded I/O while doing these du's to avoid  
> thrashing the drive heads around more than needed.

OK...and how can I do that ? Maybe some documentation ?

Lots of thanks.

Regards.
--
Albert SHIH
Universite de Paris 7 (Denis DIDEROT)
U.F.R. de Mathematiques.
7 ième étage, plateau D, bureau 10
Heure local/Local time:
Thu May 18 01:36:02 CEST 2006
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Fast du

2006-05-17 Thread Charles Swiger

On May 17, 2006, at 5:35 PM, Albert Shih wrote:
I search some technics/command/anything can make very fast «du»  
especialy

when in the file system there are lot of lot of hard-link.


Set up a swap-based RAM disk and run your du commands against files  
on that...?


Otherwise, if you have to do the work against stuff on a hard drive,  
try to do single-threaded I/O while doing these du's to avoid  
thrashing the drive heads around more than needed.


--
-Chuck

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


Fast du

2006-05-17 Thread Albert Shih
Hi all

I search some technics/command/anything can make very fast «du» especialy
when in the file system there are lot of lot of hard-link.

Regards.


--
Albert SHIH
Universite de Paris 7 (Denis DIDEROT)
U.F.R. de Mathematiques.
7 ième étage, plateau D, bureau 10
Heure local/Local time:
Wed May 17 23:33:51 CEST 2006
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: `du -h` not printing out the filesystems?

2005-08-30 Thread Dan Nelson
In the last episode (Aug 30), Robert G. said:
> chkn# du -h
>  12K.
> chkn#
> 
> Anyone know what that is?  This is a brand new FreeBSD 5.4 install.

Did you mean to run df maybe?

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


Re: `du -h` not printing out the filesystems?

2005-08-30 Thread Glenn Dawson

At 08:43 PM 8/30/2005, Robert G. wrote:

chkn# du -h
 12K.
chkn#

Anyone know what that is?  This is a brand new FreeBSD 5.4 install.


A bit of a guess, but it looks like you're running du in a dir that 
has no subdirs.


-Glenn



Thanks

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


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


`du -h` not printing out the filesystems?

2005-08-30 Thread Robert G.

chkn# du -h
 12K.
chkn#

Anyone know what that is?  This is a brand new FreeBSD 5.4 install.

Thanks

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


Re: Soft-updates & du & df

2005-07-14 Thread Ivailo Tanusheff
Hilco Wijbenga <[EMAIL PROTECTED]> 
Sent by: [EMAIL PROTECTED]
07/14/2005 12:01 AM

To
freebsd-questions@freebsd.org
cc

Subject
Soft-updates & du & df






Hi,

I've taken over the administration of a FreeBSD box and now I've run
into a problem that I could not solve by means of Google or the FreeBSD
mailinglist archives. I am quite familiar with (Gentoo) GNU/Linux but a
complete newbie when it comes to FreeBSD.

While I was doing some work I got an error about a device being full. As
it turned out /var was completely full. Not a big problem because there
were a few very big log files that I could throw away. Problem solved?
Apparently not because

[EMAIL PROTECTED] df -h /var
Filesystem SizeUsed   Avail Capacity  Mounted on
/dev/ad2s1d248M246M-18M   108%/var

even though

[EMAIL PROTECTED] du -hs /var
 43M/var

Shouldn't du and df roughly agree on the amount that's used/available?

/var is mounted using soft-updates

[EMAIL PROTECTED] mount
/dev/ad2s1a on / (ufs, local)
devfs on /dev (devfs, local, multilabel)
/dev/ad2s1e on /tmp (ufs, local, soft-updates)
/dev/ad2s1f on /usr (ufs, local, soft-updates)
/dev/ad2s1d on /var (ufs, local, soft-updates)
/dev/gvinum/raid on /raid (ufs, local, soft-updates)

According to what I found using Google regarding soft-updates this means
that my changes are not written to disk immediately? Does that have
anything to do with this?

It looks like I didn't really solve the problem because if I try to copy
a fairly big file (say 2MB) to the /var/log directory I get another 'No
space left on device' even though there should now be about 200MB
available. I can create small files though.

How do I get du and df to agree again? Or do I have a different problem?
Please let me know if I left out any important information.

Bye,
Hilco

___


You can force the updates to be written to the disk using sync (8) for the 
whole system or fsync on a specific files. Or you can just wait a while so 
the updates are written to thr disk.

Ivailo Tanusheff


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


Re: Soft-updates & du & df

2005-07-13 Thread Glenn Dawson

At 02:01 PM 7/13/2005, Hilco Wijbenga wrote:

Hi,

I've taken over the administration of a FreeBSD box and now I've run
into a problem that I could not solve by means of Google or the FreeBSD
mailinglist archives. I am quite familiar with (Gentoo) GNU/Linux but a
complete newbie when it comes to FreeBSD.

While I was doing some work I got an error about a device being full. As
it turned out /var was completely full. Not a big problem because there
were a few very big log files that I could throw away. Problem solved?
Apparently not because

[EMAIL PROTECTED] df -h /var
Filesystem SizeUsed   Avail Capacity  Mounted on
/dev/ad2s1d248M246M-18M   108%/var

even though

[EMAIL PROTECTED] du -hs /var
 43M/var


The discrepancy between du and df usually happens when a log file is 
deleted out from under syslogd.  (or something similar)  When that is done, 
syslogd still has the file opened and will still be writing to that file at 
the same offset it was before the file was deleted.  To fix it, just stop 
and restart syslogd and you should see all of the free space you are 
expecting.  (It could be something else, but when that happens in /var it's 
usually syslogd)


-Glenn



Shouldn't du and df roughly agree on the amount that's used/available?

/var is mounted using soft-updates

[EMAIL PROTECTED] mount
/dev/ad2s1a on / (ufs, local)
devfs on /dev (devfs, local, multilabel)
/dev/ad2s1e on /tmp (ufs, local, soft-updates)
/dev/ad2s1f on /usr (ufs, local, soft-updates)
/dev/ad2s1d on /var (ufs, local, soft-updates)
/dev/gvinum/raid on /raid (ufs, local, soft-updates)

According to what I found using Google regarding soft-updates this means
that my changes are not written to disk immediately? Does that have
anything to do with this?

It looks like I didn't really solve the problem because if I try to copy
a fairly big file (say 2MB) to the /var/log directory I get another 'No
space left on device' even though there should now be about 200MB
available. I can create small files though.

How do I get du and df to agree again? Or do I have a different problem?
Please let me know if I left out any important information.

Bye,
Hilco

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


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


Re: Soft-updates & du & df

2005-07-13 Thread Hilco Wijbenga
On Wed, 2005-07-13 at 16:12 -0500, Dan Nelson wrote:
> You probably have some deleted logfiles that are still held open by
> processes.  Run "lsof +L1 -a /var" to list the files and the processes
> (you may need to install lsof from ports).  Kill and restart the
> offending processes and your freespace should go back to normal.

Restarted apache and now all is well. Sorry for polluting your packet
stream, as Kris already indicated this was all in the FAQ. And I thought
I'd done my homework...

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


Re: Soft-updates & du & df

2005-07-13 Thread Dan Nelson
In the last episode (Jul 13), Hilco Wijbenga said:
> I've taken over the administration of a FreeBSD box and now I've run
> into a problem that I could not solve by means of Google or the
> FreeBSD mailinglist archives. I am quite familiar with (Gentoo)
> GNU/Linux but a complete newbie when it comes to FreeBSD.
> 
> While I was doing some work I got an error about a device being full.
> As it turned out /var was completely full. Not a big problem because
> there were a few very big log files that I could throw away. Problem
> solved? Apparently not because
> 
> [EMAIL PROTECTED] df -h /var
> Filesystem SizeUsed   Avail Capacity  Mounted on
> /dev/ad2s1d248M246M-18M   108%    /var
> 
> even though
> 
> [EMAIL PROTECTED] du -hs /var
>  43M/var
> 
> Shouldn't du and df roughly agree on the amount that's used/available?

You probably have some deleted logfiles that are still held open by
processes.  Run "lsof +L1 -a /var" to list the files and the processes
(you may need to install lsof from ports).  Kill and restart the
offending processes and your freespace should go back to normal.

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


Re: Soft-updates & du & df

2005-07-13 Thread Kris Kennaway
On Wed, Jul 13, 2005 at 02:01:27PM -0700, Hilco Wijbenga wrote:

> Shouldn't du and df roughly agree on the amount that's used/available?

Please consult the FAQ.

Kris


pgpAeaIlyXp8L.pgp
Description: PGP signature


Soft-updates & du & df

2005-07-13 Thread Hilco Wijbenga
Hi,

I've taken over the administration of a FreeBSD box and now I've run
into a problem that I could not solve by means of Google or the FreeBSD
mailinglist archives. I am quite familiar with (Gentoo) GNU/Linux but a
complete newbie when it comes to FreeBSD.

While I was doing some work I got an error about a device being full. As
it turned out /var was completely full. Not a big problem because there
were a few very big log files that I could throw away. Problem solved?
Apparently not because

[EMAIL PROTECTED] df -h /var
Filesystem SizeUsed   Avail Capacity  Mounted on
/dev/ad2s1d248M246M-18M   108%/var

even though

[EMAIL PROTECTED] du -hs /var
 43M/var

Shouldn't du and df roughly agree on the amount that's used/available?

/var is mounted using soft-updates

[EMAIL PROTECTED] mount
/dev/ad2s1a on / (ufs, local)
devfs on /dev (devfs, local, multilabel)
/dev/ad2s1e on /tmp (ufs, local, soft-updates)
/dev/ad2s1f on /usr (ufs, local, soft-updates)
/dev/ad2s1d on /var (ufs, local, soft-updates)
/dev/gvinum/raid on /raid (ufs, local, soft-updates)

According to what I found using Google regarding soft-updates this means
that my changes are not written to disk immediately? Does that have
anything to do with this?

It looks like I didn't really solve the problem because if I try to copy
a fairly big file (say 2MB) to the /var/log directory I get another 'No
space left on device' even though there should now be about 200MB
available. I can create small files though.

How do I get du and df to agree again? Or do I have a different problem?
Please let me know if I left out any important information.

Bye,
Hilco

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


Re: du -k VS ls -l (what I'm missing?)

2004-07-01 Thread Matthew Seaman
On Fri, Jul 02, 2004 at 01:04:32AM +0400, Alex K wrote:

> what do I miss here?
> sum of individual file sizes is much more than "total" in ls and more than du -k 
> reports
> 
> bash-2.05b$ ls -l
> total 354112
> -rw-r--r--  1 lesha  wheel   98490960  1 ??? 12:29 88479E51B1D77190A2A8C882
> -rw-r--r--  1 lesha  wheel  299376716 25 ??? 15:20 F44AA5CA2D90F33EE0F1
> -rw-r--r--  1 lesha  wheel  540729348  1 ??? 19:01 0C859D601337F1D26D68BA90
> -rw-r--r--  1 lesha  wheel  125204414 30 ??? 18:12 50922168AB8D4CB73FA39063
> -rw-r--r--  1 lesha  wheel  365164364  1 ??? 12:06 CBB789334BF480B9ED153EA8
> -rw-r--r--  1 lesha  wheel  209031053 30 ??? 19:05 B2AFAA6C8C68575BA97476F4
> -rw-r--r--  1 lesha  wheel  336457988 29 ??? 17:43 200DCA96AFFAF2FB08E3E279
> -rw-r--r--  1 lesha  wheel   40714776  1 ??? 18:16 6E30F671D9F305458A093617
> -rw-r--r--  1 lesha  wheel  209945132 25 ??? 15:29 A515D96BFAD85C294D4A9BB7
> -rw-r--r--  1 lesha  wheel  114632620  1 ??? 18:25 7868FE483F37D653109E67B3
> -rw-r--r--  1 lesha  wheel  242241614  1 ??? 19:02 75B7DC03642E00CE564C1FF6
> -rw-r--r--  1 lesha  wheel   42681134 25 ??? 15:29 F9C3246915327E44B9B0FD2C
> -rw-r--r--  1 lesha  wheel  165569384 30 ??? 18:54 4FCA6EC8E3AB33B33E3E5011
> bash-2.05b$ du -k
> 354114  .
> bash-2.05b$

The 'total' figure from ls(1) and the number shown by du(1) is the
total disk usage in blocks of 1024 bytes (if BLOCKSIZE=k is set in
your environment, which is the default) -- in this case, about a
factor of 7 smaller than the total of the file sizes.

Files can have 'holes' -- parts of the file that have never been
written to, although later parts of the file have.  Disk blocks are
not allocated for those unwritten areas.  If you use hexdump(1) on the
file, the holes will show up as a sequence of null bytes.

The way to tell if a file is holey is to compare the size of the file
against the number of blocks allocated for it using:

% stat -f "%10z %6b %N" *

[ or

% ls -ls *

where the 1st column is the number of blocks, the 6th is the filesize
in bytes]

If the filesize is significantly greater than the number of blocks
multiplied by the block size (stat(1) shows 512 byte blocks, ls(1)
shows 1024 byte blocks) then those files have holes in them.  It's
quite common to see this, for example, in files that are the backing
stores for databases.

Having holey files is not a problem, although some broken backup
software will tend to fill in all of the gaps with zeros, meaning that
occasionally you can't restore a file back onto the same partition it
was backed up from.  You can quite easily have a file whose apparent
size is larger than the partition holding it.

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.   26 The Paddocks
  Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey Marlow
Tel: +44 1628 476614  Bucks., SL7 1TH UK


pgpJZHzOMARMS.pgp
Description: PGP signature


du -k VS ls -l (what I'm missing?)

2004-07-01 Thread Alex K

Hello, all!

(sorry for not wraping text, it messes up)


what do I miss here?
sum of individual file sizes is much more than "total" in ls and more than du -k 
reports

bash-2.05b$ ls -l
total 354112
-rw-r--r--  1 lesha  wheel   98490960  1 июл 12:29 88479E51B1D77190A2A8C882
-rw-r--r--  1 lesha  wheel  299376716 25 июн 15:20 F44AA5CA2D90F33EE0F1
-rw-r--r--  1 lesha  wheel  540729348  1 июл 19:01 0C859D601337F1D26D68BA90
-rw-r--r--  1 lesha  wheel  125204414 30 июн 18:12 50922168AB8D4CB73FA39063
-rw-r--r--  1 lesha  wheel  365164364  1 июл 12:06 CBB789334BF480B9ED153EA8
-rw-r--r--  1 lesha  wheel  209031053 30 июн 19:05 B2AFAA6C8C68575BA97476F4
-rw-r--r--  1 lesha  wheel  336457988 29 июн 17:43 200DCA96AFFAF2FB08E3E279
-rw-r--r--  1 lesha  wheel   40714776  1 июл 18:16 6E30F671D9F305458A093617
-rw-r--r--  1 lesha  wheel  209945132 25 июн 15:29 A515D96BFAD85C294D4A9BB7
-rw-r--r--  1 lesha  wheel  114632620  1 июл 18:25 7868FE483F37D653109E67B3
-rw-r--r--  1 lesha  wheel  242241614  1 июл 19:02 75B7DC03642E00CE564C1FF6
-rw-r--r--  1 lesha  wheel   42681134 25 июн 15:29 F9C3246915327E44B9B0FD2C
-rw-r--r--  1 lesha  wheel  165569384 30 июн 18:54 4FCA6EC8E3AB33B33E3E5011
bash-2.05b$ du -k
354114  .
bash-2.05b$

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


Re: Disk full / NFS, df, and du

2004-05-17 Thread Jerry McAllister
> 
> Jerry McAllister wrote:
> 
> >>Nelis Lamprecht wrote:
> >>
> >>>On Mon, 2004-05-17 at 05:04, Eric Anderson wrote:
> >>>
> >>>>The problem I'm having is, after they do the rm's, it doesn't free the 
> >>>>disk space.  df shows it still being used, but du claims their 
> >>>>directories are empty. 
> >>>>   
> >>>Please see 
> >>>
> >>>http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/disks.html#DU-VS-DF
> >>>
> >>>..regarding this. Maybe a kill -HUP nfsd might help ?
> >>>
> >>Actually, no.  In fact, I just did a quick test, with a 500mb file, and 
> >>as root, I deleted the 500mb, and my df doesn't report the newly freed 
> >>space - I did this locally, with no NFS in the mix..  I have softupdates 
> >>turned on, and quotas turned on (although I just recently turned on the 
> >>quotas after having this problem, so that isn't causing problems).. 
> >
> >How long after the rm did you do the df?   I have noticed that there
> >is a time delay before df reports the updated disk statistics - in the 
> >range of a minute or two.  I think I read about it in a FAQ somewhere, 
> >so, maybe the reference someone else posted will shed some light.
> >
> This particular time I waited a few minutes, but I have waited 1.5 days 
> for the other data to disappear.  I end up rebooting the server, which 
> ends up fsck'ing the disk with lots of unreferenced inodes or some such 
> thing.. I get my space back, but a reboot is needed.. not good.

OK.  It is well beyond that possibility then.   Someone suggested a
disk-full bug in softupdates.   Maybe there is.   I haven't over filled 
a partition on soft-updates yet so, haven't been there.

Good luck,

jerry

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


Re: Disk full / NFS, df, and du

2004-05-17 Thread Dan Nelson
In the last episode (May 17), Eric Anderson said:
> Dan Nelson wrote:
> >In the last episode (May 16), Eric Anderson said:
> >>I have a few large NFS file servers, holding about 1Tb of diskspace
> >>each.  I break those logical disks (it's on a hardware RAID) into
> >>partitions, and share them.  My users fill up the partitions often
> >>enough, and when they do, they rm entire directory trees to free
> >>the space.  They use du to determine how much space is in a
> >>directory and how much they are hogging.
> >>
> >>The problem I'm having is, after they do the rm's, it doesn't free
> >>the disk space.  df shows it still being used, but du claims their
> >>directories are empty.
> >>
> >>If I reboot the file server, the space magically appears.
> >
> >Does a du on server itself show files?  How about "lsof +L1"?  The
> >NFS protocol doesn't allow clients to unlink files they have open,
> >so FreeBSD clients (at least) rename open files that are unlinked to
> >.nfs# until the last process closes the file, and then they delete
> >it.  If you've got unlinked files held open, it's got to be on the
> >server itself.
> 
> lsof +L1 shows nothing.. any more ideas?

Actually now that I think about it I have seen similar symptoms on my
4.8 servers where a volume would fill up but no amount of deleting
would help until a reboot.  It happens very infrequently (maybe twice a
year), and I assume it's due to a filesystem-full bug in the
softupdates code since on 4.x free space isn't really free until
softupdates has flushed its updates to disk, and that could take a
while.  Try dropping the kern.{file,dir,meta}delay sysctls down to like
{7,6,5} seconds and see if that does anything for you.

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


Re: Disk full / NFS, df, and du

2004-05-17 Thread Eric Anderson
Jerry McAllister wrote:
Nelis Lamprecht wrote:
   

On Mon, 2004-05-17 at 05:04, Eric Anderson wrote:

 

The problem I'm having is, after they do the rm's, it doesn't free the 
disk space.  df shows it still being used, but du claims their 
directories are empty. 
  

   

Please see 

http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/disks.html#DU-VS-DF
..regarding this. Maybe a kill -HUP nfsd might help ?
 

Actually, no.  In fact, I just did a quick test, with a 500mb file, and 
as root, I deleted the 500mb, and my df doesn't report the newly freed 
space - I did this locally, with no NFS in the mix..  I have softupdates 
turned on, and quotas turned on (although I just recently turned on the 
quotas after having this problem, so that isn't causing problems).. 
   

How long after the rm did you do the df?   I have noticed that there
is a time delay before df reports the updated disk statistics - in the 
range of a minute or two.  I think I read about it in a FAQ somewhere, 
so, maybe the reference someone else posted will shed some light.
 

This particular time I waited a few minutes, but I have waited 1.5 days 
for the other data to disappear.  I end up rebooting the server, which 
ends up fsck'ing the disk with lots of unreferenced inodes or some such 
thing.. I get my space back, but a reboot is needed.. not good.

Eric
--
--
Eric Anderson Sr. Systems AdministratorCentaur Technology
Today is the tomorrow you worried about yesterday.
--
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Disk full / NFS, df, and du

2004-05-17 Thread Jerry McAllister
> 
> Nelis Lamprecht wrote:
> 
> >On Mon, 2004-05-17 at 05:04, Eric Anderson wrote:
> >
> >  
> >
> >>The problem I'm having is, after they do the rm's, it doesn't free the 
> >>disk space.  df shows it still being used, but du claims their 
> >>directories are empty. 
> >>
> >>
> >
> >Please see 
> >
> >http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/disks.html#DU-VS-DF
> >
> >..regarding this. Maybe a kill -HUP nfsd might help ?
> >  
> >
> Actually, no.  In fact, I just did a quick test, with a 500mb file, and 
> as root, I deleted the 500mb, and my df doesn't report the newly freed 
> space - I did this locally, with no NFS in the mix..  I have softupdates 
> turned on, and quotas turned on (although I just recently turned on the 
> quotas after having this problem, so that isn't causing problems).. 

How long after the rm did you do the df?   I have noticed that there
is a time delay before df reports the updated disk statistics - in the 
range of a minute or two.  I think I read about it in a FAQ somewhere, 
so, maybe the reference someone else posted will shed some light.

jerry

> 
> Any ideas anyone?
> 
> Eric
> 
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Disk full / NFS, df, and du

2004-05-17 Thread Eric Anderson
Nelis Lamprecht wrote:
On Mon, 2004-05-17 at 05:04, Eric Anderson wrote:
 

The problem I'm having is, after they do the rm's, it doesn't free the 
disk space.  df shows it still being used, but du claims their 
directories are empty. 
   

Please see 

http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/disks.html#DU-VS-DF
..regarding this. Maybe a kill -HUP nfsd might help ?
 

Actually, no.  In fact, I just did a quick test, with a 500mb file, and 
as root, I deleted the 500mb, and my df doesn't report the newly freed 
space - I did this locally, with no NFS in the mix..  I have softupdates 
turned on, and quotas turned on (although I just recently turned on the 
quotas after having this problem, so that isn't causing problems).. 

Any ideas anyone?
Eric
--
--
Eric Anderson Sr. Systems AdministratorCentaur Technology
Today is the tomorrow you worried about yesterday.
--
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Disk full / NFS, df, and du

2004-05-17 Thread Nelis Lamprecht
On Mon, 2004-05-17 at 05:04, Eric Anderson wrote:

> The problem I'm having is, after they do the rm's, it doesn't free the 
> disk space.  df shows it still being used, but du claims their 
> directories are empty. 

Please see 

http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/disks.html#DU-VS-DF

..regarding this. Maybe a kill -HUP nfsd might help ?

Cheers,
-- 
Nelis Lamprecht
PGP: http://www.8ball.co.za/pgpkey/nelis.asc
"Unix IS user friendly.. It's just selective about who its friends are."


signature.asc
Description: This is a digitally signed message part


Re: Disk full / NFS, df, and du

2004-05-17 Thread Eric Anderson
Dan Nelson wrote:
In the last episode (May 16), Eric Anderson said:
 

I have a few large NFS file servers, holding about 1Tb of diskspace
each.  I break those logical disks (it's on a hardware RAID) into
partitions, and share them.  My users fill up the partitions often
enough, and when they do, they rm entire directory trees to free the
space.  They use du to determine how much space is in a directory and
how much they are hogging.
The problem I'm having is, after they do the rm's, it doesn't free the 
disk space.  df shows it still being used, but du claims their 
directories are empty. 

If I reboot the file server, the space magically appears.
I was thinking that it was because a process was using the data, or
directories the data was removed from, so the blocks weren't actually
freed, but that seems a little odd to me, since they claim (and
different users have the same issues, and make the same claims) that
nothing should be touching those areas at all.
How do I get FreeBSD to release those blocks without rebooting?
   

Does a du on server itself show files?  How about "lsof +L1"?  The NFS
protocol doesn't allow clients to unlink files they have open, so
FreeBSD clients (at least) rename open files that are unlinked to
.nfs# until the last process closes the file, and then they delete
it.  If you've got unlinked files held open, it's got to be on the
server itself.
 

lsof +L1 shows nothing.. any more ideas?
Eric
--
--
Eric Anderson Sr. Systems AdministratorCentaur Technology
Today is the tomorrow you worried about yesterday.
--
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Disk full / NFS, df, and du

2004-05-16 Thread Eric Anderson
Dan Nelson wrote:
In the last episode (May 16), Eric Anderson said:
 

I have a few large NFS file servers, holding about 1Tb of diskspace
each.  I break those logical disks (it's on a hardware RAID) into
partitions, and share them.  My users fill up the partitions often
enough, and when they do, they rm entire directory trees to free the
space.  They use du to determine how much space is in a directory and
how much they are hogging.
The problem I'm having is, after they do the rm's, it doesn't free the 
disk space.  df shows it still being used, but du claims their 
directories are empty. 

If I reboot the file server, the space magically appears.
I was thinking that it was because a process was using the data, or
directories the data was removed from, so the blocks weren't actually
freed, but that seems a little odd to me, since they claim (and
different users have the same issues, and make the same claims) that
nothing should be touching those areas at all.
How do I get FreeBSD to release those blocks without rebooting?
   

Does a du on server itself show files?  How about "lsof +L1"?  The NFS
protocol doesn't allow clients to unlink files they have open, so
FreeBSD clients (at least) rename open files that are unlinked to
.nfs# until the last process closes the file, and then they delete
it.  If you've got unlinked files held open, it's got to be on the
server itself.
Du on the server shows the same as on the client - only a small amount 
used (36Gb used) whereas a df shows 152Gb used.  I am using solaris and 
linux clients mostly.  This happened on FreeBSD 4.6, and continues on 
this 4.9-RELEASE machine (same partitions, just an upgraded OS).


Eric
--
--
Eric Anderson Sr. Systems AdministratorCentaur Technology
Today is the tomorrow you worried about yesterday.
--
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


  1   2   >