Skip to content

Disk usage values overlap when using a custom mount #5

@timberhill

Description

@timberhill

Hi, I have encountered a bug when using a custom mountpoint override for the drives - there are two usage text instances that overlap in the same box.

My drive setup:

pibox:~ $ lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda            8:0    0  1.8T  0 disk 
└─sda1         8:1    0  1.8T  0 part /mnt/nas
sdb            8:16   0  1.8T  0 disk 
└─sdb1         8:17   0  1.8T  0 part /mnt/nas-backup
mmcblk0      179:0    0  7.3G  0 disk 
├─mmcblk0p1  179:1    0  256M  0 part /boot
└─mmcblk0p2  179:2    0    7G  0 part /
mmcblk0boot0 179:32   0    4M  1 disk 
mmcblk0boot1 179:64   0    4M  1 disk 

pibox:~ $ du -h /mnt/nas  #some data here
...
314M    /mnt/nas

pibox:~ $ sudo du -h /mnt/nas-backup  #currently empty
...
20K     /mnt/nas-backup

The override:

pibox:~ $ sudo systemctl status pibox-framebuffer
● pibox-framebuffer.service
     Loaded: loaded (/etc/systemd/system/pibox-framebuffer.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/pibox-framebuffer.service.d
             └─bar_override.conf
     Active: active (running) since Fri 2022-10-21 16:05:48 BST; 19min ago
   Main PID: 8008 (pibox-framebuff)
      Tasks: 8 (limit: 8986)
     Memory: 6.6M
        CPU: 33.698s
     CGroup: /system.slice/pibox-framebuffer.service
             └─8008 /opt/kubesail/pibox-framebuffer

Oct 21 16:05:48 pibox systemd[1]: Started pibox-framebuffer.service.
Oct 21 16:05:48 pibox pibox-framebuffer[8008]: Displaying on fb0
Oct 21 16:05:48 pibox pibox-framebuffer[8008]: Listening on socket: /var/run/pibox/framebuffer.sock

pibox:~ $ cat /etc/systemd/system/pibox-framebuffer.service.d/bar_override.conf

[Service]
Environment = "DISK_MOUNT_PREFIX=/mnt/nas"

It looks like it might be showing both drives in the same place, because the sizes above approximately match the ones on the screen and if they have the same files (cp -r /mnt/nas/* /mnt/nas-backup/), then there is no overlap on the screen. If I set the DISK_MOUNT_PREFIX override to /mnt/nas-backup/, then it only shows the single drive usage.

It looks like this code draws the box, but does not add an offset between the two.

Please let me know if there is any more info that would be helpful! I am not very familiar with golang, but could try raising a PR when I get some time and if that's okay :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions