0

I'm using namespaces and mountflags to control propagation of mountpoints and/or accessibility to the data within.

My setup looks like this:

  • There is a main process A
  • Process A creates process B
  • Process B calls unshare(CLONE_NEWNS) followed by mount(NULL, '/', NULL, MS_SLAVE | MS_REC, NULL)
  • After that, process B mounts a loop-device using devmapper
  • Process B creates Process C
  • Process C also calls unshare(CLONE_NEWNS) followed by mount(NULL, '/', NULL, MS_SLAVE | MS_REC, NULL)
  • Process C mounts encfs

My problem is, that an unmount of Process B's mount doesn't work properly and therefore a remount doesn't work either. Generally, I want to achieve that no mount events are propagated out of B's created namespace and also C's created namespace. Mount event from master (process A) should be propagated to B's and C's created namespace.

I don't know where the problem is, am I thinking wrong anywhere?

  • 1st check with fuser -v mountpoint if there is processes using it or not ; if not try a umount --force on it; if yes kill process & try again then check logs for error messages to understand why the natural umount failed – francois P Feb 19 '20 at 19:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.