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:
parent
42136c7364
commit
23d63601d1
@ -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]
|
||||
|
Loading…
x
Reference in New Issue
Block a user