Skip to content

Commit d52b97c

Browse files
committed
fix disk readlink error which system boot by nfs mount
1 parent c9a292a commit d52b97c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

disk/disk_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ func PartitionsWithContext(ctx context.Context, all bool) ([]PartitionStat, erro
349349

350350
// /dev/root is not the real device name
351351
// so we get the real device name from its major/minor number
352-
if d.Device == "/dev/root" {
352+
if d.Device == "/dev/root" && d.Fstype != "nfs" {
353353
devpath, err := os.Readlink(common.HostSys("/dev/block/" + blockDeviceID))
354354
if err != nil {
355355
return nil, err

0 commit comments

Comments
 (0)