From d9a7a13bcd092c2b811e5e48000017be29ded56a Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Sat, 1 Mar 2025 12:22:15 -0500 Subject: [PATCH] added physical mapping --- driveAtlas.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/driveAtlas.sh b/driveAtlas.sh index 277e320..74e45f1 100644 --- a/driveAtlas.sh +++ b/driveAtlas.sh @@ -32,6 +32,25 @@ get_drives_info() { done } +# Get physical slot mapping from system +get_physical_mapping() { + # Map NVMe drives + local nvme_info=$(ls -l /dev/disk/by-path/pci-0000:0d:00.0* 2>/dev/null) + + # Map SATA hot-swap bays using sg_ses or other tools + local hotswap_info=$(ls -l /dev/disk/by-path/pci-0000:0c:00.0-ata-* 2>/dev/null) + + # Map USB devices + local usb_info=$(ls -l /dev/disk/by-path/pci-0000:0b:00.0-usb* 2>/dev/null) + + # Use smartctl to get drive details + for drive in $(echo "$hotswap_info" | awk -F'/' '{print $NF}'); do + local smart_info=$(get_drive_smart_info "$drive") + local size=$(get_drive_details "$drive") + # Map drive details to physical location + done +} + # Define the ASCII art maps large1=''' ┌─────────────────────────────────────────────────────────────┐