[pve-devel] [PATCH v2 pve-container 3/3] mount snapshots with the noload option

Wolfgang Bumiller w.bumiller at proxmox.com
Fri Sep 25 14:08:02 CEST 2015


When using block device based snapshots we cannot mount the
filesystem as it's not clean, and we also can't replay the
journal without write access (as even `-o ro` writes to
devices when replaying a journal (see the linux docs under
Documentation/filesystems/ext4.txt section 3 option 'ro')).
So we need to use the "noload" option to avoid replaying the
journal.
---
 src/PVE/LXC.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index c5a1409..02b94b5 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -2091,7 +2091,7 @@ sub mountpoint_mount {
 		    if ($scfg->{type} eq 'zfspool') {
 			my $path_arg = $path;
 			$path_arg =~ s!^/+!!;
-			PVE::Tools::run_command(['mount', '-o', 'ro', '-t', 'zfs', $path_arg, $mount_path]);
+			PVE::Tools::run_command(['mount', '-o', 'ro,noload', '-t', 'zfs', $path_arg, $mount_path]);
 		    } else {
 			die "cannot mount subvol snapshots for storage type '$scfg->{type}'\n";
 		    }
@@ -2113,7 +2113,7 @@ sub mountpoint_mount {
 	    }
 	    if ($mount_path) {
 		if ($isBase || defined($snapname)) {
-		    PVE::Tools::run_command(['mount', '-o', "ro", @extra_opts, $path, $mount_path]);
+		    PVE::Tools::run_command(['mount', '-o', 'ro,noload', @extra_opts, $path, $mount_path]);
 		} else {
 		    PVE::Tools::run_command(['mount', @extra_opts, $path, $mount_path]);
 		}
-- 
2.1.4




More information about the pve-devel mailing list