fix disk readlink error which system boot by nfs mount

This commit is contained in:
arstercz 2022-04-27 04:46:02 +00:00
parent c9a292ae52
commit d52b97cd25
1 changed files with 1 additions and 1 deletions

View File

@ -349,7 +349,7 @@ func PartitionsWithContext(ctx context.Context, all bool) ([]PartitionStat, erro
// /dev/root is not the real device name // /dev/root is not the real device name
// so we get the real device name from its major/minor number // so we get the real device name from its major/minor number
if d.Device == "/dev/root" { if d.Device == "/dev/root" && d.Fstype != "nfs" {
devpath, err := os.Readlink(common.HostSys("/dev/block/" + blockDeviceID)) devpath, err := os.Readlink(common.HostSys("/dev/block/" + blockDeviceID))
if err != nil { if err != nil {
return nil, err return nil, err