]> git.proxmox.com Git - pve-installer.git/commitdiff
optimize zfs installation
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 14 Jan 2015 07:54:49 +0000 (08:54 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 14 Jan 2015 07:54:49 +0000 (08:54 +0100)
use /dev/disk/by-id
disable sync during install to be faster

proxinstall

index aa18f4093ce22c7eeada70504907d0a8ddcaac10..dd44e6722500e28569cff3ad470883098f4c5a68 100755 (executable)
@@ -616,7 +616,9 @@ sub diversion_remove {
 sub zfs_create_rpool {
     my ($zfspoolname, $targetdev) = @_;
 
-    syscmd ("zpool create -f -o ashift=12 $zfspoolname $targetdev") == 0 ||
+    my $full_path =find_stable_path ("/dev/disk/by-id", $targetdev) || $targetdev;
+   
+    syscmd ("zpool create -f -o ashift=12 $zfspoolname ${full_path}") == 0 ||
        die "unable to create zfs root pool\n";
 
     syscmd ("zfs create $zfspoolname/ROOT")  == 0 ||
@@ -845,6 +847,12 @@ sub extract_data {
            }
        }
 
+       if ($use_zfs) {
+           # to be fast during installation
+           syscmd ("zfs set sync=disabled $zfspoolname") == 0 ||
+               die "unable to set zfs properties\n";
+       }
+
        update_progress (0.03, 0, $maxper, "create swap space");
        if ($swapfile) {
            syscmd ("mkswap -f $swapfile") == 0 ||
@@ -1201,6 +1209,9 @@ _EOD
     syscmd ("umount -d $targetdir");
 
     if (!$err && $use_zfs) {
+       syscmd ("zfs set sync=standard $zfspoolname") == 0 ||
+           die "unable to set zfs properties\n";
+
        syscmd ("zfs set mountpoint=/ $zfspoolname/ROOT/pve-1") == 0 ||
            die "zfs set mountpoint failed\n";