From 23dfe986213d242ba4f6b4ba9f70e9fa5ceac364 Mon Sep 17 00:00:00 2001 From: Nico Vinzens Date: Wed, 17 Oct 2018 14:45:40 +0200 Subject: [PATCH] use HostSys to construct device path --- disk/disk_linux.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/disk/disk_linux.go b/disk/disk_linux.go index e474726..dd62f88 100644 --- a/disk/disk_linux.go +++ b/disk/disk_linux.go @@ -272,8 +272,7 @@ func PartitionsWithContext(ctx context.Context, all bool) ([]PartitionStat, erro // /dev/root is not the real device name // so we get the real device name from its major/minor number if d.Device == "/dev/root" { - link := "/sys/dev/block/" + blockDeviceID - devpath, err := os.Readlink(link) + devpath, err := os.Readlink(common.HostSys("/dev/block/" + blockDeviceID)) if err != nil { return nil, err }