diff --git a/src/lxc/bdev.c b/src/lxc/bdev.c index 67fe72baf..ab1c87b35 100644 --- a/src/lxc/bdev.c +++ b/src/lxc/bdev.c @@ -2387,6 +2387,12 @@ static int rsync_rootfs(struct rsync_data *data) SYSERROR("unshare CLONE_NEWNS"); return -1; } + if (detect_shared_rootfs()) { + if (mount(NULL, "/", NULL, MS_SLAVE|MS_REC, NULL)) { + SYSERROR("Failed to make / rslave to run rsync"); + ERROR("Continuing..."); + } + } // If not a snapshot, copy the fs. if (orig->ops->mount(orig) < 0) { diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index b8b11d62f..0d89d1166 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -913,7 +913,7 @@ static bool create_run_template(struct lxc_container *c, char *tpath, bool quiet exit(1); } if (detect_shared_rootfs()) { - if (mount("", "", NULL, MS_SLAVE|MS_REC, 0)) { + if (mount(NULL, "/", NULL, MS_SLAVE|MS_REC, NULL)) { SYSERROR("Failed to make / rslave to run template"); ERROR("Continuing..."); }