LOG=/DATA/diskinfo.log;:>$LOG;echo -e "\n\n=================== LSBLK Output ===================\n\n">>$LOG;lsblk>>$LOG;echo -e "\n\n=================== LSBLK -f Output ===================\n\n">>$LOG;lsblk -f>>$LOG;echo -e "\n\n=================== RAID Devices and Members ===================\n\n">>$LOG;RAID_MD_LIST=$(grep '^md' /proc/mdstat|awk '{print $1}');if [ -n "$RAID_MD_LIST" ];then for md in $RAID_MD_LIST;do raid=$(grep "^$md " /proc/mdstat|awk '{print $4}');echo -e "\n/dev/$md ($raid)">>$LOG;grep "^$md " /proc/mdstat|grep -oE 'sd[a-z0-9]+|nvme[0-9]+n[0-9]+'|sed 's/\[[0-9]*\]//g'|while read d;do echo "  /dev/$d">>$LOG;done;done;else echo "No RAID devices detected.">>$LOG;fi;echo -e "\n\n=================== RAID Table from ZimaOS DB ===================\n\n">>$LOG;sqlite3 /var/lib/casaos/db/local-storage.db ".mode column" "SELECT * FROM raids;">>$LOG;echo -e "\n\n=================== Disk Table from ZimaOS DB ===================\n\n">>$LOG;sqlite3 /var/lib/casaos/db/local-storage.db ".mode column" "SELECT * FROM o_disk;">>$LOG;echo -e "\n\n=================== Local Storage API ===================\n\n">>$LOG;curl -s 'http://localhost/v2/local_storage/disk'>>$LOG;if [ -n "$RAID_MD_LIST" ];then echo -e "\n\n=================== mdadm Detail ===================\n\n">>$LOG;for md in $RAID_MD_LIST;do mdadm -D /dev/$md>>$LOG 2>&1;echo -e "\n========================================================\n">>$LOG;done;fi;echo -e "\n\n=================== SMART Information ===================\n\n">>$LOG;DEVICES=$( (lsblk -dno NAME|grep -E '^sd|^nvme';grep '^md' /proc/mdstat|grep -oE 'sd[a-z0-9]+|nvme[0-9]+n[0-9]+' )|sort -u );for d in $DEVICES;do echo -e "\n>>> SMART info for /dev/$d\n">>$LOG;smartctl -a /dev/$d>>$LOG 2>&1;echo -e "========================================================\n">>$LOG;done;echo -e "Please open the Files application, locate the file 'diskinfo.log' under the ZimaOS-HD directory, and send it to IceWhale technical support."