From 23d63601d12400d710436a18ecb750e68eb340b6 Mon Sep 17 00:00:00 2001 From: Aman Karmani Date: Wed, 7 Oct 2020 11:00:44 -0700 Subject: [PATCH] [disk][linux] flag bind mounts --- disk/disk_linux.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/disk/disk_linux.go b/disk/disk_linux.go index d23a4c4..9fa311d 100644 --- a/disk/disk_linux.go +++ b/disk/disk_linux.go @@ -283,6 +283,14 @@ func PartitionsWithContext(ctx context.Context, all bool) ([]PartitionStat, erro mountPoint := fields[4] mountOpts := fields[5] + if rootDir := fields[3]; rootDir != "" && rootDir != "/" { + if len(mountOpts) == 0 { + mountOpts = "bind" + } else { + mountOpts = "bind," + mountOpts + } + } + fields = strings.Fields(parts[1]) fstype := fields[0] device := fields[1]