Menu="Device:1" Title="$name _(Settings)_" Tag="hdd-o" Cond="array_key_exists($name, $disks) || array_key_exists($name, $devs)" --- 0 ? $sheets[$i-1] : $sheets[$end]; $next = $i<$end ? $sheets[$i+1] : $sheets[0]; $textErase = isPool($name) ? _('This will ERASE content of ALL devices in the pool') : _('This will ERASE ALL device content'); $textDelete = _('This will unassign all devices from the pool but will NOT modify any device contents'); function disabled_if($condition) { if ($condition !== false) echo ' disabled'; } function sanitize(&$val) { $data = explode('.',str_replace([' ',','],['','.'],$val)); $last = array_pop($data); $val = count($data) ? implode($data).".$last" : $last; $val = preg_replace('/[^0-9.]/','',$val); } function presetSpace($val) { global $disk,$display; if (!$val or strcasecmp($val,'NaN')==0) return; sanitize($val); $size = _var($disk,'fsSize',0); $size = $size>0 ? round(100*$val/$size,1) : 0; $units = ['KB','MB','GB','TB','PB','EB','ZB','YB']; $base = $val>0 ? floor(log($val,1000)) : 0; $size = round($val/pow(1000,$base),1); $unit = _var($units,$base); [$dot,$comma] = str_split(_var($display,'number','.,')); return $size>0 ? number_format($size,$size-floor($size)?1:0,$dot,$comma).' '.$unit : ''; } function fsSize() { global $disks,$pools; $fsSize = []; foreach ($pools as $pool) $fsSize[] = '"'.$pool.'":"'._var($disks[$pool],'fsSize',0).'"'; return implode(',',$fsSize); } function fsType($type) { global $disk; return strpos(_var($disk,'fsType'),$type)!==false; } function diskStatus($status) { global $disk; return strpos(_var($disk,'status'),$status)!==false; } function diskType(...$types) { global $disk; $pass = false; foreach ($types as $type) $pass |= _var($disk,'type')==$type; return $pass; } function makeList($list) { return implode(',',array_map('escapestring',$list)); } function sharename($share) { return basename($share,'.cfg'); } function makeTemp(&$disk, $zone) { global $display; switch ($zone) { case 'hot': $nvme = 'wctemp'; break; case 'max': $nvme = 'cctemp'; break; } return _var($disk,'transport')=='nvme' ? get_nvme_info(_var($disk,'device'),$nvme) : (_var($disk,'rotational',1)==0 && $display["{$zone}ssd"]>=0 ? $display["{$zone}ssd"] : $display[$zone]); } function maintenance_mode() { global $var; return _var($var,'fsState')=="Started" && _var($var,'startMode')=="Maintenance" && _var($disk,'luksState',0)<=1; } function isPool($name) { global $pools; return in_array($name,$pools); } /* Check to see if a pool has already been upgraded. */ function is_upgraded_ZFS_pool($pool_name) { /* See if the pool is aready upgraded. */ $upgrade = trim(shell_exec("/usr/sbin/zpool status ".escapeshellarg($pool_name)." | /usr/bin/grep 'Enable all features using.'") ?? ""); return ($upgrade ? false : true); } ?>
_(Name)_: : _(Name)_: : _(Identification)_: : _(No device)_ _(Identification)_: :  () _(Comments)_: : :info_comments_help: _(Partition size)_: : KB (K=1024) _(Partition format)_: : _(Spinup group(s))_: : _(Spin down delay)_: : _(File system status)_: :   _(File system type)_: : style="display:none"> _(ReiserFS is deprecated, please use another file system)_!
_(Allocation profile)_: : :info_profile_help:
_(Compression)_: : :info_compression_help:
_(Autotrim)_: : :info_autotrim_help:
_(Enable user share assignment)_: : :info_share_assignment_help: _(Minimum free space)_: : disabled> _(Calculated free space value)_ :info_free_space_help: _(Warning disk utilization threshold)_ (%): : :info_warning_utilization_help: _(Critical disk utilization threshold)_ (%): : :info_critical_utilization_help:   : > > >
_(Pool Device Status)_
_(pool device stats)_: : " . htmlspecialchars(shell_exec("/sbin/btrfs dev stats -T ".escapeshellarg("/mnt/$tag")), ENT_QUOTES, 'UTF-8') . ""; ?>   :
_(Balance Status)_
_(btrfs filesystem usage)_: : " . htmlspecialchars(shell_exec("/sbin/btrfs fi usage -T ".escapeshellarg("/mnt/$tag")), ENT_QUOTES, 'UTF-8') . ""; ?> _(btrfs balance status)_: : ".implode("\n", $balance_status).""?>   :  _(Current usage ratio)_: % --- 0 && $usage <= 50) ? "_(Full Balance recommended)_" : "_(No Balance required)_"?>   : 1):?> *_(Perform full balance)_* :info_btrfs_balance_help:   : *_(Running)_* :info_balance_cancel_help:   : _(Balance)_ _(is only available when the filesyestem is mounted)_

_(Balance schedule)_: : _(Day of the week)_: : _(Day of the month)_: : _(Time of the day)_: : : _(Block group usage)_ (%): :   :
_(Scrub Status)_
_(btrfs scrub status)_: : ".implode("\n", $scrub_status).""?>   : :info_btrfs_scrub_help:   : *_(Running)_* :info_scrub_cancel_help:   : _(Scrub)_ _(is only available when the filesyestem is mounted)_

_(Scrub schedule)_: : _(Day of the week)_: : _(Day of the month)_: : _(Time of the day)_: : :   :
_(Check Filesystem Status)_
_(btrfs check status)_: : ".implode("\n", $check_status).""?>   : _(Options (see Help))_ :info_btrfs_check_help:   : *_(Running)_* :info_check_cancel_help:   : **_(Check)_** _(is only available when array is Started in **Maintenance** mode)_.
_(Pool Status)_
_(zfs pool status)_: :
  : :info_zfs_scrub_help:   : *_(Running)_* :info_scrub_cancel_help:   : "._('Scrub')." "._('is only available when the filesyestem is mounted') : sprintf(_('See %s Settings'),ucfirst(prefix($tag)))?>
_(Pool Information)_
_(zfs pool information)_: :

_(Scrub Schedule)_
_(Scrub schedule)_: : _(Day of the week)_: : _(Day of the month)_: : _(Time of the day)_: : :   :
_(Check Filesystem Status)_
_(reiserfsck status)_: : ".implode("\n", $check_status).""?>   : _(Options (see Help))_ :info_reiserfs_check_help:   : *_(Running)_* :info_reiserfs_cancel_help:   : **_(Check)_** _(is only available when array is Started in **Maintenance** mode)_.
_(Check Filesystem Status)_
_(xfs_repair status)_: : ".implode("\n", $check_status).""?>   : _(No file system corruption detected)_. :info_xfs_check_help:   : _(File system corruption detected)_. :info_xfs_check_help:   : _(Dirty log detected)_.

_(Note)_: _(While there is some risk, if it is not possible to first mount the filesystem to clear the log, zeroing it is the only option to try and repair the filesystem, and in most cases it results in little or no data loss)_.

:info_xfs_check_help:   : _(File system corruption fixed)_ :info_xfs_check_help:   : *_(Running)_* :info_xfs_cancel_help:   : **_(Check)_** _(is only available when array is Started in **Maintenance** mode)_.
_(SMART Settings)_
_(Warning disk temperature threshold)_ (°): _(Warning NVME temperature threshold)_ (°): _(Warning SSD temperature threshold)_ (°): : :info_warning_temp_help: _(Critical disk temperature threshold)_ (°): _(Critical NVME temperature threshold)_ (°): _(Critical SSD temperature threshold)_ (°): : :info_critical_temp_help: _(SMART notification value)_: : :info_smart_notifications_help: _(SMART notification tolerance level)_: : :info_tolerance_level_help: _(SMART controller type)_: : /dev/ _(enter disk index and device name as applicable to your controller)_ :info_controller_type_help: _(SMART attribute notifications)_: : _(Custom attributes (use comma to separate numbers))_   : :info_attribute_notifications_help: :