AstraExt / astra-monitor

Resource Monitor for GNOME shell
GNU General Public License v3.0
223 stars 12 forks source link

No disk usage displayed #99

Closed fischer-felix closed 2 months ago

fischer-felix commented 2 months ago

Description

Trying to set up the Storage monitor, only the I/O graph works, however no information relating to used/free space is shown.

Steps to Reproduce

  1. Install Astra Monitor
  2. Toggle Usage Bar, Usage Percentage, Usage Value & Free Value in Storage settings

Screenshots

image image

Environment

Logs

Output of lsblk

NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda           8:0    0 931.5G  0 disk 
├─sda1        8:1    0  55.9G  0 part 
└─sda3        8:3    0 856.2G  0 part /bulk
sdb           8:16   1     0B  0 disk 
nvme0n1     259:0    0 931.5G  0 disk 
├─nvme0n1p1 259:1    0   300M  0 part /boot/efi
├─nvme0n1p2 259:2    0   225G  0 part /
├─nvme0n1p3 259:3    0 696.2G  0 part /local
└─nvme0n1p4 259:4    0    10G  0 part [SWAP]

Output of df -h

Filesystem      Size  Used Avail Use% Mounted on
dev             7.8G     0  7.8G   0% /dev
run             7.8G  2.2M  7.8G   1% /run
efivarfs        128K   53K   71K  43% /sys/firmware/efi/efivars
/dev/nvme0n1p2  221G  157G   54G  75% /
tmpfs           7.8G   31M  7.8G   1% /dev/shm
tmpfs           7.8G   14M  7.8G   1% /tmp
/dev/nvme0n1p1  300M  4.0M  296M   2% /boot/efi
/dev/nvme0n1p3  685G  545G  106G  84% /local
/dev/sda3       842G  777G   23G  98% /bulk
tmpfs           1.6G  364K  1.6G   1% /run/user/1000

Additional Context

ljuzig commented 2 months ago

I need you to run the following command and paste here the output in order to better understand what's the root cause of this bug: lsblk -Jb -o ID,UUID,NAME,KNAME,PKNAME,LABEL,TYPE,SUBSYSTEMS,MOUNTPOINTS,VENDOR,MODEL,PATH,RM,RO,STATE,OWNER,SIZE,FSUSE%,FSTYPE

Also, I guess you have stock settings, but just for the sake of thoroughness, could you take a screen to the ignored devices section in the storage tab as in the example below? image

and which lsblk possibly.

Thank you!

fischer-felix commented 2 months ago

Well, thanks to which lsblk I was able to figure it out.

Initially the output of lsblk -Jb -o ID,UUID,NAME,KNAME,PKNAME,LABEL,TYPE,SUBSYSTEMS,MOUNTPOINTS,VENDOR,MODEL,PATH,RM,RO,STATE,OWNER,SIZE,FSUSE%,FSTYPE was just

lsblk: unknown column: ID,UUID,NAME,KNAME,PKNAME,LABEL,TYPE,SUBSYSTEMS,MOUNTPOINTS,VENDOR,MODEL,PATH,RM,RO,STATE,OWNER,SIZE,FSUSE%,FSTYPE

and the settings in the extension showed no devices at all. Screenshot from 2024-04-11 12-09-44

I did, however, notice that lsblk was installed though brew, so which lsblk returned

/home/linuxbrew/.linuxbrew/bin/lsblk

I just uninstalled brew altogether since I didn't need it any more, but fixing the order in PATH should also suffice.

After this, lsblk was installed in /usr/bin/lsblk and the command now returns

this ```json { "blockdevices": [ { "id": "0x50004cf208b96a7b", "uuid": null, "name": "sda", "kname": "sda", "pkname": null, "label": null, "type": "disk", "subsystems": "block:scsi:pci", "mountpoints": [ null ], "vendor": "ATA ", "model": "ST1000LM024 HN-M101MBB", "path": "/dev/sda", "rm": false, "ro": false, "state": "running", "owner": "root", "size": 1000204886016, "fsuse%": null, "fstype": null, "children": [ { "id": "0x50004cf208b96a7b-part1", "uuid": "1f1fa2ab-043a-4459-b684-97eb897c97dd", "name": "sda1", "kname": "sda1", "pkname": "sda", "label": null, "type": "part", "subsystems": "block:scsi:pci", "mountpoints": [ null ], "vendor": null, "model": null, "path": "/dev/sda1", "rm": false, "ro": false, "state": null, "owner": "root", "size": 59998470144, "fsuse%": null, "fstype": "ext4" },{ "id": "0x50004cf208b96a7b-part3", "uuid": "0c79fa97-3672-4cc7-8e5a-b2b7634634d3", "name": "sda3", "kname": "sda3", "pkname": "sda", "label": "/bulk", "type": "part", "subsystems": "block:scsi:pci", "mountpoints": [ "/bulk" ], "vendor": null, "model": null, "path": "/dev/sda3", "rm": false, "ro": false, "state": null, "owner": "root", "size": 919356833792, "fsuse%": "92%", "fstype": "ext4" } ] },{ "id": "CT1000P1SSD8_20512C54FFA6", "uuid": null, "name": "nvme0n1", "kname": "nvme0n1", "pkname": null, "label": null, "type": "disk", "subsystems": "nvme:pci", "mountpoints": [ null ], "vendor": null, "model": "CT1000P1SSD8", "path": "/dev/nvme0n1", "rm": false, "ro": false, "state": "live", "owner": "root", "size": 1000204886016, "fsuse%": null, "fstype": null, "children": [ { "id": "CT1000P1SSD8_20512C54FFA6-part1", "uuid": "7012-90DE", "name": "nvme0n1p1", "kname": "nvme0n1p1", "pkname": "nvme0n1", "label": "NO_LABEL", "type": "part", "subsystems": "block:nvme:pci", "mountpoints": [ "/boot/efi" ], "vendor": null, "model": null, "path": "/dev/nvme0n1p1", "rm": false, "ro": false, "state": null, "owner": "root", "size": 314572800, "fsuse%": "1%", "fstype": "vfat" },{ "id": "CT1000P1SSD8_20512C54FFA6-part2", "uuid": "3bcdf457-b3ea-4684-87ad-f241e320472d", "name": "nvme0n1p2", "kname": "nvme0n1p2", "pkname": "nvme0n1", "label": "/", "type": "part", "subsystems": "block:nvme:pci", "mountpoints": [ "/" ], "vendor": null, "model": null, "path": "/dev/nvme0n1p2", "rm": false, "ro": false, "state": null, "owner": "root", "size": 241608687616, "fsuse%": "75%", "fstype": "ext4" },{ "id": "CT1000P1SSD8_20512C54FFA6-part3", "uuid": "119971a1-f298-4a76-9af4-7515b5b26df6", "name": "nvme0n1p3", "kname": "nvme0n1p3", "pkname": "nvme0n1", "label": "/local", "type": "part", "subsystems": "block:nvme:pci", "mountpoints": [ "/local" ], "vendor": null, "model": null, "path": "/dev/nvme0n1p3", "rm": false, "ro": false, "state": null, "owner": "root", "size": 747541364736, "fsuse%": "80%", "fstype": "ext4" },{ "id": "CT1000P1SSD8_20512C54FFA6-part4", "uuid": "36b4bff7-91a6-4153-9561-54d35f46de7d", "name": "nvme0n1p4", "kname": "nvme0n1p4", "pkname": "nvme0n1", "label": null, "type": "part", "subsystems": "block:nvme:pci", "mountpoints": [ "[SWAP]" ], "vendor": null, "model": null, "path": "/dev/nvme0n1p4", "rm": false, "ro": false, "state": null, "owner": "root", "size": 10737418240, "fsuse%": null, "fstype": "swap" } ] } ] } ```

and the devices actually show up in Astra Monitor after restarting the extension Screenshot from 2024-04-11 12-16-41

Maybe part of the dependency check should be a check if a compatible version of a dependency is installed, to cover edge cases like this one.

ljuzig commented 2 months ago

I considered using which to locate the path to the various dependencies but then discarded it because it may possibly lead to security flaws in the future. Yours is a very edge case, if I receive several more reports I will introduce an additional setting to fix this problem.