Skip to content

Commit

Permalink
Merge pull request #1412 from powersj/fix/dm-resolution
Browse files Browse the repository at this point in the history
fix(disk): correctly replace /dev in /dev/mapper
  • Loading branch information
shirou authored Feb 18, 2023
2 parents 1c27744 + d22f238 commit b51f72e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion disk/disk_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ func PartitionsWithContext(ctx context.Context, all bool) ([]PartitionStat, erro
}

if strings.HasPrefix(d.Device, "/dev/mapper/") {
devpath, err := filepath.EvalSymlinks(common.HostDev(strings.Replace(d.Device, "/dev", "", -1)))
devpath, err := filepath.EvalSymlinks(common.HostDev(strings.Replace(d.Device, "/dev", "", 1)))
if err == nil {
d.Device = devpath
}
Expand Down

0 comments on commit b51f72e

Please sign in to comment.