Enhanced README.md and added SMART status indications

This commit is contained in:
2024-12-09 22:07:59 -05:00
parent 805f3fd834
commit dfa19271d0
2 changed files with 81 additions and 13 deletions

View File

@ -106,22 +106,46 @@ case "$HOSTNAME" in
;;
esac
# Show NVMe Drives
echo -e "\n=== NVMe Drives ==="
sudo nvme list
# Enhanced Drive Information Function
get_drive_info() {
local drive=$1
echo "=== Detailed info for $drive ==="
if [[ $drive == *"nvme"* ]]; then
sudo nvme smart-log "$drive"
else
sudo smartctl -A "$drive" | grep -E "Temperature|Power|Health"
fi
}
# Show SATA Drives
# Show NVMe Drives with enhanced info
echo -e "\n=== NVMe Drives ==="
nvme_drives=$(sudo nvme list | grep "^/dev")
echo "$nvme_drives"
for drive in $(echo "$nvme_drives" | awk '{print $1}'); do
get_drive_info "$drive"
done
# Show SATA Drives with enhanced info
echo -e "\n=== SATA Drives ==="
lsblk -o NAME,SIZE,TYPE,MOUNTPOINT,MODEL | grep disk
for drive in $(lsblk -dnp -o NAME); do
get_drive_info "$drive"
done
# Show PCI BDF for NVMe
echo -e "\n=== PCI BDF for NVMe ==="
lspci | grep -i nvme
# [Previous PCI BDF and disk ID sections remain the same...]
# Show PCI BDF for SATA
echo -e "\n=== PCI BDF for SATA ==="
lspci | grep -i sata
# Add RAID Detection
echo -e "\n=== RAID Configuration ==="
if [ -f /proc/mdstat ]; then
cat /proc/mdstat
else
echo "No software RAID detected"
fi
# Show Drives by ID
echo -e "\n=== Drives by ID ==="
ls -l /dev/disk/by-id
# Add ZFS Detection
echo -e "\n=== ZFS Pools ==="
if command -v zpool >/dev/null 2>&1; then
sudo zpool status
else
echo "ZFS not installed"
fi