]> git.datanom.net - omvzfs.git/blobdiff - gui/rpc/zfs.inc
Use /dev/disk/by-path as default for new pools as suggested by ZoL FAQ.
[omvzfs.git] / gui / rpc / zfs.inc
index beaefa49e3e6b21921ca3bbbdd7f9ddd4d581d33..84fa26d9c481f0b5c08107862bce15ec313ae5ab 100644 (file)
@@ -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
This page took 0.079852 seconds and 5 git commands to generate.