xxxserxxx / gotop

A terminal based graphical activity monitor inspired by gtop and vtop
Other
2.76k stars 140 forks source link

Use disk label for 'Disk Usage' panel #169

Closed totoroot closed 3 years ago

totoroot commented 3 years ago

Hey there,

Not sure if that's more of a bug report or a feature request, but the information displayed in my 'Disk Usage' panel could be improved.

image

My disks are mostly mounted by label as you can see in my /etc/fstab:

# Filesystems.
/dev/disk/by-label/nixos / ext4 defaults 0 1
/dev/disk/by-label/boot /boot vfat defaults 0 2
/dev/disk/by-label/home /home ext4 noatime 0 2
/dev/disk/by-label/data /mnt/data ext4 noatime 0 2
/dev/disk/by-label/photos /mnt/photos ext4 noatime 0 2
/dev/disk/by-uuid/bd55c91f-6e1a-40ed-a303-e68fe700df9b /mnt/system ext4 noatime 0 2

The ideal solution would be to make it configurable via config to either display the devices names for all disks like sda, sdb etc. or just the set labels (in this case nixos, home, photos etc.) without /dev/disk-by-label/. Another solution could be to default to displaying the labels if disks are mounted by labels and and show device names if they are mounted by uuid or device name.

Please let me know if you need any additional information.

Thanks in advance!

gotop version:

gotop 0.0.0 (Hadean) --> installed with go get; therefore should be most recent version

OS/Arch:

5.10.15 GNU/Linux (NixOS Stable)

Terminal emulator:

kitty

Any relevant hardware info:

n.a.

tmux version:

n.a.

Also please copy or attach ~/.local/state/gotop/errors.log if it exists and contains logs: n.a.

xxxserxxx commented 3 years ago

I'm going to label it an enhancement, although it's borderline and I agree less than ideal. The device names come from gopsutil, and I think the fstab is irrelevant; in mine, all of my devices are by UUID but gopsutil returns the /dev device. Which disk and partition is /dev/disk/by-label/nixos on your system? Is it an LVM logical volume, or a straightforward partition? Can you paste the output of mount for me, or more specifically, something like mount | grep /dev/sd?

totoroot commented 3 years ago

Thanks for your response! My partitioning scheme is currently a little messed up, but there are currently no logical volumes and everything is formatted to ext4 apart from the boot partition:

/dev/sda1 on / type ext4 (rw,relatime)
/dev/sda1 on /nix/store type ext4 (ro,relatime)
/dev/sda4 on /boot type vfat (rw,relatime,...)
/dev/sdd1 on /mnt/data type ext4 (rw,noatime)
/dev/sdc1 on /mnt/photos type ext4 (rw,noatime)
/dev/sda2 on /home type ext4 (rw,noatime)

There is an additional swap partition on /dev/sda3 but it is currently not in use.