[pve-devel] [PATCH pve-container] Unmount containers before trying to mount them, fixes #1721

René Jochum r.jochum at proxmox.com
Fri May 4 10:04:16 CEST 2018


Signed-off-by: René Jochum <r.jochum at proxmox.com>
---
 src/lxc-pve-prestart-hook | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/lxc-pve-prestart-hook b/src/lxc-pve-prestart-hook
index 61a8ef3..d50520f 100755
--- a/src/lxc-pve-prestart-hook
+++ b/src/lxc-pve-prestart-hook
@@ -94,6 +94,9 @@ __PACKAGE__->register_method ({
 	    push @$devices, $dev if $dev && $mountpoint->{quota};
 	};
 
+	# Unmount first when the user mounted the container with "pct mount".
+	PVE::Tools::run_command(['umount', '--recursive', $rootdir], outfunc => sub {}, errfunc => sub {});
+
 	PVE::LXC::Config->foreach_mountpoint($conf, $setup_mountpoint);
 
 	my $lxc_setup = PVE::LXC::Setup->new($conf, $rootdir);
-- 
2.11.0



More information about the pve-devel mailing list