]> git.proxmox.com Git - pve-container.git/commitdiff
mount snapshots with the noload option
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 25 Sep 2015 12:08:02 +0000 (14:08 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 25 Sep 2015 15:54:12 +0000 (17:54 +0200)
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

index a3d6d49a57c2b10947f0fa2736d2ce19bae14ea5..40eda10dbd084df8a863d2c7e1eca5e9513a5367 100644 (file)
@@ -2090,7 +2090,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";
                    }
@@ -2112,7 +2112,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]);
                }