fastfetch-cli / fastfetch

A maintained, feature-rich and performance oriented, neofetch like system information tool.
MIT License
11k stars 425 forks source link

fastfetch shows a disk partition twice #396

Closed Aleksanaa closed 1 year ago

Aleksanaa commented 1 year ago

General description of bug:

If there are several bind-mount mountpoints, each of them will be shown, which doesn't make sense.

My recommendation is sort them by time (just as mount do) and only show the earliest mountpoint for a block device.

This is what fastfetch shows:

Disk (/etc/NetworkManager/system-connections): 9.80 GiB /)
Disk (/etc/nixos): 9.80 GiB / 128 GiB (7%)
Disk (/home/aleksana): 120 GiB / 320 GiB (37%)
Disk (/nix): 9.80 GiB / 128 GiB (7%)
Disk (/nix/store): 9.80 GiB / 128 GiB (7%)
Disk (/var/lib): 9.80 GiB / 128 GiB (7%)

And this is what df -hl shows:

Filesystem                  Size  Used Avail Use% Mounted on
none                        2.0G  210M  1.8G  11% /
/dev/dm-0                   128G  9.0G  119G   8% /nix
tmpfs                       3.4G   15M  3.4G   1% /run
devtmpfs                    693M     0  693M   0% /dev
tmpfs                       6.8G  3.4M  6.8G   1% /dev/shm
tmpfs                       6.8G  408K  6.8G   1% /run/wrappers
/dev/nvme0n1p1             1022M   33M  990M   4% /boot
/dev/mapper/_dev_nvme0n1p3  320G  117G  200G  37% /home/aleksana
tmpfs                       1.4G  1.7M  1.4G   1% /run/user/1000

This is what mount shows:

none on / type tmpfs (rw,relatime,size=2097152k,mode=755)
/dev/mapper/nix on /nix type btrfs (rw,noatime,compress=lzo,ssd,discard,space_cache=v2,subvolid=5,subvol=/)
/dev/mapper/nix on /var/lib type btrfs (rw,noatime,compress=lzo,ssd,discard,space_cache=v2,subvolid=5,subvol=/)
tmpfs on /run type tmpfs (rw,nosuid,nodev,size=3546244k,nr_inodes=819200,mode=755)
devtmpfs on /dev type devtmpfs (rw,nosuid,size=709252k,nr_inodes=1769209,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=3,mode=620,ptmxmode=666)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,size=7092488k)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
ramfs on /run/keys type ramfs (rw,nosuid,nodev,relatime,mode=750)
tmpfs on /run/wrappers type tmpfs (rw,nodev,relatime,size=7092488k,mode=755)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
/dev/mapper/nix on /nix/store type btrfs (ro,noatime,compress=lzo,ssd,discard,space_cache=v2,subvolid=5,subvol=/)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
ramfs on /run/credentials/systemd-tmpfiles-setup-dev.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
/dev/mapper/nix on /etc/NetworkManager/system-connections type btrfs (rw,noatime,compress=lzo,ssd,discard,space_cache=v2,subvolid=5,subvol=/)
/dev/mapper/nix on /etc/nixos type btrfs (rw,noatime,compress=lzo,ssd,discard,space_cache=v2,subvolid=5,subvol=/)
ramfs on /run/credentials/systemd-sysctl.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
/dev/nvme0n1p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
ramfs on /run/credentials/systemd-tmpfiles-setup.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
/dev/mapper/_dev_nvme0n1p3 on /home/aleksana type btrfs (rw,relatime,ssd,space_cache=v2,subvolid=5,subvol=/,helper=crypt)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=1418496k,nr_inodes=354624,mode=700,uid=1000,gid=100)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=100)
portal on /run/user/1000/doc type fuse.portal (rw,nosuid,nodev,relatime,user_id=1000,group_id=100)

Often helpful questions:

Output of fastfetch --version:

1.8.2

The following contents aren't helpful since I'm using nixos.

LinusDierheimer commented 1 year ago

Can you please post the content of /proc/mounts?

Aleksanaa commented 1 year ago

Can you please post the content of /proc/mounts?

Obviously the same with the mount command output above.

Aleksanaa commented 1 year ago

Can you please post the content of /proc/mounts?

And this is what matters:

/dev/mapper/nix on /nix type btrfs (rw,noatime,compress=lzo,ssd,discard,space_cache=v2,subvolid=5,subvol=/)
/dev/mapper/nix on /var/lib type btrfs (rw,noatime,compress=lzo,ssd,discard,space_cache=v2,subvolid=5,subvol=/)
/dev/mapper/nix on /nix/store type btrfs (ro,noatime,compress=lzo,ssd,discard,space_cache=v2,subvolid=5,subvol=/)
/dev/mapper/nix on /etc/NetworkManager/system-connections type btrfs (rw,noatime,compress=lzo,ssd,discard,space_cache=v2,subvolid=5,subvol=/)
/dev/mapper/nix on /etc/nixos type btrfs (rw,noatime,compress=lzo,ssd,discard,space_cache=v2,subvolid=5,subvol=/)

As you can see, I'm using tmpfs as root, and a module named impermanence bind mount my /etc/nixos, /etc/NetworkManager and /var/lib to /nix/persist/<the corresponding dir>. The /nix/store is just a bind mount nixos sets to ensure that directory is readonly.

And this list seems to be sorted by time. So what we could do is just follow its order and only show once for every block device.

LinusDierheimer commented 1 year ago

Obviously the same with the mount command output above.

Its usually not exactly the same (mount sometimes adds "" and stuff like that) and since fastfetch parses the file, I need to know exactly what it has to look for.

Aleksanaa commented 1 year ago

Obviously the same with the mount command output above.

Its usually not exactly the same (mount sometimes adds "" and stuff like that) and since fastfetch parses the file, I need to know exactly what it has to look for.

none / tmpfs rw,relatime,size=2097152k,mode=755 0 0
/dev/dm-0 /nix btrfs rw,noatime,compress=lzo,ssd,discard,space_cache=v2,subvolid=5,subvol=/ 0 0
/dev/dm-0 /var/lib btrfs rw,noatime,compress=lzo,ssd,discard,space_cache=v2,subvolid=5,subvol=/ 0 0
tmpfs /run tmpfs rw,nosuid,nodev,size=3546244k,nr_inodes=819200,mode=755 0 0
devtmpfs /dev devtmpfs rw,nosuid,size=709252k,nr_inodes=1769209,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=3,mode=620,ptmxmode=666 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev,size=7092488k 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
ramfs /run/keys ramfs rw,nosuid,nodev,relatime,mode=750 0 0
tmpfs /run/wrappers tmpfs rw,nodev,relatime,size=7092488k,mode=755 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
/dev/dm-0 /nix/store btrfs ro,noatime,compress=lzo,ssd,discard,space_cache=v2,subvolid=5,subvol=/ 0 0
securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
cgroup2 /sys/fs/cgroup cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot 0 0
efivarfs /sys/firmware/efi/efivars efivarfs rw,nosuid,nodev,noexec,relatime 0 0
bpf /sys/fs/bpf bpf rw,nosuid,nodev,noexec,relatime,mode=700 0 0
mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec,relatime 0 0
hugetlbfs /dev/hugepages hugetlbfs rw,relatime,pagesize=2M 0 0
debugfs /sys/kernel/debug debugfs rw,nosuid,nodev,noexec,relatime 0 0
fusectl /sys/fs/fuse/connections fusectl rw,nosuid,nodev,noexec,relatime 0 0
configfs /sys/kernel/config configfs rw,nosuid,nodev,noexec,relatime 0 0
pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0
ramfs /run/credentials/systemd-tmpfiles-setup-dev.service ramfs ro,nosuid,nodev,noexec,relatime,mode=700 0 0
/dev/dm-0 /etc/NetworkManager/system-connections btrfs rw,noatime,compress=lzo,ssd,discard,space_cache=v2,subvolid=5,subvol=/ 0 0
/dev/dm-0 /etc/nixos btrfs rw,noatime,compress=lzo,ssd,discard,space_cache=v2,subvolid=5,subvol=/ 0 0
ramfs /run/credentials/systemd-sysctl.service ramfs ro,nosuid,nodev,noexec,relatime,mode=700 0 0
/dev/nvme0n1p1 /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0
ramfs /run/credentials/systemd-tmpfiles-setup.service ramfs ro,nosuid,nodev,noexec,relatime,mode=700 0 0
/dev/mapper/_dev_nvme0n1p3 /home/aleksana btrfs rw,relatime,ssd,space_cache=v2,subvolid=5,subvol=/ 0 0
tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=1418496k,nr_inodes=354624,mode=700,uid=1000,gid=100 0 0
gvfsd-fuse /run/user/1000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=100 0 0
portal /run/user/1000/doc fuse.portal rw,nosuid,nodev,relatime,user_id=1000,group_id=100 0 0
LinusDierheimer commented 1 year ago

git head should be working.

Aleksanaa commented 1 year ago

git head should be working.

No, it's still the same.

LinusDierheimer commented 1 year ago

Silly me was comparing mount paths instead of device paths. This time it should work.

Aleksanaa commented 1 year ago

Silly me was comparing mount paths instead of device paths. This time it should work.

It works! Thanks, I'll close this issue.