seduction
 Language:
Welcome, Guest. Please login or register.
Did you miss your activation email?
2017/07/24, 10:51:00


Help

Author [EN] [PL] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: inxi bugs or failures - please report  (Read 11322 times)

0 Members and 1 Guest are viewing this topic.

Offline h2

  • User
  • Posts: 53
    • smxi.org
Re: inxi bugs or failures - please report
« Reply #30 on: 2014/04/27, 22:24:11 »
Here's an interesting one you can play with too, this uses the relatively new --total option in df, which gives oddly altering results:

Code: [Select]
# first see the actual output
df  --total  -P -T --exclude-type=aufs --exclude-type=devfs --exclude-type=devtmpfs  \
--exclude-type=fdescfs --exclude-type=iso9660 --exclude-type=linprocfs --exclude-type=procfs \
--exclude-type=squashfs --exclude-type=sysfs --exclude-type=tmpfs --exclude-type=unionfs

# then add the partition used blocks directly
 df  -P -T --exclude-type=aufs --exclude-type=devfs --exclude-type=devtmpfs  \
 --exclude-type=fdescfs --exclude-type=iso9660 --exclude-type=linprocfs --exclude-type=procfs \
 --exclude-type=squashfs --exclude-type=sysfs --exclude-type=tmpfs --exclude-type=unionfs | \
 awk 'BEGIN {total=0} {total = total + $4 }END {print total}'

 result:
 614562236

# then do it  --total, using only --total output
df  --total  -P -T --exclude-type=aufs --exclude-type=devfs --exclude-type=devtmpfs  \
--exclude-type=fdescfs --exclude-type=iso9660 --exclude-type=linprocfs --exclude-type=procfs \
--exclude-type=squashfs --exclude-type=sysfs --exclude-type=tmpfs --exclude-type=unionfs | \
awk 'BEGIN {total=0} /^total/ {total = total + $4 }END {print total}'

result:
614562228

# then do it with --total but just counting the disk blocks and ignoring the total
 df  --total  -P -T --exclude-type=aufs --exclude-type=devfs --exclude-type=devtmpfs  \
 --exclude-type=fdescfs --exclude-type=iso9660 --exclude-type=linprocfs \
 --exclude-type=procfs --exclude-type=squashfs --exclude-type=sysfs --exclude-type=tmpfs \
 --exclude-type=unionfs | awk 'BEGIN {total=0} !/total/ {total = total + $4 }END {print total}'

result:
614562208

These 3 should all give the same result in theory, but they don't. Using --total gave me a bit higher disk usage percentage for the total than adding up the individual percentages. Odd what I find with inxi and the system.

On my system, the difference is 77.7% disk used using --total vs 76.2% by adding up the individual used blocks.

Very strange. Anyway, the btrfs was an easy fix, I just made the regex sd[a-z][0-9]* (0 or more numbers ending it) instead of sd[a-z][0-9]+ (one or more numbers ending it)

Offline dibl

  • siduction community member
  • Global Moderator
  • User
  • *****
  • Posts: 1.598
    • Land of the Buckeye
Re: inxi bugs or failures - please report
« Reply #31 on: 2014/04/27, 22:51:59 »
Interesting.  If I'm reading my outputs correctly, on my rig the difference between the highest and the lowest result is only 8 bytes:


Code: [Select]
don@imerabox:~$ df  --total  -P -T --exclude-type=aufs --exclude-type=devfs --exclude-type=devtmpfs  \
> --exclude-type=fdescfs --exclude-type=iso9660 --exclude-type=linprocfs --exclude-type=procfs \
> --exclude-type=squashfs --exclude-type=sysfs --exclude-type=tmpfs --exclude-type=unionfs
Filesystem     Type  1024-blocks       Used  Available Capacity Mounted on
/dev/sda1      ext4     19478204   14356724    4109000      78% /
/dev/sdb1      ext4     57562364      53080   57492900       1% /mnt/REVODATA
/dev/sda2      ext4     37954208   31853332    6084492      84% /mnt/SDA2
/dev/sde1      ext2       506724     165606     314955      35% /boot
/dev/sdc       btrfs  1953525168  996694656  953952792      52% /mnt/DATA
total          -      2069026668 1043123398 1021954139      51% -


don@imerabox:~$ df  -P -T --exclude-type=aufs --exclude-type=devfs --exclude-type=devtmpfs  \
>  --exclude-type=fdescfs --exclude-type=iso9660 --exclude-type=linprocfs --exclude-type=procfs \
>  --exclude-type=squashfs --exclude-type=sysfs --exclude-type=tmpfs --exclude-type=unionfs | \
>  awk 'BEGIN {total=0} {total = total + $4 }END {print total}'
1043123394


don@imerabox:~$ df  --total  -P -T --exclude-type=aufs --exclude-type=devfs --exclude-type=devtmpfs  \
> --exclude-type=fdescfs --exclude-type=iso9660 --exclude-type=linprocfs --exclude-type=procfs \
> --exclude-type=squashfs --exclude-type=sysfs --exclude-type=tmpfs --exclude-type=unionfs | \
> awk 'BEGIN {total=0} /^total/ {total = total + $4 }END {print total}'
1043123402


don@imerabox:~$ df  --total  -P -T --exclude-type=aufs --exclude-type=devfs --exclude-type=devtmpfs  \
>  --exclude-type=fdescfs --exclude-type=iso9660 --exclude-type=linprocfs \
>  --exclude-type=procfs --exclude-type=squashfs --exclude-type=sysfs --exclude-type=tmpfs \
>  --exclude-type=unionfs | awk 'BEGIN {total=0} !/total/ {total = total + $4 }END {print total}'
1043123398


I call that "close enough"!
Asus Z87-WS, Core i7-4770, Nvidia GTX-750 Ti, dual monitors, OCZ Vertex Plus, 2@WD1000DHTZ in BTRFS

Offline h2

  • User
  • Posts: 53
    • smxi.org
Re: inxi bugs or failures - please report
« Reply #32 on: 2014/04/27, 22:56:44 »
Using the total flag seems to change the blocks used of my root partition

It's not bytes, it's blocks, a block is 1024 bits I believe. No, sorry, it's 1024 Bytes, 1kB.

# without --total
/dev/sda1 ext3    12479556  12015896    335544      98% /

# with --total
/dev/sda1 ext3    12479556  12015856    335584      98% /

that looks very much like a bug to me, all my other partition data are the same with --total/no --total.

However, a 40kB difference should not account for a greater than 1% difference in size used on 800 gB
« Last Edit: 2014/04/27, 23:02:59 by h2 »

Offline dibl

  • siduction community member
  • Global Moderator
  • User
  • *****
  • Posts: 1.598
    • Land of the Buckeye
Re: inxi bugs or failures - please report
« Reply #33 on: 2014/04/27, 23:09:37 »
Well, duh, it says "blocks" right there in the table.  So I have 8 blocks variance from the highest output to the lowest output -- 8kB.  That is miniscule out of 1 GiB, but still the math should be the same.


Hmmm, I wonder if there's something about ext3 versus ext4?  I would not expect that, but I see your filesystem is ext3.  Also, what about swap -- would it be counted as "used" if something is swapped out, but "unused" if the swap space is unused?
Asus Z87-WS, Core i7-4770, Nvidia GTX-750 Ti, dual monitors, OCZ Vertex Plus, 2@WD1000DHTZ in BTRFS

Offline h2

  • User
  • Posts: 53
    • smxi.org
Re: inxi bugs or failures - please report
« Reply #34 on: 2014/04/27, 23:17:31 »
good point re swap, I forgot all about that part.

Technically I'd call your entire disk space for swap used since it's not available to you.

The partition data shows the swap size/percent, but i forgot all about the swap partition for the total size used.

For these purposes I think I will call swap partitions used, since you can't use them for anything else.

Offline h2

  • User
  • Posts: 53
    • smxi.org
Re: inxi bugs or failures - please report
« Reply #35 on: 2014/04/27, 23:45:58 »
Ok, now 2.1.22 includes swap space as used in -D.

Updated -h and man page to indicate this fact.

I don't know why I never thought of swap in the total, but it's clearly not space you have available to use on the disk, therefore it's used.

Makes sense to me. The help menu will further clarify, in terms of raid/swap percentages. Remember that raid will make percentage used wrong since inxi doesn't know about raid in the calculation, to get around that is complicated, means getting all raid data first, then spitting out the /dev id on each disk in the arrays, and faking it slightly and ignoring the size of other elements of the disk array when doing used/size calcs. Too hard for me at this point.

Percent used has always been tricky because of unmounted partitions, so it's never accurate unless all your partitions are mounted and no RAID disks are present. Now it should be a bit more accurate though.

I cannot see where the really big difference in used percentages comes between --total and regular counting up used blocks, unless there is an internal Gawk bug with counting or math.
« Last Edit: 2014/04/27, 23:53:27 by h2 »

Offline h2

  • User
  • Posts: 53
    • smxi.org
Re: inxi bugs or failures - please report
« Reply #36 on: 2014/04/28, 01:02:41 »
It turns out there was a bug in inxi, the disk space used was not including /dev/disk... items from df, which is why I was getting such large differences using --total and old method.

2.1.23 fixes this bug, I made a new release number because I only just now fixed the bug.

Weird how such bugs crop  up, it's because linux/bsd is always changing, you can never count on any data to remain constant.

Offline dibl

  • siduction community member
  • Global Moderator
  • User
  • *****
  • Posts: 1.598
    • Land of the Buckeye
Re: inxi bugs or failures - please report
« Reply #37 on: 2014/04/28, 01:11:34 »
Nice work h2 -- you are the maestro!
Asus Z87-WS, Core i7-4770, Nvidia GTX-750 Ti, dual monitors, OCZ Vertex Plus, 2@WD1000DHTZ in BTRFS

Offline h2

  • User
  • Posts: 53
    • smxi.org
Re: inxi bugs or failures - please report
« Reply #38 on: 2014/04/28, 01:12:41 »
Re the two disks of the btrfs raid, those are handled in the -D output already, but inxi -R does not yet have btrfs raid support.

zfs, md-raid are supported, each type has to be added manually since each is totally different in output.

Can you show the full output and commands to get all raid data from btrfs?

Remember to only give generic commands that inxi can use without knowing anything about your system, of course.

From those I can usually figure out how to proceed.

It must have something like a btrfs all command to show all devices and raid arrays, etc.

If you and others can provide full btrfs raid collection methods and data samples, I can add those to the inxi debugger. I'll llook them up for now, maybe we can get -R to support btrfs too.

thanks.

Offline h2

  • User
  • Posts: 53
    • smxi.org
Re: inxi bugs or failures - please report
« Reply #39 on: 2014/04/28, 01:31:53 »
Added some btrfs data collection to inxi debugger:

btrfs filesystem show
btrfs filesystem show --mounted

which will be a start, but I'll need a fair number of sample data sets before I can get the syntax for raid.
« Last Edit: 2014/04/28, 02:36:25 by h2 »

Offline dibl

  • siduction community member
  • Global Moderator
  • User
  • *****
  • Posts: 1.598
    • Land of the Buckeye
Re: inxi bugs or failures - please report
« Reply #40 on: 2014/04/28, 03:54:22 »
This is the basic ID of the btrfs filesystem:

Code: [Select]
root@imerabox:/home/don# btrfs fi show /mnt/DATA
Label: none  uuid: 9025bea6-b615-470a-8759-df1b13f63b52
        Total devices 2 FS bytes used 948.87GiB
        devid    1 size 931.51GiB used 804.03GiB path /dev/sdc
        devid    2 size 931.51GiB used 804.01GiB path /dev/sdd

Btrfs v3.14.1

And to show the capacity utilization we issue

Code: [Select]
btrfs fi df /mnt/DATA

and see something like


Code: [Select]
Data, RAID0: total=1.56TiB, used=947.21GiB
Data, single: total=8.00MiB, used=6.28MiB
System, RAID1: total=8.00MiB, used=116.00KiB
System, single: total=4.00MiB, used=0.00
Metadata, RAID1: total=3.00GiB, used=1.65GiB
Metadata, single: total=8.00MiB, used=0.00
unknown, single: total=512.00MiB, used=0.00




Note that fdisk does not help much, if the BTRFS filesystem is on the raw devices:


Code: [Select]
root@imerabox:/# fdisk -lu


Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/sdc doesn't contain a valid partition table
« Last Edit: 2014/04/28, 03:58:40 by dibl »
Asus Z87-WS, Core i7-4770, Nvidia GTX-750 Ti, dual monitors, OCZ Vertex Plus, 2@WD1000DHTZ in BTRFS

Offline h2

  • User
  • Posts: 53
    • smxi.org
Re: inxi bugs or failures - please report
« Reply #41 on: 2014/04/28, 05:34:04 »
those don't help because it assumes that inxi already knows the mount points of btrfs, which is what it has to discover.

show the ones I asked

btrfs filesystem show
btrfs filesystem show --mounted

for raid, inxi has to discover what is being used for raid, etc. I don't yet know what data I can get from btrfs, zpool/zfs has great reporting tools, btrfs is not as good yet.

I don't know if I'll look at btrfs raid for a while, I need a  lot more diverse data samples, and it's a big change internally in inxi, it was built for md-raid and zfs, and then only if bsd for zfs, even though you can have zfs on linux. so to upgrade -R will require a pretty major redo of the logic to make it universal, ie, any system, any combination of raid, very hard to develop and test because without a raid system for each type it's very hard to emulate the data.

I did / do have md-raid and zfs more or less solid, but not as 2 of a set of possible raids, more as just one or the other. Not sure how I'd handle that.
« Last Edit: 2014/04/28, 05:38:31 by h2 »

Offline dibl

  • siduction community member
  • Global Moderator
  • User
  • *****
  • Posts: 1.598
    • Land of the Buckeye
Re: inxi bugs or failures - please report
« Reply #42 on: 2014/04/28, 12:40:04 »
There is no difference in the outputs -- probably because the only BTRFS filesystem in the computer is already mounted:


Code: [Select]
root@imerabox:~# btrfs fi show
Label: none  uuid: 9025bea6-b615-470a-8759-df1b13f63b52
   Total devices 2 FS bytes used 948.87GiB
   devid    1 size 931.51GiB used 804.03GiB path /dev/sdc
   devid    2 size 931.51GiB used 804.01GiB path /dev/sdd


Btrfs v3.14.1
root@imerabox:~# btrfs fi show --mounted
Label: none  uuid: 9025bea6-b615-470a-8759-df1b13f63b52
   Total devices 2 FS bytes used 948.87GiB
   devid    1 size 931.51GiB used 804.03GiB path /dev/sdc
   devid    2 size 931.51GiB used 804.01GiB path /dev/sdd


Btrfs v3.14.1


So if I unmount the BTRFS filesystem, the second command gives a null output:


Code: [Select]
root@imerabox:~# umount /dev/sdc
root@imerabox:~# btrfs fi show --mounted
Btrfs v3.14.1
root@imerabox:~#
 

But the first command still shows it the same.


Asus Z87-WS, Core i7-4770, Nvidia GTX-750 Ti, dual monitors, OCZ Vertex Plus, 2@WD1000DHTZ in BTRFS

Offline melmarker

  • Global Moderator
  • User
  • *****
  • Posts: 1.906
    • g-com.eu
Re: inxi bugs or failures - please report
« Reply #43 on: 2014/04/28, 17:34:12 »
inxi_2.1.23.r2258.1_all.deb is now in the repo - should be available from the mirrors soon
All you need in this life is ignorance and confidence; then success is sure.   -- Mark Twain, 1887
Never attribute to malice that which can be adequately explained by stupidity.  -- Hanlons razor

Offline dibl

  • siduction community member
  • Global Moderator
  • User
  • *****
  • Posts: 1.598
    • Land of the Buckeye
Re: inxi bugs or failures - please report
« Reply #44 on: 2014/04/28, 18:30:03 »
Wow -- PERFECT!


Code: [Select]
don@imerabox:~$ inxi -v3
System:    Host: imerabox Kernel: 3.15-rc3-siduction-amd64 x86_64 (64 bit gcc: 4.9.0)
           Desktop: KDE 4.12.4 (Qt 4.8.6) Distro: aptosid 2011-02 Ἡμέρα - kde-lite - (201107131633)
Machine:   Mobo: ASUSTeK model: P6X58D-E v: Rev 1.xx Bios: American Megatrends v: 0803 date: 08/06/2012
CPU:       Quad core Intel Core i7 CPU 950 (-HT-MCP-) cache: 8192 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 25176
           Clock Speeds: 1: 3145 MHz 2: 3145 MHz 3: 3145 MHz 4: 3145 MHz 5: 3145 MHz 6: 3145 MHz 7: 3145 MHz
           8: 3145 MHz
Graphics:  Card: NVIDIA GF100 [GeForce GTX 480] bus-ID: 05:00.0
           Display Server: X.Org 1.15.1 driver: nvidia Resolution: 1920x1200@59.9hz
           GLX Renderer: GeForce GTX 480/PCIe/SSE2 GLX Version: 4.4.0 NVIDIA 337.12 Direct Rendering: Yes
Network:   Card: Marvell 88E8056 PCI-E Gigabit Ethernet Controller
           driver: sky2 v: 1.30 port: d800 bus-ID: 06:00.0
           IF: eth0 state: up speed: 100 Mbps duplex: full mac: 20:cf:30:5c:41:1d
Drives:    HDD Total Size: 2136.5GB (51.1% used) ID-1: model: OCZ
           ID-2: model: OCZ ID-3: model: WDC_WD1002FAEX
           ID-4: model: KINGSTON_SS100S2 ID-5: model: WDC_WD1002FAEX
Info:      Processes: 322 Uptime: 23 min Memory: 1797.7/5965.6MB Init: systemd runlevel: 5 Gcc sys: 4.8.2
           Client: Shell (bash 4.3.111) inxi: 2.1.23
Asus Z87-WS, Core i7-4770, Nvidia GTX-750 Ti, dual monitors, OCZ Vertex Plus, 2@WD1000DHTZ in BTRFS