Welcome!
Important information
-- Spectre and Meltdown vulnerabilities
-- Change in MX sources

News
-- MX Linux on social media: here
-- Mepis support still here

Current releases
-- MX-17.1 Final release info here
-- antiX-17 release info here

New users
-- Please read this first, and don't forget to add system and hardware information to posts!
-- Here are the Forum Rules

Another new inxi feature: -p --admin raw parition size, block size

Message
Author
User avatar
h2-1
Forum Regular
Forum Regular
Posts: 429
Joined: Sat Nov 15, 2008 3:16 pm

Another new inxi feature: -p --admin raw parition size, block size

#1 Post by h2-1 » Fri Sep 21, 2018 7:53 pm

Yet another new item, coming soon in inxi, currently in pinxi.

I'd been thinking of adding another --admin option for a while, someone who did a lot of help on inxi had asked for it a while ago, but I didn't get around to it.

pinxi -pa (or -p --admin)

now adds: raw size: this is the actual byte count of the parition, including the file system overhead stuff, it shows the percent available for size: that's the actual amount of the total size that you can use for data, and shows the logical block size for good measure. Logical block size can be quite a bit smaller than physical block size, but for the math, logical is the right one.

Technically I should actually add the block size to the disks, not the partitions, but maybe you can tweak the block size? on per partition basis, can't remember.

remote, swap, and a few other types of partitions aren't supported.

Give it a spin, see if you can find a valid partition type that doesn't work as expected, yet appears in ls /sys/block/[id] or /sys/block/[base]/[id]

Code: Select all

pinxi -zpla -y80
Partition:
  ID-1: / raw size: 35.00 GiB size: 34.32 GiB (98.07%) used: 12.87 GiB (37.5%) 
  block size: 512 bits fs: ext4 dev: /dev/vda1 label: N/A 
  ID-2: /usr/home raw size: 60.00 GiB size: 58.93 GiB (98.22%) 
  used: 22.47 GiB (38.1%) block size: 512 bits fs: ext4 dev: /dev/vdb 
  label: N/A 
  ID-3: /usr/home/staff size: 34.32 GiB used: 30.24 GiB (88.1%) fs: nfs 
  remote: 10.81.1.5:/usr/home/staff label: N/A uuid: N/A

pinxi -plxxxzay80
Partition:
  ID-1: / raw size: 18.63 GiB size: 18.21 GiB (97.75%) used: 1.64 GiB (9.0%) 
  block size: 512 bits fs: ext4 dev: /dev/sda1 label: vc-root 
  ID-2: /home raw size: 7.45 GiB size: 7.27 GiB (97.59%) 
  used: 674.9 MiB (9.1%) block size: 512 bits fs: ext4 dev: /dev/sda2 
  label: vc-home 
  ID-3: /var/www/m raw size: 91.27 GiB size: 89.34 GiB (97.88%) 
  used: 5.51 GiB (6.2%) block size: 512 bits fs: ext4 dev: /dev/sda3 
  label: vc-m 
  ID-4: swap-1 size: 1.90 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/sda4 
  label: N/A
smxi/sgfxi site (manuals, how-to's, faqs) :: script forums :: Check out inxi sys info script!

User avatar
h2-1
Forum Regular
Forum Regular
Posts: 429
Joined: Sat Nov 15, 2008 3:16 pm

Re: Another new inxi feature: -p --admin raw parition size, block size

#2 Post by h2-1 » Fri Sep 21, 2018 8:06 pm

Ouch, just realized I was relying on a default for disks, and that partitions can have different block sizes, so I may have to pull this feature, because I currently have no way to get per partition block sizes, though most seem to be the same as disk logical block sizes.
smxi/sgfxi site (manuals, how-to's, faqs) :: script forums :: Check out inxi sys info script!

User avatar
oops
Forum Regular
Forum Regular
Posts: 440
Joined: Tue Apr 10, 2018 5:07 pm

Re: Another new inxi feature: -p --admin raw parition size, block size

#3 Post by oops » Fri Sep 21, 2018 8:40 pm

Hello h2_1
FI: for an other subject, I think you should add the first line of output " inxi -xxx -m" , by this way , even the non root user can see the amount of memory by pinxi --full -v 8

Code: Select all

Memory:    RAM: total: 5.75 GiB used: 2.51 GiB (43.6%) 
           RAM Report: permissions: Unable to run dmidecode. Are you root? 
.... To include to the option :"$ ./pinxi --full -v 8" (useful for non root user)
$ inxi -Fxxxz : System: Host:XEON ... Distro: MX-17.1_x64 Horizon

User avatar
h2-1
Forum Regular
Forum Regular
Posts: 429
Joined: Sat Nov 15, 2008 3:16 pm

Re: Another new inxi feature: -p --admin raw parition size, block size

#4 Post by h2-1 » Fri Sep 21, 2018 9:23 pm

I thought it did that? yes, pinxi -m shows memory, but normally memory is in the Info line.

If you don't use -I line, memory shows up in either Memory: line or Processes: line if tm is used.

It shows, that is, by default in -I, and if not there, it shows in the first thing that uses memory data.

To me it's confusing to move stuff around, since Memory: is always in -I, I've thought it should stay in -I, and only appear elsewhere if -I isn't used.

that's my thinking on it anyway.

Figured out a workaround for the issue with partition block sizing, will require a tool unfortunately.

will also add --admin -D for block sizes, logical and physical, for disks, that's easy and does not require root.
smxi/sgfxi site (manuals, how-to's, faqs) :: script forums :: Check out inxi sys info script!

User avatar
h2-1
Forum Regular
Forum Regular
Posts: 429
Joined: Sat Nov 15, 2008 3:16 pm

Re: Another new inxi feature: -p --admin raw parition size, block size

#5 Post by h2-1 » Fri Sep 21, 2018 10:11 pm

pinxi 3.0.24-44 should now work on actual block sizes of partition, had to use blockdev, which requires sudo/root to run. Shows root or missing tool message if not root / sudo or tool missing. I was hoping to avoid using a tool, but it's a standard part of kernel tools so I think most linux systems will have it.

I've expanded it, since it's an --admin option, which can be absurdly verbose, to show the logical and physical block size. The math uses the logical block size.
smxi/sgfxi site (manuals, how-to's, faqs) :: script forums :: Check out inxi sys info script!

User avatar
h2-1
Forum Regular
Forum Regular
Posts: 429
Joined: Sat Nov 15, 2008 3:16 pm

Re: Another new inxi feature: -p --admin raw parition size, block size

#6 Post by h2-1 » Fri Sep 21, 2018 10:43 pm

3.0.24-45 adds to -d block sizes for physical/logical as well.

Code: Select all

# pinxi -dpxxxazy80
Drives:
  Local Storage: total: 357.72 GiB used: 7.81 GiB (2.2%) 
  ID-1: /dev/sda vendor: InnoDisk model: mSATA 3ME3 size: 119.24 GiB 
  block size: physical: 512 B logical: 512 B speed: 6.0 Gb/s serial: <filter> 
  rev: 25 temp: 30 C scheme: MBR 
  ID-2: /dev/sdb vendor: Intel model: SSDSC2KW256G8 size: 238.47 GiB 
  block size: physical: 512 B logical: 512 B speed: 6.0 Gb/s serial: <filter> 
  rev: 002C scheme: MBR 
  Message: No Optical or Floppy data was found. 
Partition:
  ID-1: / raw size: 18.63 GiB size: 18.21 GiB (97.75%) used: 1.64 GiB (9.0%) 
  block size: physical: 4096 B logical: 512 B fs: ext4 dev: /dev/sda1 
  ID-2: /home raw size: 7.45 GiB size: 7.27 GiB (97.59%) 
  used: 674.9 MiB (9.1%) block size: physical: 4096 B logical: 512 B fs: ext4 
  dev: /dev/sda2 
  ID-3: /var/www/m raw size: 91.27 GiB size: 89.34 GiB (97.88%) 
  used: 5.51 GiB (6.2%) block size: physical: 4096 B logical: 512 B fs: ext4 
  dev: /dev/sda3 
  ID-4: swap-1 size: 1.90 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/sda4
another one, as I've now discovered, some of my disks have 512 B block sizes, and some 4096 B, so I guess this feature actually has some realworld utility!

Code: Select all

pinxi -dxxxazy80
Drives:
  Local Storage: total: 1.98 TiB used: 1.33 TiB (67.2%) 
  ID-1: /dev/sda vendor: Intel model: SSDSC2CT180A4 size: 167.68 GiB 
  block size: physical: 512 B logical: 512 B speed: 3.0 Gb/s serial: <filter> 
  rev: 335u scheme: MBR 
  ID-2: /dev/sdb vendor: Western Digital model: WD1003FZEX-00MK2A0 
  size: 931.51 GiB block size: physical: 4096 B logical: 512 B speed: 3.0 Gb/s 
  rotation: 7200 rpm serial: <filter> rev: 1A01 temp: 44 C scheme: GPT 
  ID-3: /dev/sdc vendor: Western Digital model: WD1001FALS-00J7B1 
  size: 931.51 GiB block size: physical: 512 B logical: 512 B speed: 3.0 Gb/s 
  serial: <filter> rev: 0K05 temp: 51 C scheme: MBR 
  Floppy-1: /dev/fd0 
  Optical-1: /dev/sr0 vendor: TSSTcorp model: CD/DVDW TS-H652L rev: 0603 
  dev-links: cdrom,cdrw,dvd,dvdrw 
  Features: speed: 40 multisession: yes audio: yes dvd: yes 
  rw: cd-r,cd-rw,dvd-r,dvd-ram state: running 
smxi/sgfxi site (manuals, how-to's, faqs) :: script forums :: Check out inxi sys info script!

User avatar
oops
Forum Regular
Forum Regular
Posts: 440
Joined: Tue Apr 10, 2018 5:07 pm

Re: Another new inxi feature: -p --admin raw parition size, block size

#7 Post by oops » Sat Sep 22, 2018 6:23 am

h2-1 wrote:
Fri Sep 21, 2018 9:23 pm
I thought it did that? yes, pinxi -m shows memory, but normally memory is in the Info line....
It is not confusing, with the non root user I have (pinxi: 3.0.24-50) :

Code: Select all

$ ./pinxi -U
Starting pinxi self updater.
Using tiny as downloader.
Currently running pinxi version number: 3.0.24
...

Code: Select all

$ ./pinxi --full -v 8
...
Memory:    RAM Report: permissions: Unable to run dmidecode. Are you root? 
...

# and with no root user too:
./pinxi -xxx -m
Memory:    RAM: total: 1.96 GiB used: 1.09 GiB (55.7%) 
           RAM Report: permissions: Unable to run dmidecode. Are you root? 
For block size here (eepc) I have:

Code: Select all

Non root user:
$ ./pinxi -dxxxazy80
$ ./pinxi -dpxxxazy80
Drives:
  Local Storage: total: 465.76 GiB used: 85.74 GiB (18.4%) 
  ID-1: /dev/sda vendor: Seagate model: ST95005620AS size: 465.76 GiB 
  block size: physical: 512 B logical: 512 B speed: <unknown> 
  rotation: 7200 rpm serial: <filter> rev: SD23 scheme: MBR 
  Message: No Optical or Floppy data was found. 
Partition:
  ID-1: / raw size: 26.06 GiB size: 25.53 GiB (97.95%) used: 8.14 GiB (31.9%) 
  fs: ext4 block size: 4096 B dev: /dev/sda6 
  ID-2: /home raw size: 170.83 GiB size: 167.15 GiB (97.85%) 
  used: 77.60 GiB (46.4%) fs: ext4 block size: 4096 B dev: /dev/sda10 
  ID-3: swap-1 size: 4.45 GiB used: 4.0 MiB (0.1%) fs: swap dev: /dev/sda5 


root user:
./pinxi -dpxxxazy80
Drives:
  Local Storage: total: 465.76 GiB used: 85.74 GiB (18.4%) 
  ID-1: /dev/sda vendor: Seagate model: ST95005620AS size: 465.76 GiB 
  block size: physical: 512 B logical: 512 B speed: <unknown> 
  rotation: 7200 rpm serial: <filter> rev: SD23 temp: 39 C scheme: MBR 
  Message: No Optical or Floppy data was found. 
Partition:
  ID-1: / raw size: 26.06 GiB size: 25.53 GiB (97.95%) used: 8.14 GiB (31.9%) 
  fs: ext4 block size: 4096 B dev: /dev/sda6 
  ID-2: /home raw size: 170.83 GiB size: 167.15 GiB (97.85%) 
  used: 77.60 GiB (46.4%) fs: ext4 block size: 4096 B dev: /dev/sda10 
  ID-3: swap-1 size: 4.45 GiB used: 3.3 MiB (0.1%) fs: swap dev: /dev/sda5 

PS: Maybe the fsck information is interesting too for ext partitions ?

Code: Select all

sudo LANG=C tune2fs -l /dev/sda6 | egrep -i "mount count|Check interval|Next"
Mount count:              58
Maximum mount count:      60
Check interval:           15552000 (6 months)
Next check after:         Thu Dec 20 16:14:30 2018
$ inxi -Fxxxz : System: Host:XEON ... Distro: MX-17.1_x64 Horizon

User avatar
h2-1
Forum Regular
Forum Regular
Posts: 429
Joined: Sat Nov 15, 2008 3:16 pm

Re: Another new inxi feature: -p --admin raw parition size, block size

#8 Post by h2-1 » Sat Sep 22, 2018 1:43 pm

specific file system data is interesting, but sadly there are many file systems, so that would be a lot of work. actually the -d/-p --admin already proved to be far more work than I expected due to the way blockdev and lsblk vary in the block sizes reported.

My ending assumption is that lsblk reports the logical and physical block sizes of the actual device, and blockdev reports I think the logical block size and the filesystem block size, it took me a while to unravel that confusion, though I'm still not sure.

I ended up using the lsblk logical size for the math, since I can get that without root, and the blockdev size for the filesystem block size. Because lsblk does not require root, my suspicion is that the block size is what you find in /sys/block/sda/queue/physical_block_size, for instance. A file I found an older variant for last night too, sigh.

I think that's right, because where blockdev --getbsz /dev/dm-1 (which is a logical partition type) reported the size, lsblk did not have that one. Plus the blockdev --getbsz /dev/sdc1 matched tune2fs -l /dev/sdc1 in block size, but lsblk did not.

Everything grows far more complicated when you try to be accurate and support everything, along with requiring more and more code.

ext2 ext3 ext4 jfs xfs zfs btrfs reiserfs reiser4 vfat fat32 fatx tfat ffs hammer hfs+ hfsj hfs nss ufs ufs2 ntfs. At least. Plus the various bsd filesystems. And apple's. Since I've never even seen many of those, it would involve a lot of work to actually get a feature with advanced data like that running. Plus figuring out the various data offered by each, and then inserting them into a common data structure.

I'd roughly estimate 200 to 300 lines more code, give or take, 5 days to get stable. Easy to suggest, lol, hard to do. If you really want this type of thing, collect ALL the tools for ALL the filesystems, then on github post an issue with the command and the file system and the output, full, for all of them, since that's a big chunk of the work and time, and if someone does that, I'm far more likely to actually do it, if I can find some way to do the data structures. With perl might be possible, since I could simply construct hashes containing the desired data from each type, and print that out once sorted, that would be doable, lot of work, but doable. Also include which lines in the output have the data you'd want to see, per filesystem type, since all their tools will be different.

So advanced filesystem data requires a lot of research, all the data from all the filesystem tools, then to find what consistent types you can extract, so much stuff, lol, sigh. This means creating a vm, adding a disk to it, and then partitioning that disk with all the file systems. All of them, not most of them. Then learning which tools are required, and collecting the output from each tool in each file system. Again, easy to suggest someone else do it, harder to do it yourself, so I'm going to put this on hold until someone does the work re data collection and research. All as in at least all the common file systems, which is about 10 of them I'd say, roughly.
Last edited by h2-1 on Sat Sep 22, 2018 2:30 pm, edited 2 times in total.
smxi/sgfxi site (manuals, how-to's, faqs) :: script forums :: Check out inxi sys info script!

User avatar
h2-1
Forum Regular
Forum Regular
Posts: 429
Joined: Sat Nov 15, 2008 3:16 pm

Re: Another new inxi feature: -p --admin raw parition size, block size

#9 Post by h2-1 » Sat Sep 22, 2018 1:58 pm

Re the memory, I'll think about it, but I'm reluctant to change key data locations. Just checked, it's -v5-8, not -F, so if I were to change that, the rule would be: if -m is triggered, show on -m, else show on -I, unless -I is not triggered, and -tm is, then show in -tm.

inxi has shown memory in the -I and short form line basically from day 1, and most users I think expect to see it there, but I can see an argument for moving it to -m if -m is switched on, since that is the memory line.
smxi/sgfxi site (manuals, how-to's, faqs) :: script forums :: Check out inxi sys info script!

User avatar
h2-1
Forum Regular
Forum Regular
Posts: 429
Joined: Sat Nov 15, 2008 3:16 pm

Re: Another new inxi feature: -p --admin raw parition size, block size

#10 Post by h2-1 » Sat Sep 22, 2018 2:19 pm

-51 is testing showing ram in various locations.

I find it confusing and unclear, so I will have to modify the logic slightly.

I can see showing it on the memory line, but I don't see showing it on the -tm line if -I is active, that's just confusing. So I have to make the logic more granular.

The logic will roughly be, if I do it this way:

if -m is active, show memory report on -m line
elsif -I is active, show memory report on -I line
elsif -tm is active, and -m is not active, show memory report on -tm line
elsif short form, show memory report on main line.
smxi/sgfxi site (manuals, how-to's, faqs) :: script forums :: Check out inxi sys info script!

Post Reply

Return to “antiX”