Merge pull request #1412 from powersj/fix/dm-resolution

fix(disk): correctly replace /dev in /dev/mapper
pull/1423/head
shirou 2 years ago committed by GitHub
commit b51f72ebfb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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
}

Loading…
Cancel
Save