Announcement

Collapse
No announcement yet.

Another Conky Question

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [SOLVED] Another Conky Question

    Here is an excerpt of my conky screen:

    Click image for larger version

Name:	Screenshot_20181227_100201.png
Views:	1
Size:	76.9 KB
ID:	649426

    Why do the Used + Free NOT= Total? I understand rounding errors, but 6GB off? Here is the script excerpt for this section:

    Code:
    ######### DISK USAGE ############
    ${color CC9900}${font Arial:style=Bold}DISK USAGE${hr 2}$color$font
    ${color2} ${alignr}                                Used    Free    Total  
    
    ${color2}Root: ${color}${alignr} ${fs_used_perc /}%      ${fs_used /} / ${fs_free /} / ${fs_size /}
    ${fs_bar 12 /}
    
    ${color2}Data: ${color}${alignr}${fs_used_perc /media/Data}%      ${fs_used /media/Data} / ${fs_free /media/Data} / ${fs_size /media/Data}
    ${fs_bar 12 /media/Data}
    ${if_mounted /media/NAS}
    ${color2}NAS: ${color}${alignr} ${fs_used_perc /media/NAS}%      ${fs_used /media/NAS} / ${fs_free /media/NAS} / ${fs_size /media/NAS}
    ${fs_bar 12 /media/NAS}
    ${endif}
    Unfortunately, I'm constrained by the conky variables available, but there has to be a way to get better resolution than 6GB of error on a 120GB SSD. Any ideas?
    "If you're in a room with another person who sees the world exactly as you do, one of you is redundant." Dr. Steven Covey, The 7-Habits of Highly Effective People

    #2
    Well, the conky objects fs_used, fs_free, and fs_size don't refer to the drive but to the file system installed on the drive. And as we all know, the stated size of a drive isn't the same as the space that an installed file system occupies on that drive. Just look at the maximum size of a partition you can create on any drive of a given size. The larger the drive is, the greater the discrepancy between the max partition size and the drive size is.
    Using Kubuntu Linux since March 23, 2007
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment


      #3
      One reason might be that the default for EXT4 filesystem sis to reserve %5 of file system space. This command;

      sudo tune2fs -l /dev/sda5 |grep 'Reserved block'

      will show you how much is reserved. If you're using BTRFS, "df" will not show you an accurate number;

      Code:
      [FONT=monospace][COLOR=#54FF54][B]stuart@office[/B][/COLOR][COLOR=#000000]:[/COLOR][COLOR=#5454FF][B]~[/B][/COLOR][COLOR=#000000]$ df /[/COLOR]
      Filesystem      Size  Used Avail Use% Mounted on
      /dev/nvme0n1p3  461G  366G   94G  80% /
      [COLOR=#54FF54][B]stuart@office[/B][/COLOR][COLOR=#000000]:[/COLOR][COLOR=#5454FF][B]~[/B][/COLOR][COLOR=#000000]$ sudo btrfs fi df /[/COLOR]
      Data, single: total=401.01GiB, used=361.92GiB
      System, single: total=4.00MiB, used=64.00KiB
      Metadata, single: total=6.01GiB, used=3.20GiB
      GlobalReserve, single: total=512.00MiB, used=0.00B
      
      [/FONT]

      Please Read Me

      Comment


        #4
        Hmmm. I'm only using btrfs on my NAS. My computer fs is ext4. My root drive is /dev/sda1. Using tune2fs, the block count for sda1 is 31258368. I assume that's 312,568,368 bytes or 312MB. its Reserved block count is even less, 1562918 or 1.6MB. /dev/sda is an SSD by the way. I don't know if that makes a difference.

        The Data drive (/dev/sdb1) is a conventional HDD.
        Block Count: 122096000 (122.1MB)
        Reserved Block Count: 6104799 (6.1MB)

        df / reports 23% used vs conky's 21%
        1k-Blocks (total size?): 122,546,800
        Used : 26,326,652
        Available : 89,952,092

        So Used + Available = 116,278,744 which is a difference of 6,268,056 or 6.3MB.

        Not as accurate as I would like, and that's because the measurements are done on the fs occupying the disk rather than the disk itself. Is that correct? In other words it's something I have to live with.

        I think I could improve the accuracy if I used lua scripts. That would take a lot of effort for a small ROI I think. Thanks for responding.
        "If you're in a room with another person who sees the world exactly as you do, one of you is redundant." Dr. Steven Covey, The 7-Habits of Highly Effective People

        Comment


          #5
          The reality is a partition, and thus, the file system installed to it, won't ever be larger than the physical reported size of the drive. So knowing how much space on the file system is 'available' is really all you need to be concerned about.
          Using Kubuntu Linux since March 23, 2007
          "It is a capital mistake to theorize before one has data." - Sherlock Holmes

          Comment


            #6
            Originally posted by mhumm2 View Post
            Not as accurate as I would like, and that's because the measurements are done on the fs occupying the disk rather than the disk itself. Is that correct? In other words it's something I have to live with.

            I think I could improve the accuracy if I used lua scripts. That would take a lot of effort for a small ROI I think. Thanks for responding.
            You're heading town a path to crazy-town, LOL. Some things are better just accepted, like not knowing the location of every bit in a sea of gigabytes. There's no need nor any benefit.

            Please Read Me

            Comment


              #7
              I think that the point is, the OS wants - and WILL take - the space it needs for its own purposes. No way around it, whatever that purpose may be. Our job is to manage what's left.

              A complete partnership
              The next brick house on the left
              Intel i7 11th Gen | 16GB | 1TB | KDE Plasma 5.24.7 | Kubuntu 22.04.4 | 6.5.0-18-generic

              Comment


                #8
                How many people, on this forum, can say they've been "talked down" (from doing crazy stuff) by oshunluvr <grin>? You're absolutely correct, my friend. I'll remove the "total" field and be happy with "used" and "free." Thanks snowhog and jglen490 for the "intervention" <LOL>, good job.
                "If you're in a room with another person who sees the world exactly as you do, one of you is redundant." Dr. Steven Covey, The 7-Habits of Highly Effective People

                Comment


                  #9
                  Just my 2 cents, but I think you can add the Used and Free together within Conky. That way if you really need a quick visual. Then again I recently removed all of that from my Conky. Went lean.

                  Comment

                  Working...
                  X