duf icon indicating copy to clipboard operation
duf copied to clipboard

BUG: /dev/mapper mount paths incorrectly parsed

Open jaschiu opened this issue 3 months ago • 0 comments

On my system, I have use LVM for my filesystem and one logical volume I have is named var-log since it's mounted in /var/log. This causes duf to incorrectly display it as /dev/vg-var-/log due to the regex at https://github.com/muesli/duf/blob/b9b80772e36a2f8530c97bb4a47f13ee58c50c23/mounts_linux.go#L112, when it really should be /dev/vg/var-log. I suggest that if more than 1 hyphen is detected, just display the full /dev/mapper path since it could be possible that the volume group also contains a hyphen, so using a lazy quantifier is not necessarily the solution.

EDIT: its full path is /dev/mapper/vg-var--log, so a regex of ^/dev/mapper/(.*?[^-])?-([^-].*)?$ should work (haven't tested this)

jaschiu avatar Sep 14 '25 19:09 jaschiu