From: Dietmar Maurer Date: Wed, 14 Jan 2015 07:54:49 +0000 (+0100) Subject: optimize zfs installation X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=481671c357747777b7fab66b6e687fe27ea3142e;p=pve-installer.git optimize zfs installation use /dev/disk/by-id disable sync during install to be faster --- diff --git a/proxinstall b/proxinstall index aa18f40..dd44e67 100755 --- a/proxinstall +++ b/proxinstall @@ -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";