$parity = $var['mdResync']>0 ? 'Disabled -- Parity operation is running' : '';
$mover = file_exists('/var/run/mover.pid') ? 'Disabled -- Mover is running' : '';
@@ -141,11 +194,20 @@ toggle_diskio(true);
if ($var['fsNumUnmountable']>0):?>
Unmountable disk=$var['fsNumUnmountable']==1?'':'s'?> present:
- foreach ($disks as $disk) if (strstr($disk['fsStatus'],'Unmountable')) echo " ".my_disk($disk['name'])." • ".my_id($disk['id'])." (".$disk['device'].")";?> |
- |
+ $verify = false;
+ foreach ($disks as $disk) if (strpos($disk['fsStatus'],'Unmountable')!==false) {
+ echo "
".my_disk($disk['name'])." • ".my_id($disk['id'])." (".$disk['device'].")";
+ if (strpos($disk['fsStatus'],'encryption')!==false) $verify = true;
+ }
+?>
+ if ($verify):?>
+ |
+ Fix allows to format all unmountable disks OR to stop the array and correct the encryption key |
+ else:?>
+ |
Format will create a file system in all Unmountable disks, discarding all data currently on those disks.
- Yes I want to do this
- |
+ Yes I want to do this
+ endif;?>
endif;
if (!$parity):
@@ -340,9 +402,15 @@ toggle_diskio(true);
case "STOPPED":
if (strstr($var['mdResyncAction'],"recon")):?>
+ if ($luks && !$keyfile):?>
+ =status_indicator()?>Stopped. Missing encryption keyfile
=help_text()?> |
+ |
+ =input_text()?> |
+ else:?>
=status_indicator()?>Stopped. Configuration valid. |
|
Start will bring the array on-line and start Parity-Sync and/or Data-Rebuild. |
+ endif;?>
elseif ($var['mdResyncAction']=="clear"):?>
@@ -365,9 +433,15 @@ toggle_diskio(true);
else:?>
+ if ($luks && !$keyfile):?>
+ =status_indicator()?>Stopped. Missing encryption keyfile
=help_text()?> |
+ |
+ =input_text()?> |
+ else:?>
=status_indicator()?>Stopped. Configuration valid. |
|
Start will bring the array on-line. |
+ endif;?>
endif;
maintenance_mode();
@@ -375,18 +449,30 @@ toggle_diskio(true);
case "NEW_ARRAY":
if (strpos($disks['parity']['status'],"DISK_NP")===0 && (empty($disks['parity2']) || strpos($disks['parity2']['status'],"DISK_NP")===0)):?>
+ if ($luks && !$keyfile):?>
+ =status_indicator()?>Stopped. Missing encryption keyfile
=help_text()?> |
+ |
+ =input_text()?> |
+ else:?>
=status_indicator()?>Stopped. Configuration valid. |
|
Start will record all disk information and bring the array on-line.
The array will be immediately available, but unprotected since parity has not been assigned. |
+ endif;?>
else:?>
+ if ($luks && !$keyfile):?>
+ =status_indicator()?>Stopped. Missing encryption keyfile
=help_text()?> |
+ |
+ =input_text()?> |
+ else:?>
=status_indicator()?>Stopped. Configuration valid. |
|
Start will record all disk information, bring the array on-line, and start Parity-Sync.
The array will be immediately available, but unprotected until Parity-Sync completes.
Parity is already valid. |
+ endif;?>
endif;
maintenance_mode();
diff --git a/plugins/dynamix/EncryptionSettings.page b/plugins/dynamix/EncryptionSettings.page
index f99bace0b..d4af7b041 100644
--- a/plugins/dynamix/EncryptionSettings.page
+++ b/plugins/dynamix/EncryptionSettings.page
@@ -18,6 +18,9 @@ Tag="key"
$keyfile = file_exists($var['luksKeyfile']) ? $var['luksKeyfile'] : '';
$online = $var['fsState']=='Stopped' ? '' : 'disabled';
+$cfg = '/boot/config/keyfile.cfg';
+$luks = false; foreach ($disks as $disk) $luks |= substr($disk['fsType'],0,5)=='luks:';
+$flag = $luks ? (file_exists($cfg) ? file_get_contents($cfg) : false) : false;
?>