antiX’ Conky disk space misinformation

  • This topic has 14 replies, 7 voices, and was last updated Mar 13-4:29 am by skidoo.
Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #55553
    Member
    uxer

    1. I take a glance at Conky monitor on the desktop from time to time, and it showed 18.6 GB used out of 19.6 GB on my root partition, so I felt as if I had some available space. By running into several issues, it turned out that there was no free space. I didn’t screenshot it then, but even a screenshot after a bit of clean-up shows that ‘df’ and ‘pcmanfm’ report that only 400+MB are available, whereas antiX’ desktop Conky monitor is misinformative.

    1.1 Wouldn’t it be more readable if Conky reported free space instead of used or both free and used instead of used?

    2. I suppose, antiX’ conky should show not just root but all mounted filesystems, including temporarily plugged via USB

    #55555
    Member
    sybok
    Helpful
    Up
    0
    :D

    Hi,

    1.1 Feel free to modify your local conky setup, ‘~/.conkyrc’.
    Change ‘fs_used’ to ‘fs_free’ and ‘Used’ to ‘Free’ in the appropriate places.

    Still, I am surprised about the wrong usage reported.
    Could it be the running out of space?

    I guess that 1kB being 10^3 = 1000 vs. 2^(10) = 1024 Bytes should be consistent across the functions ‘fs_<whatever>’.

    1.2 That would require to
    A) Stop the conky when new device plugged in/out.
    B) Dynamically (re)create the ~/.conkyrc file
    C) Start conky again.
    Of course, this can be scripted but I personally do not find the stopping and starting elegant.
    Not quite sure if the interest (of devs to do/include it) would be sufficient.
    Still, you may code it and share with others (as some of the members, e.g. PPC and others, do).

    • This reply was modified 3 months, 1 week ago by sybok. Reason: Re-structure, add reply to 1.2
    • This reply was modified 3 months, 1 week ago by sybok.
    #55560
    Member
    Koo
    Helpful
    Up
    0
    :D

    / Disk:${alignr}${fs_free /} / ${fs_size /} <<< look for this line.

    Do you have your home folder install in root folder. Or is home separate in it own portion.

    Nice work sybok

    T430 i7-3632QM 16gb , antiX-19.2.1-runit_x64-base Hannie Schaft 29 March 2020 , 5.8.16-antix.1-amd64-smp

    #55561
    Member
    sybok
    Helpful
    Up
    0
    :D

    Few comments to my reply:
    1) @1.2:
    I did/do not find it elegant because:
    A) My first idea was to have a script periodically checking for new/disconnected devices.
    This is a background “service” eating my CPU/RAM resources when a simple ‘df -h’ executed in console suffices my needs.
    If it can be triggered only if a new device added and/or existing disconnected (may be, this is how ‘automount’ works?), this would be more elegant and this argument/reason no longer stands.
    But I have no idea how this could be done.
    B) Still, conky has to be quit and restarted.

    2) I hope I did not sound rude. Definitely was not my intention.

    #55571
    Member
    Koo
    Helpful
    Up
    0
    :D

    @sybok
    This may help you. Edit to suit your needs

    # Mounted
    ${voffset -8}${font Open Sans:Bold:size=10}${color0}Disk Mounts ${color1}${hr 3}$color$font

    ${execpi 10 sh semplice-conky-harddisks.sh}
    ]];

    semplice-conky-harddisks.sh

    #!/bin/sh
    
    #
    # Returns a list of the harddisks, in a conky-style configuration.
    # (C) 2010 Semplice Team. All rights reserved.
    # This file is released under the terms of the GNU GPL license, version 3 or later.
    #
    # fehlix: simplified mount checks
    
    # For now only for /home
    
    #if mountpoint -q /home; then
    #echo '${voffset -12}/home:'
    #echo '${voffset 4}${fs_used /home} of ${fs_size /home} ${alignr}${fs_bar 8,90 /home}'
    #echo
    #fi
    
    awk  '$2 ~ /[/]media/ { print $2 }' /proc/mounts | while read media; do
    echo '${voffset -8}${color}'"$media":
    echo '${voffset 4}${fs_used' "$media"'} of ${fs_size' "$media"'} ${alignr}${color #FFF600}${fs_bar 8,90' "$media}"
    echo ''
    done

    But of info on HDTemp..

    HddTemp
    
    If you want to have Hard drive Temperatures in your Conky you MAY need to edit as root (etc/hddtemp.db) and add your hard drive to the list under your brand of drive.
    
    1 = Install hddtemp 
    To run hddtemp without sudo on startup type = chmod u+s /usr/sbin/hddtemp
    
    2 = Find your drive list. type = lsblk -f 
    
    (You only need to do below if your drive temp is NOT working with Conky as in most ssd & m2 drives)
    
    example = hddtemp /dev/sdb 
    /dev/sdb: Samsung SSD 850 EVO 500G B        WARNING: Drive /dev/sda doesn't seem to have a temperature sensor
    
    3 = sudo smartctl /dev/sdb -a | grep -i Temp  (Change /dev/sdb to your drive , you need the first number of the read out mine was 190)
    
    example below under SAMSUNG
    "Samsung SSD 840 EVO 250G B"        190  C  "Samsung SSD 840 EVO 250G B"
    "Samsung SSD 850 EVO 250G B"        190  C  "Samsung SSD 850 EVO 250G B"
    "Samsung SSD 850 EVO 500G B"        190  C  "Samsung SSD 850 EVO 500G B"
    "Samsung SSD 850 EVO M.2"           190  C  "Samsung SSD 850 EVO M.2"
    "Samsung SSD 860 EVO 250G B"        190  C  "Samsung SSD 860 EVO 250G B"
    "Samsung SSD 860 EVO 500G B"        190  C  "Samsung SSD 860 EVO 500G B"
    
    The read out from hddtemp /dev/sdb is Samsung SSD 850 EVO 500G B this must be added to your hddtemp.db exactly the same NOTE upper and lower case and the gap between 250G B as above..

    T430 i7-3632QM 16gb , antiX-19.2.1-runit_x64-base Hannie Schaft 29 March 2020 , 5.8.16-antix.1-amd64-smp

    #55590
    Member
    sybok
    Helpful
    Up
    0
    :D

    Interestingly, one can write a ‘udev’ rule (located in ‘/etc/udev/rules.d/’) to trigger such a script.
    Currently (too) busy at (both) work (and private life) but if my interest does not wane in the meantime, I will be definitely at least tempted to take a stab at it.

    #55597
    Member
    uxer
    Helpful
    Up
    0
    :D

    1.1 Feel free to modify your local conky setup, ‘~/.conkyrc’.
    Change ‘fs_used’ to ‘fs_free’ and ‘Used’ to ‘Free’ in the appropriate places.
    […] you may code it and share with others (as some of the members, e.g. PPC and others, do).
    […] Not quite sure if the interest (of devs to do/include it) would be sufficient.[…]

    I feel free to opine that it should be out-of-the-box.
    Me, I would rather pick something from https://www.deviantart.com/custom-linux/gallery/39357745/Conky-Themes like this one https://www.deviantart.com/speedracker/art/Red-NSA-Conky-388553986 :
    Deviantart-hosted Conky theme to my liking
    and rehash it to my liking.

    Do you have your home folder install in root folder. Or is home separate in it own portion.

    ‘/home’ and not only it are separate in their own partitions, as can be seen from ‘df’ output on the provided screenshot.

    In my message ‘Conky should show not just root but all mounted filesystems, including temporarily plugged via USB’,
    regular/persistent filesystems like ‘/home’ or ‘/boot’ or ‘/var/www’ etc. have been overlooked.
    Even if it is not antiX-way to be interactive for the resources’ sake, at least regular filesystems should be displayed.

    Still, I am surprised about the wrong usage reported.
    Could it be the running out of space?

    Well, ‘pcmanfm’ file manager showed ‘Free space: 0 MiB’

    a simple ‘df -h’ executed in console suffices my needs.

    antiX seems to strive to cater to not only geeky folks but lay-users as well.

    to have a script periodically checking for new/disconnected devices.
    This is a background “service” eating my CPU/RAM resources

    Conky itself inevitably is eating your CPU/RAM resources.

    1.2 That would require to
    A) Stop the conky when new device plugged in/out.
    B) Dynamically (re)create the ~/.conkyrc file
    C) Start conky again.
    Of course, this can be scripted but I personally do not find the stopping and starting elegant.

    If it can be triggered only if a new device added and/or existing disconnected (may be, this is how ‘automount’ works?), this would be more elegant and this argument/reason no longer stands.
    But I have no idea how this could be done.
    B) Still, conky has to be quit and restarted.

    I haven’t played with Conky, but according to

    ${execpi 30 grep -v -E ^fuse|^udev|^lrm|^securityfs|^binfmt|^devpts|^tmpfs|^varlock|^varrun|^sysfs|^/proc /etc/mtab | cut -d” ” -f2 | while read line ; do
    echo $line ‘${goto 160}${fs_used ‘$line’} ${alignr}${fs_size ‘$line’}’
    done }

    from https://wynneth.wordpress.com/2009/02/02/conkymounts-script-by-wyn-my-custom-conky-config/ , no need to restart.
    Haven’t found /etc/mtab on my machine, but https://unix.stackexchange.com/questions/24182/how-to-get-the-complete-and-exact-list-of-mounted-filesystems-in-linux may be a way to a solution.
    Although aforementioned config relies on additional grep, cut, while loop and echo, which definitely consume a modicum of CPU/RAM resources,
    what is the point of having a dynamic system monitor which does not monitor dynamically?

    A sidenote on CPU resources: antiX’ https://www.antixforum.com in antiX’ firefox-esr hogs almost half of my Core 2 Duo power.
    Even a sci-fi spacecraft themed Conky is incomparably modest in this regard.

    Currently (too) busy at (both) work (and private life)

    You hit the issue. Or the issue hits us…

    #55603
    Member
    Koo
    Helpful
    Up
    0
    :D

    @uxer Looks like you know what you want. There is nothing more accurate then a file manager. Conky is just an indicator take it as you wish.

    To me I have no interest in how much free space any of my system folders have, as they just don’t grow much at anyway. All I like to keep an eye on is my home folder size, but even this to me is not that important as most my downloads go to storage drive.

    T430 i7-3632QM 16gb , antiX-19.2.1-runit_x64-base Hannie Schaft 29 March 2020 , 5.8.16-antix.1-amd64-smp

    #55609
    Member
    seaken64
    Helpful
    Up
    0
    :D

    I feel free to opine that it should be out-of-the-box.

    antiX seems to strive to cater to not only geeky folks but lay-users as well.

    Conky itself inevitably is eating your CPU/RAM resources.

    Since we’re sharing opinions, I think too many people want everything in the box. Not picking a fight here. Just sharing my opinion that obviously differs from your own. There is only so much that can be in the box before it no longer fits.

    Personally, I do not think that antiX caters to lay-users, whatever that is. The geeks are the clergy in this metaphor? Anyway, I think antiX makes it possible to get the most out of your computer without trying to cram everything into the box. It provides some nice layouts that simulate a “desktop environment” while not actually forcing a particular environment on the user. The user can modify the environment to fit their own tastes. For me, it has made it easier for me to become a Debian user and a Linux user. Before antiX I was struggling to install software because I was having a hard time understanding repositories, kernels, modules, source files, etc. antiX may not be the easiest and does not have everything out of the box. But it is a nice tool for a user to make something fit for their own use.

    On my systems with limited memory resources I turn Conky off. On some of my systems I modify the conky config files to meet my needs. There’s a lot of stuff in the “box” that I don’t care about. But’s that’s just my own opinion. If you want a different conky display then go for it. It’s your computer.

    Welcome to antiX uxer.

    Seaken64

    #55611
    Forum Admin
    anticapitalista
    Helpful
    Up
    0
    :D

    The word ‘misinformation’ implies that antiX is deliberately giving wrong information.

    false or inaccurate information, especially that which is deliberately intended to deceive.

    @uxer – Is that what you really want to say?

    Philosophers have interpreted the world in many ways; the point is to change it.

    antiX with runit - leaner and meaner.

    #55613
    Moderator
    christophe
    Helpful
    Up
    0
    :D

    Hey, uxer.
    Being practical at heart, I thought you may want to add this at the end of your ~/.conkyrc

    
    ${color}DISK SPACE FREE:
    ${color8}root:${alignr}${fs_free /}
    ${color}home:${alignr}${fs_free /home}
    ${color8}boot device:${alignr}${fs_free /live/boot-dev}
    ${color}===============

    It looks nice, and shows free space for / , /home, and the boot device, if your are running live.

    Use it royalty-free! 😉

    #55640
    Member
    uxer
    Helpful
    Up
    0
    :D

    The word ‘misinformation’ implies that antiX is deliberately giving wrong information.
    @uxer – Is that what you really want to say?

    @anticapitalista :

    Disinformation vs misinformation.

    Disinformation is a type of misinformation that is intentionally false and intended to deceive or mislead.
    Misinformation refers to false or out-of-context information that is presented as fact regardless of an intent to deceive.

    Disinformation is deliberate and is a subset of misinformation.
    Misinformation is a superset of disinformation and may be both deliberate or not.

    I believe it is perchance.

    It is distorted by nature of storage and filesystems. Not only Conky suffers. Look at ‘df’ output for ‘/’ on the screenshot:
    1K-blocks — 20511312; Used — 19029716; Available — 416636.
    But 20511312 – 19029716 = 1481596, which is over a GB more than 416636. The same issue. This is why it may be more correct to show available space instead of used in Conky. Or both available and used.

    On which filesystems to display:
    You see, antiX’ installer allows users to split installation into multiple filesystems, whereas antiX’ Conky displays root only. Consistency is lacking.

    #55643
    Member
    Koo
    Helpful
    Up
    0
    :D

    This post is going no where. I can’t believe some users really.

    T430 i7-3632QM 16gb , antiX-19.2.1-runit_x64-base Hannie Schaft 29 March 2020 , 5.8.16-antix.1-amd64-smp

    #55649
    Member
    uxer
    Helpful
    Up
    0
    :D

    This post is going no where. I can’t believe some users really.

    @Koo : if you wrote on free and used space not adding up,
    man 8 tune2fs

    -m reserved-blocks-percentage
    Set the percentage of the filesystem which may only be allocated by privileged processes. Reserving some number of filesystem blocks for use by privileged processes is done to avoid filesystem fragmentation, and to allow system daemons, such as syslogd(8), to continue to function correctly after non-privileged processes are prevented from writing to the filesystem. Normally, the default percentage of reserved blocks is 5%.

    My 1 GB difference on a 20 GB filesystem is 5% which matches the description. Almost matches, so to say…

    #55683
    Member
    skidoo
    Helpful
    Up
    0
    :D

    execpi is very efficient
    each call into vfs to check stats is an unremarkable, unnoticeable, millisecond blip

    That pasted snippet from wynneth.wordpress is wonky. It is full of dirpathname patterns?

    Regardless whether “df- h” or “fs_free”, is the mechanism peeking actual filesystems, or overlaid mountpoints? (If the latter, what items to filter? During a liveboot session, several are tmpfs and are either uninteresting or, again, “misleading”)

    When spilling over into swap as seen in the screenshot of post #1, can the monitor ever be relied on to be “correct”? Cannot guess whether or how much content residing in the swap is there awaiting the next (lazy) sync call or is bottlenecked waiting to be written to disk.

    My 1 GB difference on a 20 GB filesystem is 5% which matches the description

    Yes, and matches a comments in this conky issue ticket discussion:

    https://github.com/brndnmtthws/conky/issues/296

    [..]
    the used size is calculated as fs->size – fs->free, while the free size is directly from fs->avail.

    In the case of my ntfs filesystems, avail and free are identical. For my btfrs one, they are nearly the same. For my ext4 ones, they are quite different, the difference is 5% of the total size.

    I think this isn’t a bug. From what I’ve read there https://ubuntuforums.org/showthread.php?t=2180267, in ext4 filesystems, 5% are reserved for the superuser. So if you have 90% used, it’s actually as if you had 95% used (I think nautilus and df report 95%, while conky reports 90%).

    If you want to change the behavior, replace fs->size – fs->free by fs->size – fs->avail in those two blocks of code above and rebuild conky. That’s what I did.

    [..]

    this is due to the space reserved to root (~10%)
    if you use df, it shows the free space without the root space (free space minus root space)
    if you use discus for instance, you’ll get the exact free space
    if you use discus -r, the result shall be the same of df, because the -r argument of discus means taking into account the root space

    related: https://askubuntu.com/questions/960184/wrong-file-system-size-in-conky

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.