 |
|
 |
|
Next: Bug#540670: goto-fai-progress: FTBFS: dpkg-gencha..
|
| Author |
Message |
External

Since: Feb 02, 2006 Posts: 334
|
(Msg. 16) Posted: Thu Aug 13, 2009 1:20 pm
Post subject: Re: Customized df -h [Login to view extended thread Info.] Archived from groups: alt>os>linux>suse (more info?)
|
|
|
Jan Gerrit Kootstra schreef:
> Kevin Nathan schreef:
>> On Thu, 13 Aug 2009 17:49:24 +0200
>> Jan Gerrit Kootstra <jan.gerrit.TakeThisOut@kootstra.org.uk> wrote:
>>
>>> I do not understand perl, so I am unable to find the error.
>>>
>>> The script is able to find 237GB more total size,
>>> then the total of physical disk space.
>>>
>>
>> Send me the output of:
>>
>> df --portability --print-type --human-readable
>>
>> and I will look into it as soon as I can. That's a pretty serious
>> difference!
>>
>>
> df --portability --print-type --human-readable
> Bestandssysteem Type Grtte Gebr Besch Geb% Aangekoppeld op
> /dev/mapper/VolGroup00-LogVol00 ext3 9,7G 4,3G 5,0G 47% /
> /dev/hda1 ext3 479M 46M 409M 11% /boot
> tmpfs tmpfs 2,9G 0 2,9G 0% /dev/shm
> /dev/mapper/VolGroup00-LogVol01 ext3 4,0G 53M 3,7G 2% /home
> /dev/mapper/VolGroup00-LogVol02 ext3 2,0G 144M 1,7G 8% /tmp
> /dev/mapper/VolGroup00-LogVol03 ext3 61G 21G 37G 37% /usr
> /dev/mapper/VolGroup00-LogVol04 ext3 7,8G 3,1G 4,3G 43% /var
> /dev/mapper/VolGroup00-LogVol05 ext3 1008M 150M 808M 16% /usr/local
> /dev/mapper/VolGroup00-LogVol06 ext3 13G 1,8G 11G 15% /opt
> /dev/mapper/VolGroup00-LogVol07 ext3 15G 11G 3,9G 73% /tools
> /dev/mapper/VolGroup00-LogVol08 ext3 39G 15G 23G 40% /s01
> /dev/mapper/VolGroup00-LogVol09 ext3 473G 263G 210G 56% /project
> /dev/mapper/VolGroup00-LogVol11 ext3 35G 31G 3,1G 91% /var/www
> /dev/mapper/VolGroup00-LogVol12 ext3 3,0G 967M 1,9G 34% /xcdroast
> /dev/mapper/VolGroup00-LogVol13 ext3 1008M 101M 887M 11% /var/cache/yum
> /dev/mapper/VolGroup00-LogVol14 ext3 496M 19M 458M 4% /var/ntop
> /dev/mapper/VolGroup00-LogVol15 ext3 5,5G 343M 5,0G 7% /var/log
>
> I would like to have this 'ghost disk'
>
>
> Regards,
>
>
> Jan Gerrit
Kevin,
Probably a localisation error. I use LANG=nl_NL.UTF-8
If I export LANG=C before running the script all is well.
Kind regards,
Jan Gerrit Kootstra |
|
| Back to top |
|
 |  |
External

Since: Sep 08, 2005 Posts: 188
|
(Msg. 17) Posted: Thu Aug 13, 2009 1:20 pm
Post subject: Re: Customized df -h [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Mon, 10 Aug 2009, David Bolt wrote:-
And now I've spotted a bug with this. The total is wrong when you have
nfs mounted file systems. Replacing these lines:
># Get the sizes and percentage
>SIZE=$(echo "${TMPF}" | egrep '^\/dev|@' |awk '{t2 = t2 + $2}END{print t2}')
>USED=$(echo "${TMPF}" | egrep '^\/dev|@' |awk '{t3 = t3 + $3}END{print t3}')
>AVAI=$(echo "${TMPF}" | egrep '^\/dev|@' |awk '{t4 = t4 + $4}END{print t4}')
with these:
SIZE=$(echo "${TMPF}" | egrep '^\/dev|@|:' |awk '{t2 = t2 + $2}END{print t2}')
USED=$(echo "${TMPF}" | egrep '^\/dev|@|:' |awk '{t3 = t3 + $3}END{print t3}')
AVAI=$(echo "${TMPF}" | egrep '^\/dev|@|:' |awk '{t4 = t4 + $4}END{print t4}')
fixes it for me.
davjam@moray:~/Documents> df-h
Filesystem Size Used Avail Use% Mounted on
donnas.davjam.org:/videos 466G 195G 272G 42% /mounts/donnas/videos
udev 2.0G 540K 2.0G 1% /dev
/dev/loop0 7.7G 7.7G 0 100% /mnt
/dev/mapper/500GB-500_home 410G 134G 277G 33% /home
/dev/mapper/500GB-tmp 9.7G 152M 9.1G 2% /tmp
/dev/mapper/500GB-usr 20G 5.1G 14G 27% /usr
/dev/mapper/500GB-var_log 1.5G 66M 1.4G 5% /var/log
/dev/sda1 160M 16M 137M 11% /boot
/dev/sda5 20G 1.2G 18G 7% /
/dev/sdb1 233G 108G 126G 47% /local/drive-f
/dev/sdc1 96G 62G 35G 64% /local/photographs
/dev/sdc5 96G 23G 74G 24% /local/DVD_temp
/dev/sdc6 95G 37G 53G 41% /local/music
/dev/sdc7 178G 136G 42G 77% /local/ISOs
-------------------------------------------------------------------
All in GB 1630G 705G 918G
All in TB 1.59T .68T .89T 43% @moray x86_64
-------------------------------------------------------------------
Regards,
David Bolt
--
Team Acorn: http://www.distributed.net/ OGR-NG @ ~100Mnodes RC5-72 @ ~1Mkeys/s
openSUSE 10.3 32b | openSUSE 11.0 32b | |
openSUSE 10.3 64b | openSUSE 11.0 64b | openSUSE 11.1 64b |
RISC OS 3.6 | RISC OS 3.11 | openSUSE 11.1 PPC | TOS 4.02 |
|
| Back to top |
|
 |  |
External

Since: Jul 10, 2003 Posts: 56
|
(Msg. 18) Posted: Thu Aug 13, 2009 4:59 pm
Post subject: Re: Customized df -h [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Thu, 13 Aug 2009 22:07:23 +0100
David Bolt <blacklist-me.DeleteThis@davjam.org> wrote:
>I think the extra space is because the line:
>
> $valstr =~ s|[^0-9.]||igmx;
>
>Is looking for '.' as a decimal point and, for most European countries,
>the ',' is used instead.
>
I think you found the bug about the miscalculation!  I wasn't
thinking of that, so I need to add a comma into that regex.
The extra space *I* was talking about in that msg was the space in the
last column name 'Mounted on'. It completely went over my head that he
was talking about the extra space reported on the disk size -- duh!
Thanks for the head-slap . . .
--
Kevin Nathan (Arizona, USA)
Linux Potpourri and a.o.l.s. FAQ -- (temporarily offline)
Open standards. Open source. Open minds.
The command line is the front line.
Linux 2.6.25.20-0.4-pae
4:52pm up 25 days 18:14, 35 users, load average: 1.18, 0.65, 0.72 |
|
| Back to top |
|
 |  |
External

Since: Jul 10, 2003 Posts: 56
|
(Msg. 19) Posted: Thu Aug 13, 2009 5:03 pm
Post subject: Re: Customized df -h [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Thu, 13 Aug 2009 23:28:09 +0200
houghi <houghi DeleteThis @houghi.org.invalid> wrote:
>What if there are languages that have two or three spaces?
My split command:
my @title = split '\s+', $firstline;
uses one or more (\s+) as the field separator. The problem there comes
in because I do this first:
# Fix column title with space in it:
$raw[0] =~ s/Mounted\s+on/Mounted_on/gmx;
So, instead of getting rid of the space (for proper parsing by the
split command), I will let the split come back with eight elements and
just concatenate the last two (if an eighth one exists). That should
cover that problem . . .
--
Kevin Nathan (Arizona, USA)
Linux Potpourri and a.o.l.s. FAQ -- (temporarily offline)
Open standards. Open source. Open minds.
The command line is the front line.
Linux 2.6.25.20-0.4-pae
5:00pm up 25 days 18:22, 35 users, load average: 0.57, 0.45, 0.57 |
|
| Back to top |
|
 |  |
External

Since: May 12, 2004 Posts: 420
|
(Msg. 20) Posted: Thu Aug 13, 2009 5:20 pm
Post subject: Re: Customized df -h [Login to view extended thread Info.] Imported from groups: per prev. post (more info?)
|
|
|
This message is not archived |
|
| Back to top |
|
 |  |
External

Since: May 12, 2004 Posts: 420
|
(Msg. 21) Posted: Thu Aug 13, 2009 5:20 pm
Post subject: Re: Customized df -h [Login to view extended thread Info.] Imported from groups: per prev. post (more info?)
|
|
|
This message is not archived |
|
| Back to top |
|
 |  |
External

Since: Sep 08, 2005 Posts: 188
|
(Msg. 22) Posted: Thu Aug 13, 2009 5:20 pm
Post subject: Re: Customized df -h [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Thu, 13 Aug 2009, Kevin Nathan wrote:-
>On Thu, 13 Aug 2009 18:49:32 +0200
>Jan Gerrit Kootstra <jan.gerrit.DeleteThis@kootstra.org.uk> wrote:
>
>>Probably a localisation error. I use LANG=nl_NL.UTF-8
>>
>>If I export LANG=C before running the script all is well.
>>
>
>Yes, it's because one of the column names (Mounted on) has a space in
>it and wrote it to replace that with underscore. There is no easy way
>to do it like that in all languages so I will modify the code to ignore
>the final text ('on' for me, 'op' for you) and hope that this column
>has a space in it in all languages. That should at least get it a
>little closer . . .
I think the extra space is because the line:
$valstr =~ s|[^0-9.]||igmx;
Is looking for '.' as a decimal point and, for most European countries,
the ',' is used instead.
Regards,
David Bolt
--
Team Acorn: http://www.distributed.net/ OGR-NG @ ~100Mnodes RC5-72 @ ~1Mkeys/s
openSUSE 10.3 32b | openSUSE 11.0 32b | |
openSUSE 10.3 64b | openSUSE 11.0 64b | openSUSE 11.1 64b |
RISC OS 3.6 | RISC OS 3.11 | openSUSE 11.1 PPC | TOS 4.02 |
|
| Back to top |
|
 |  |
External

Since: Sep 04, 2003 Posts: 45
|
(Msg. 23) Posted: Thu Aug 13, 2009 5:20 pm
Post subject: Re: Customized df -h [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Thu, 13 Aug 2009 12:41:57 -0700, Kevin Nathan wrote:
> Yes, it's because one of the column names (Mounted on) has a space in it
Instead of worrying about column names in the df output, why not use
the PERL Filesys module, an example of which is give at
<http://www.cyberciti.BIZ/tips/howto-write-perl-script-to-monitor-disk-space.html>
so no need to do any parsing of localized string names --
quote
use Filesys::DiskSpace;
my ($fs_type, $fs_desc, $used, $avail, $fused, $favail) = df $dir;
unquote
Also you may like to have a look at Disk Hog, featured in Linux Journal
of December 1st, 1997
<http://www.linuxjournal.com/article/2416>
Latest version at
<http://search.cpan.ORG/~kpatton/diskhog-0.3.1/> |
|
| Back to top |
|
 |  |
External

Since: May 12, 2004 Posts: 420
|
(Msg. 24) Posted: Thu Aug 13, 2009 5:20 pm
Post subject: Re: Customized df -h [Login to view extended thread Info.] Imported from groups: per prev. post (more info?)
|
|
|
This message is not archived |
|
| Back to top |
|
 |  |
External

Since: Jul 10, 2003 Posts: 56
|
(Msg. 25) Posted: Thu Aug 13, 2009 5:50 pm
Post subject: Re: Customized df -h [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Thu, 13 Aug 2009 18:49:32 +0200
Jan Gerrit Kootstra <jan.gerrit DeleteThis @kootstra.org.uk> wrote:
>Probably a localisation error. I use LANG=nl_NL.UTF-8
>
>If I export LANG=C before running the script all is well.
>
We can thank David for finding the bug! I mis-interpreted about what
you were talking in this message. Try adding a comma to this statement:
$valstr =~ s|[^0-9.]||igmx;
so it looks like this:
$valstr =~ s|[^0-9.,]||igmx;
and I think your ghost space will disappear! The reason we ended up
with extra space on your drives was because this was effectively
multiplying any number with a comma in it by ten -- 8,9 became 89, and
so on . . .
--
Kevin Nathan (Arizona, USA)
Linux Potpourri and a.o.l.s. FAQ -- (temporarily offline)
Open standards. Open source. Open minds.
The command line is the front line.
Linux 2.6.25.20-0.4-pae
5:30pm up 25 days 18:52, 35 users, load average: 0.22, 0.58, 0.67 |
|
| Back to top |
|
 |  |
External

Since: Jul 10, 2003 Posts: 56
|
(Msg. 26) Posted: Thu Aug 13, 2009 10:32 pm
Post subject: Re: Customized df -h [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Fri, 14 Aug 2009 07:00:30 +0200
Jan Gerrit Kootstra <jan.gerrit.RemoveThis@kootstra.org.uk> wrote:
>The numbers still differ, about 3G.
>
>The export LANG=C solution works better.
>
The numbers are correct only under LANG=C? I will check into it -- Perl
is very good about following the locale settings, so it's probably
something I have either wrong or borderline. If it was round-off
errors, I would expect them in both . . .
--
Kevin Nathan (Arizona, USA)
Linux Potpourri and a.o.l.s. FAQ -- (temporarily offline)
Open standards. Open source. Open minds.
The command line is the front line.
Linux 2.6.25.20-0.4-pae
10:30pm up 25 days 23:52, 35 users, load average: 1.44, 1.23, 1.19 |
|
| Back to top |
|
 |  |
External

Since: Jul 10, 2003 Posts: 56
|
(Msg. 27) Posted: Thu Aug 13, 2009 11:30 pm
Post subject: Re: Customized df -h [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Fri, 14 Aug 2009 07:58:13 +0200
houghi <houghi DeleteThis @houghi.org.invalid> wrote:
>Oh, Anybody interested in talking about my keyboard?
>
No need -- I got one, too! ;-D
--
Kevin Nathan (Arizona, USA)
Linux Potpourri and a.o.l.s. FAQ -- (temporarily offline)
Open standards. Open source. Open minds.
The command line is the front line.
Linux 2.6.25.20-0.4-pae
11:30pm up 26 days 0:52, 35 users, load average: 1.21, 1.18, 1.10 |
|
| Back to top |
|
 |  |
External

Since: Feb 02, 2006 Posts: 334
|
(Msg. 28) Posted: Fri Aug 14, 2009 3:20 am
Post subject: Re: Customized df -h [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Kevin Nathan schreef:
> On Thu, 13 Aug 2009 18:49:32 +0200
> Jan Gerrit Kootstra <jan.gerrit RemoveThis @kootstra.org.uk> wrote:
>
>> Probably a localisation error. I use LANG=nl_NL.UTF-8
>>
>> If I export LANG=C before running the script all is well.
>>
>
> We can thank David for finding the bug! I mis-interpreted about what
> you were talking in this message. Try adding a comma to this statement:
>
> $valstr =~ s|[^0-9.]||igmx;
>
> so it looks like this:
>
> $valstr =~ s|[^0-9.,]||igmx;
>
> and I think your ghost space will disappear! The reason we ended up
> with extra space on your drives was because this was effectively
> multiplying any number with a comma in it by ten -- 8,9 became 89, and
> so on . . .
>
>
Kevin,
The numbers still differ, about 3G.
The export LANG=C solution works better.
Kind regards,
Jan Gerrit |
|
| Back to top |
|
 |  |
External

Since: May 12, 2004 Posts: 420
|
(Msg. 29) Posted: Fri Aug 14, 2009 3:20 am
Post subject: Re: Customized df -h [Login to view extended thread Info.] Imported from groups: per prev. post (more info?)
|
|
|
This message is not archived |
|
| Back to top |
|
 |  |
External

Since: May 12, 2004 Posts: 420
|
(Msg. 30) Posted: Fri Aug 14, 2009 3:20 am
Post subject: Re: Customized df -h [Login to view extended thread Info.] Imported from groups: per prev. post (more info?)
|
|
|
This message is not archived |
|
| Back to top |
|
 |  |
| Related Topics: | Surely suse is not this popular - At time of posting and accorind to torrentspy.com there are over 185437 people downloading Suse! No way! ..
YAST - Change Location Problem - Having problem with YAST (SLES9) where the original source of installation was deleted via 'Change Source of..
FTP - I have installed vsftpd but I am wondering how I set it up so that FTPing requires a password? The docs do not seem to....
pro100 - McDoo wrote: ..> I just purchased the pro/1000 gt nic. Suse 10.2 does not seem to have a >> diver for them....
openSuSE 10.2 No virtual consoles at RunLevel 5? - Hi, a.o.l.s Just migrated to 10.2 (from 9.3). Most stuff seems to be working, but just noticed that I can't use the..
System resolution timer too low - When I try to start the Rosegarden4 MIDI sequencer it trows up a box that says my system timer resolution is too low an... |
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
 |
|
|