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
|
re := regexp.MustCompile(`^/dev/mapper/(.*)-(.*)`) |
, 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)
On my system, I have use LVM for my filesystem and one logical volume I have is named
var-logsince it's mounted in/var/log. This causesdufto incorrectly display it as/dev/vg-var-/logdue to the regex atduf/mounts_linux.go
Line 112 in b9b8077
/dev/vg/var-log. I suggest that if more than 1 hyphen is detected, just display the full/dev/mapperpath 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)