From d7405fd87376efc3079c865d3b9977a12ee193f6 Mon Sep 17 00:00:00 2001 From: Lomanic Date: Sun, 23 Jun 2019 17:38:42 +0200 Subject: [PATCH] [disk][linux] Follow symlinks with filepath.EvalSymlinks for LVM volumes See #686 --- disk/disk_linux.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/disk/disk_linux.go b/disk/disk_linux.go index d0dffa9..415669f 100644 --- a/disk/disk_linux.go +++ b/disk/disk_linux.go @@ -299,11 +299,11 @@ func PartitionsWithContext(ctx context.Context, all bool) ([]PartitionStat, erro } if strings.HasPrefix(d.Device, "/dev/mapper/") { - devpath, err := os.Readlink(d.Device) + devpath, err := filepath.EvalSymlinks(d.Device) if err != nil { return nil, err } - d.Device = "/dev/" + filepath.Base(devpath) + d.Device = devpath } // /dev/root is not the real device name