Beispiel #1
0
func ForceMount(device, target, mType, options string) error {
	log.Debug("mount", device, target, mType, options)
	if err := mount.ForceMount(device, target, mType, options); err != nil {
		return err
	}

	return nil
}
Beispiel #2
0
func MakePrivate(mountPoint string) error {
	mounted, err := mount.Mounted(mountPoint)
	if err != nil {
		return err
	}

	if !mounted {
		if err := mount.Mount(mountPoint, mountPoint, "none", "bind,rw"); err != nil {
			return err
		}
	}

	return mount.ForceMount("", mountPoint, "none", "private")
}