diff --git a/mount/sharedsubtree_linux.go b/mount/sharedsubtree_linux.go new file mode 100644 index 0000000..566ebbd --- /dev/null +++ b/mount/sharedsubtree_linux.go @@ -0,0 +1,18 @@ +// +build linux + +package mount + +func MakePrivate(mountPoint string) error { + mounted, err := Mounted(mountPoint) + if err != nil { + return err + } + + if !mounted { + if err := Mount(mountPoint, mountPoint, "none", "bind,rw"); err != nil { + return err + } + } + + return ForceMount("", mountPoint, "none", "private") +}