From 4f8c5f1bc970ad80e831a5c4722c58ba55ac240f Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Thu, 12 Dec 2024 21:42:56 -0500 Subject: [PATCH] Added support for eMMC storage and changes to SATA/NVME --- driveAtlas.sh | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/driveAtlas.sh b/driveAtlas.sh index f7f5c54..f2e2d50 100644 --- a/driveAtlas.sh +++ b/driveAtlas.sh @@ -118,21 +118,37 @@ get_drive_info() { } # Show NVMe Drives with enhanced info -echo -e "\n=== NVMe Drives ===" +echo -e "\n=== NVMe Drives ===\n" +printf "%-15s %-10s %-10s %-20s\n" "DEVICE" "SIZE" "TYPE" "MODEL" +echo "------------------------------------------------------------" 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 +if [ -n "$nvme_drives" ]; then + echo "$nvme_drives" | awk '{printf "%-15s %-10s %-10s %-20s\n", $1, $6, "NVMe", $3}' +else + echo "No NVMe drives found" +fi -# 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 MMC Drives +echo -e "\n=== MMC Drives ===\n" +printf "%-15s %-10s %-10s %-20s\n" "DEVICE" "SIZE" "TYPE" "MOUNTPOINT" +echo "------------------------------------------------------------" +mmc_output=$(lsblk -o NAME,SIZE,TYPE,MOUNTPOINT | grep "mmcblk") +if [ -n "$mmc_output" ]; then + echo "$mmc_output" +else + echo "No MMC drives found" +fi -# [Previous PCI BDF and disk ID sections remain the same...] +# Show SATA/Other Drives +echo -e "\n=== SATA/Block Drives ===\n" +printf "%-15s %-10s %-10s %-20s\n" "DEVICE" "SIZE" "TYPE" "MOUNTPOINT" +echo "------------------------------------------------------------" +sata_output=$(lsblk -o NAME,SIZE,TYPE,MOUNTPOINT | grep "disk" | grep -v "mmcblk") +if [ -n "$sata_output" ]; then + echo "$sata_output" +else + echo "No SATA drives found" +fi # Add RAID Detection echo -e "\n=== RAID Configuration ==="