Files
Sankofa/scripts/verify-r630-250gb-drives.sh
defiQUG 33d50fb91e
Some checks failed
API CI / API Lint (push) Successful in 47s
API CI / API Type Check (push) Failing after 47s
API CI / API Test (push) Successful in 1m0s
API CI / API Build (push) Failing after 50s
API CI / Build Docker Image (push) Has been skipped
Build Crossplane Provider / build (push) Failing after 5m51s
CD Pipeline / Deploy to Staging (push) Failing after 29s
CI Pipeline / Lint and Type Check (push) Failing after 36s
CI Pipeline / Build (push) Has been skipped
CI Pipeline / Test Backend (push) Failing after 1m33s
CI Pipeline / Test Frontend (push) Failing after 30s
CI Pipeline / Security Scan (push) Failing after 1m16s
Crossplane Provider CI / Go Test (push) Failing after 3m23s
Crossplane Provider CI / Go Lint (push) Failing after 7m27s
Crossplane Provider CI / Go Build (push) Failing after 3m27s
Deploy to Staging / Deploy to Staging (push) Failing after 30s
Portal CI / Portal Lint (push) Failing after 21s
Portal CI / Portal Type Check (push) Failing after 21s
Portal CI / Portal Test (push) Failing after 21s
Portal CI / Portal Build (push) Failing after 22s
Test Suite / frontend-tests (push) Failing after 30s
Test Suite / api-tests (push) Failing after 49s
Test Suite / blockchain-tests (push) Failing after 30s
Type Check / type-check (map[directory:. name:root]) (push) Failing after 23s
Type Check / type-check (map[directory:api name:api]) (push) Failing after 21s
Type Check / type-check (map[directory:portal name:portal]) (push) Failing after 19s
Validate Configuration Files / validate (push) Failing after 1m52s
CD Pipeline / Deploy to Production (push) Has been skipped
chore: consolidate local WIP (repo cleanup 20260707)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 09:41:34 -07:00

194 lines
6.7 KiB
Bash
Executable File

#!/bin/bash
# Comprehensive script to verify 250GB drives on R630-01
# Run this script on R630-01 (192.168.11.11) as root
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
echo "=========================================="
echo "R630-01 250GB Drive Verification"
echo "=========================================="
echo "Date: $(date)"
echo "Hostname: $(hostname)"
echo ""
# Check if running as root
if [ "$EUID" -ne 0 ]; then
echo -e "${RED}ERROR: Please run as root${NC}"
exit 1
fi
echo -e "${BLUE}=== Step 1: All Block Devices ===${NC}"
echo "-----------------------------------"
echo "Listing all block devices with details:"
lsblk -o NAME,SIZE,TYPE,MOUNTPOINT,FSTYPE,MODEL,SERIAL,STATE | grep -E "NAME|sd"
echo ""
echo -e "${BLUE}=== Step 2: All Physical Disks ===${NC}"
echo "-----------------------------------"
echo "All disks detected by system:"
fdisk -l 2>/dev/null | grep -E "^Disk /dev/sd" | sort -k2
echo ""
echo -e "${BLUE}=== Step 3: Identifying 250GB Drives ===${NC}"
echo "-----------------------------------"
echo "Drives around 250GB size (232-260 GB):"
echo ""
found_250gb=false
for disk in /dev/sd[a-z]; do
if [ -b "$disk" ]; then
size_info=$(fdisk -l "$disk" 2>/dev/null | grep "^Disk $disk" | awk '{print $3, $4}')
if [ ! -z "$size_info" ]; then
size_num=$(echo "$size_info" | grep -oE '[0-9]+' | head -1)
size_unit=$(echo "$size_info" | grep -oE '[A-Za-z]+' | head -1)
# Check if size is around 250GB (232-260 GB range)
if [ "$size_unit" = "GiB" ] || [ "$size_unit" = "GB" ]; then
if [ "$size_num" -ge 232 ] && [ "$size_num" -le 260 ]; then
echo -e "${GREEN}$disk: ${size_info}${NC}"
found_250gb=true
# Check if it's mounted or in use
mount_point=$(lsblk -n -o MOUNTPOINT "$disk" 2>/dev/null | head -1)
if [ ! -z "$mount_point" ]; then
echo -e " ${YELLOW} WARNING: Mounted at $mount_point${NC}"
fi
# Check if it has partitions
partitions=$(lsblk -n -o NAME "$disk" 2>/dev/null | grep -v "^$(basename $disk)$" | wc -l)
if [ "$partitions" -gt 0 ]; then
echo -e " ${YELLOW} WARNING: Has $partitions partition(s)${NC}"
lsblk "$disk"
else
echo -e " ${GREEN} ✓ No partitions (available for OSD)${NC}"
fi
fi
fi
fi
fi
done
if [ "$found_250gb" = false ]; then
echo -e "${YELLOW} No 250GB drives found in expected size range${NC}"
echo " Checking all drives for reference:"
fdisk -l 2>/dev/null | grep -E "^Disk /dev/sd" | awk '{print " " $0}'
fi
echo ""
echo -e "${BLUE}=== Step 4: Current Ceph OSD Status ===${NC}"
echo "-----------------------------------"
if command -v ceph &> /dev/null; then
echo "Current OSD tree:"
ceph osd tree 2>/dev/null || echo -e "${YELLOW}Ceph command failed or not accessible${NC}"
echo ""
echo "OSD details:"
ceph osd df 2>/dev/null || echo -e "${YELLOW}Ceph command failed${NC}"
echo ""
echo "Ceph health:"
ceph health 2>/dev/null || echo -e "${YELLOW}Ceph command failed${NC}"
else
echo -e "${YELLOW}Ceph command not found${NC}"
fi
echo ""
echo -e "${BLUE}=== Step 5: Storage Pools ===${NC}"
echo "-----------------------------------"
if command -v pvesm &> /dev/null; then
echo "Proxmox storage pools:"
pvesm status 2>/dev/null || echo -e "${YELLOW}pvesm command failed${NC}"
else
echo -e "${YELLOW}pvesm command not found${NC}"
fi
echo ""
echo -e "${BLUE}=== Step 6: Volume Groups ===${NC}"
echo "-----------------------------------"
if command -v vgs &> /dev/null; then
echo "LVM Volume Groups:"
vgs 2>/dev/null || echo -e "${YELLOW}vgs command failed${NC}"
echo ""
echo "Physical Volumes:"
pvs 2>/dev/null || echo -e "${YELLOW}pvs command failed${NC}"
else
echo -e "${YELLOW}LVM commands not found${NC}"
fi
echo ""
echo -e "${BLUE}=== Step 7: Unused/Available Disks ===${NC}"
echo "-----------------------------------"
echo "Checking for disks that could be used for Ceph OSD:"
echo ""
available_count=0
for disk in /dev/sd[a-z]; do
if [ -b "$disk" ]; then
# Skip if it's the boot disk (sda) or current OSD (sdb)
if [ "$disk" = "/dev/sda" ] || [ "$disk" = "/dev/sdb" ]; then
continue
fi
# Check if disk has mount point
mount_point=$(lsblk -n -o MOUNTPOINT "$disk" 2>/dev/null | head -1)
if [ -z "$mount_point" ]; then
# Check if disk is in a volume group
in_vg=$(pvs 2>/dev/null | grep "$disk" | wc -l)
if [ "$in_vg" -eq 0 ]; then
size_info=$(fdisk -l "$disk" 2>/dev/null | grep "^Disk $disk" | awk '{print $3, $4}')
if [ ! -z "$size_info" ]; then
echo -e "${GREEN}$disk: ${size_info} - Potentially available${NC}"
available_count=$((available_count + 1))
# Show disk details
echo " Details:"
lsblk "$disk" | sed 's/^/ /'
fi
fi
fi
fi
done
if [ "$available_count" -eq 0 ]; then
echo -e "${YELLOW} No obviously available disks found${NC}"
echo " All disks may be in use or need further investigation"
fi
echo ""
echo -e "${BLUE}=== Step 8: PERC Controller Status (if available) ===${NC}"
echo "-----------------------------------"
if command -v omreport &> /dev/null; then
echo "PERC controller virtual disks:"
omreport storage vdisk 2>/dev/null || echo -e "${YELLOW}omreport not available or no PERC controller${NC}"
echo ""
echo "PERC controller physical disks:"
omreport storage pdisk 2>/dev/null || echo -e "${YELLOW}omreport not available${NC}"
else
echo -e "${YELLOW}Dell OpenManage tools not installed${NC}"
echo " To install: apt-get install srvadmin-all"
fi
echo ""
echo "=========================================="
echo -e "${GREEN}Verification Complete${NC}"
echo "=========================================="
echo ""
echo "Summary:"
echo "--------"
echo "1. Review the 250GB drives identified above"
echo "2. Check if any are available (no partitions, not mounted, not in VG)"
echo "3. If available, you can create a Ceph OSD with:"
echo ""
echo -e " ${YELLOW}ceph-volume lvm create --data /dev/sdX${NC}"
echo ""
echo " (Replace sdX with the actual device, e.g., sdc, sdd, etc.)"
echo ""
echo "4. After creating OSD, verify with:"
echo " ceph osd tree"
echo " ceph health"
echo ""