1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-04-24 13:48:56 +08:00

[disk][linux] flag bind mounts

This commit is contained in:
Aman Karmani 2020-10-07 11:00:44 -07:00
parent 42136c7364
commit 23d63601d1

View File

@ -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]