MS_BIND flag on / folder not working

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

         Binding / folder onto someother folder say /opt/lxc is not working but otherway round is working. Can I get some help on this.

The following code snippet is executed after cloning 
After executing the following code snippet the contents of / is visible in /opt/lxc
      ret = mount("/", "/opt/lxc", NULL, MS_BIND, NULL);
      if (ret) {
        perror("mount bind / on /opt/lxc");
        exit(1);
     }

But after executing the following code snippet the contents of /opt/lxc is not visible in /
      ret = mount("/opt/lxc", "/", NULL, MS_BIND, NULL);
      if (ret) {
        perror("mount bind /opt/lxc on /");
        exit(1);
     }

The code is executing successfully, but the result is not as expected. 

Regards,
Prabhu


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux