X-Git-Url: http://git.datanom.net/omvzfs.git/blobdiff_plain/4163f889aa50c1ee7f66ff9392ba600048221edb..e20fe312a03771aeb3233e1ef640a3c9b8d9c737:/gui/rpc/zfs.inc diff --git a/gui/rpc/zfs.inc b/gui/rpc/zfs.inc index beaefa4..84fa26d 100644 --- a/gui/rpc/zfs.inc +++ b/gui/rpc/zfs.inc @@ -63,7 +63,16 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract { $opts .= "-m " . $params['mountpoint'] . " "; } + //Use /dev/disk/by-path as deafult when creating new pools as suggested in ZoL FAQ. $disks = preg_split("/[,;]/", $params['devices']); + if (file_exists("/dev/disk/by-path/")) { + $tmp_disks = array(); + foreach ($disks as $disk) { + $tmp_disks[] = OMVModuleZFSUtil::getDiskPath($disk); + } + $disks = $tmp_disks; + } + $vdev = new OMVModuleZFSVdev($params['name'], $pooltype, $disks); $pool = new OMVModuleZFSZpool($vdev, $opts); //Ugly fix to solve the problem of blkid not displaying info on newly created pools