[pve-devel] [PATCH installer] fix XFS mount options

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Mar 15 11:54:31 CET 2017


since Linux 4.10, barrier/nobarrier are still supported, but
are ignored, and barrier=1/0 seems to not work at at all
anymore.

so now we have three possibilities:
* ZFS: no mounting needed at all
* XFS: only noatime
* extX and btrfs: noatime and nobarrier

restructure code accordingly

Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
 proxinstall | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/proxinstall b/proxinstall
index e02eff1..81318fc 100755
--- a/proxinstall
+++ b/proxinstall
@@ -1196,11 +1196,12 @@ sub extract_data {
 
 	if ($use_zfs) {
 	    # do nothing
-	} elsif ($use_btrfs) {
-	    syscmd("mount -n $rootdev -o noatime,nobarrier $targetdir") == 0 ||
-		die "unable to mount $rootdev\n";
 	} else {
-	    syscmd ("mount -n $rootdev -o noatime,barrier=0 $targetdir") == 0 ||
+	    my $mount_opts = 'noatime';
+	    $mount_opts .= ',nobarrier'
+		if $use_btrfs || $filesys =~ /^ext\d$/;
+
+	    syscmd("mount -n $rootdev -o $mount_opts $targetdir") == 0 ||
 		die "unable to mount $rootdev\n";
 	}
 
-- 
2.1.4





More information about the pve-devel mailing list