}
$disks = preg_split("/[,;]/", $params['devices']);
+ foreach ($disks as $disk) {
+ OMVModuleZFSUtil::setGPTLabel($disk);
+ }
//Use /dev/disk/by-path as suggested in ZoL FAQ.
if ($params['diskpath']) {
try {
$opts .= "-f ";
}
$disks = preg_split("/[,;]/", $params['devices']);
+ foreach ($disks as $disk) {
+ OMVModuleZFSUtil::setGPTLabel($disk);
+ }
//Use /dev/disk/by-path as suggested in ZoL FAQ.
if ($params['diskpath']) {
try {
*/
class OMVModuleZFSUtil {
+ /**
+ * Sets a GPT label on a disk to prevent the zpool command from generating
+ * errors.
+ *
+ */
+ public static function setGPTLabel($disk) {
+ $cmd = "parted " . $disk . " mklabel gpt 2>&1";
+ OMVModuleZFSUtil::exec($cmd,$out,$res);
+ }
+
/**
* Manages relocation of ZFS filesystem mountpoints in the OMV backend.
* Needed when the user changes mountpoint of a filesystem in the GUI.