A powerful server drive mapping tool that generates visual ASCII representations of server layouts and provides comprehensive drive information. Maps physical drive bays to logical Linux device names using PCI bus paths for reliable, persistent identification.
Drive Atlas uses `/dev/disk/by-path/` to create persistent mappings between physical drive bays and Linux device names. This is superior to using device letters (sda, sdb, etc.) which can change between boots.
**Example PCI path:**
```
pci-0000:0c:00.0-ata-1 → /dev/sda
```
This tells us:
-`0000:0c:00.0` - PCI bus address of the storage controller
-`ata-1` - Port 1 on that controller
- Maps to physical bay 3 on compute-storage-01
### Configuration
Server mappings are defined in the `SERVER_MAPPINGS` associative array in [driveAtlas.sh](driveAtlas.sh):
```bash
declare -A SERVER_MAPPINGS=(
["compute-storage-01"]="
pci-0000:0c:00.0-ata-1 3
pci-0000:0c:00.0-ata-2 4
pci-0000:0d:00.0-nvme-1 m2-1
"
)
```
## Setting Up a New Server
### Step 1: Run Diagnostic Script
First, gather PCI path information:
```bash
bash diagnose-drives.sh > server-diagnostic.txt
```
This will show all available PCI paths and their associated drives.
### Step 2: Physical Bay Identification
For each populated drive bay:
1. Note the physical bay number (labeled on chassis)
2. Identify a unique characteristic (size, model, or serial number)
3. Match it to the PCI path from the diagnostic output
**Pro tip:** If uncertain, remove one drive at a time and re-run the diagnostic to see which PCI path disappears.
### Step 3: Create Mapping
Add a new entry to `SERVER_MAPPINGS` in [driveAtlas.sh](driveAtlas.sh):
```bash
["your-hostname"]="
pci-0000:XX:XX.X-ata-1 1
pci-0000:XX:XX.X-ata-2 2
# ... etc
"
```
Also add the chassis type to `CHASSIS_TYPES`:
```bash
["your-hostname"]="10bay"
```
### Step 4: Test
Run the main script and verify the layout matches your physical configuration: