diff --git a/src/Core/System/RootFS/sbin/initial_storage_part_four b/src/Core/System/RootFS/sbin/initial_storage_part_four index 3eb2d3fc..3dd43eb5 100644 --- a/src/Core/System/RootFS/sbin/initial_storage_part_four +++ b/src/Core/System/RootFS/sbin/initial_storage_part_four @@ -190,12 +190,12 @@ if [ "$resultParted" = "0" ];then "/sbin/fsck.${type}" -a "${partitionFour}" > /dev/null 2>&1; fsckResult="$?"; if [ "$fsckResult" != "0" ]; then - echo " - ERROR: check fs on '${partitionFour}' type: '${type}' exit code '$?'" + echo " - ERROR: check fs on '${partitionFour}' type: '${type}' exit code '$fsckResult'" else echo " - check completed..." fi; else - echo " - ERROR: umount ${partitionFour} exit code $?" + echo " - ERROR: umount ${partitionFour} exit code $mountResult" fi; else echo " - partition №4 on ${dev} not found..."; diff --git a/src/Core/System/Storage.php b/src/Core/System/Storage.php index 0dd622f9..f3a856e5 100644 --- a/src/Core/System/Storage.php +++ b/src/Core/System/Storage.php @@ -573,8 +573,6 @@ public static function isStorageDisk(string $device): bool Processes::mwExec("$mount -t $format $uid_part $tmp_dir", $out); if (is_dir("$tmp_dir/mikopbx") && trim(implode('', $out)) === '') { - // $out - empty string, no errors - // mikopbx directory exists $result = true; echo("Disk $device is storage...") . PHP_EOL; } @@ -698,6 +696,18 @@ public function configure(): void $mount_point = "/storage/usbdisk{$disk['id']}"; Util::mwMkdir($mount_point); SystemMessages::sysLogMsg(__METHOD__, "Create mount point: $conf"); + + $mountPath = Util::which('mount'); + $resultMountCode = Processes::mwExec("$mountPath -t $formatFs $str_uid $mount_point", $out); + if($resultMountCode !== 0){ + echo("Fail mount $dev whith $str_uid, FS_TYPE - $formatFs...") . PHP_EOL; + echo("Trying check device $dev ...") . PHP_EOL; + passthru("/sbin/fsck.$formatFs -y '$dev'"); + echo("Trying mount device $dev ...") . PHP_EOL; + $resultMountCode = Processes::mwExec("$mountPath -t $formatFs $str_uid $mount_point", $out); + echo("Result mount code $resultMountCode ...") . PHP_EOL; + } + } // Save the configuration to the fstab file