- if (file_exists("/dev/disk/by-path/")) {
- $tmp_disks = array();
- foreach ($disks as $disk) {
- $tmp_disks[] = OMVModuleZFSUtil::getDiskPath($disk);
+ foreach ($disks as $disk) {
+ OMVModuleZFSUtil::setGPTLabel($disk);
+ }
+ //Use /dev/disk/by-path as suggested in ZoL FAQ.
+ if ($params['diskpath']) {
+ try {
+ if (file_exists("/dev/disk/by-path/")) {
+ $tmp_disks = array();
+ foreach ($disks as $disk) {
+ $tmp_disks[] = OMVModuleZFSUtil::getDiskPath($disk);
+ }
+ $disks = $tmp_disks;
+ }
+ } catch (OMVModuleZFSException $e) {
+ //Do nothing if an excpetion is thrown