From 3c99150ad2110713980d76b328522e53e6d33bfe Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ren=C3=A9=20Jochum?= Date: Fri, 4 May 2018 10:04:16 +0200 Subject: [PATCH] fix #1721: unmount containers before trying to mount them MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: René Jochum --- 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.39.5