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
Co-authored-by: Cursor <cursoragent@cursor.com>
142 lines
4.3 KiB
Bash
Executable File
142 lines
4.3 KiB
Bash
Executable File
#!/bin/bash
|
|
# Format 6x 250GB SSDs and check if Proxmox recognizes them
|
|
# Run on R630-01 as root
|
|
|
|
set -e
|
|
|
|
# Colors
|
|
RED='\033[0;31m'
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
BLUE='\033[0;34m'
|
|
NC='\033[0m'
|
|
|
|
DRIVES=("sdc" "sdd" "sde" "sdf" "sdg" "sdh")
|
|
|
|
echo "=========================================="
|
|
echo "Format 250GB SSDs and Check Proxmox Recognition"
|
|
echo "=========================================="
|
|
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: Current Drive Status ===${NC}"
|
|
echo "-----------------------------------"
|
|
echo "Checking current status of 250GB drives:"
|
|
for drive in "${DRIVES[@]}"; do
|
|
if [ -b "/dev/$drive" ]; then
|
|
size=$(fdisk -l "/dev/$drive" 2>/dev/null | grep "^Disk /dev/$drive" | awk '{print $3, $4}')
|
|
echo " /dev/$drive: $size"
|
|
# Check if has partitions
|
|
partitions=$(lsblk -n /dev/$drive 2>/dev/null | grep -c "part" || echo "0")
|
|
if [ "$partitions" -gt 0 ]; then
|
|
echo -e " ${YELLOW}Has $partitions partition(s)${NC}"
|
|
else
|
|
echo -e " ${GREEN}No partitions (clean)${NC}"
|
|
fi
|
|
else
|
|
echo -e " ${YELLOW}/dev/$drive not found${NC}"
|
|
fi
|
|
done
|
|
echo ""
|
|
|
|
echo -e "${BLUE}=== Step 2: Format Drives (Create Partition Table) ===${NC}"
|
|
echo "-----------------------------------"
|
|
echo -e "${YELLOW}This will create a new partition table on each drive${NC}"
|
|
echo ""
|
|
|
|
for drive in "${DRIVES[@]}"; do
|
|
if [ ! -b "/dev/$drive" ]; then
|
|
echo -e "${YELLOW} /dev/$drive not found, skipping...${NC}"
|
|
continue
|
|
fi
|
|
|
|
echo -e "${BLUE} Formatting /dev/$drive...${NC}"
|
|
|
|
# Unmount any partitions
|
|
umount /dev/${drive}* 2>/dev/null || true
|
|
|
|
# Create new GPT partition table
|
|
echo " Creating GPT partition table..."
|
|
parted -s "/dev/$drive" mklabel gpt 2>&1 || echo " (Partition table may already be GPT)"
|
|
|
|
# Optionally create a single partition (we'll leave it unformatted for now)
|
|
# This makes the drive visible but doesn't format it with a filesystem
|
|
echo " Creating single partition..."
|
|
parted -s "/dev/$drive" mkpart primary 0% 100% 2>&1 || echo " (Partition may already exist)"
|
|
|
|
# Re-read partition table
|
|
partprobe "/dev/$drive" 2>/dev/null || true
|
|
|
|
echo -e "${GREEN} ✓ /dev/$drive formatted${NC}"
|
|
echo ""
|
|
done
|
|
|
|
echo -e "${BLUE}=== Step 3: Check Block Devices ===${NC}"
|
|
echo "-----------------------------------"
|
|
echo "All block devices:"
|
|
lsblk -o NAME,SIZE,TYPE,MOUNTPOINT,FSTYPE,MODEL | grep -E "NAME|sd"
|
|
echo ""
|
|
|
|
echo -e "${BLUE}=== Step 4: Check Proxmox Storage ===${NC}"
|
|
echo "-----------------------------------"
|
|
echo "Proxmox storage status:"
|
|
if command -v pvesm &> /dev/null; then
|
|
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 5: Check Available Disks in Proxmox ===${NC}"
|
|
echo "-----------------------------------"
|
|
echo "Checking if Proxmox can see the drives..."
|
|
|
|
# Check via pvesm
|
|
if command -v pvesm &> /dev/null; then
|
|
echo "Available storage:"
|
|
pvesm status 2>/dev/null | grep -E "Name|Type|Status" || true
|
|
fi
|
|
|
|
# Check via lsblk (what Proxmox would see)
|
|
echo ""
|
|
echo "Drives visible to system:"
|
|
for drive in "${DRIVES[@]}"; do
|
|
if [ -b "/dev/$drive" ]; then
|
|
info=$(lsblk -n -o SIZE,TYPE,MOUNTPOINT,FSTYPE /dev/$drive 2>/dev/null | head -1)
|
|
echo " /dev/$drive: $info"
|
|
fi
|
|
done
|
|
echo ""
|
|
|
|
echo -e "${BLUE}=== Step 6: Check via Proxmox API (if accessible) ===${NC}"
|
|
echo "-----------------------------------"
|
|
echo "Note: To check via Proxmox web UI:"
|
|
echo " 1. Go to Datacenter > Storage"
|
|
echo " 2. Click 'Add' > 'Disk' or 'Directory'"
|
|
echo " 3. Check if drives are listed"
|
|
echo ""
|
|
|
|
echo "=========================================="
|
|
echo -e "${GREEN}Formatting Complete!${NC}"
|
|
echo "=========================================="
|
|
echo ""
|
|
echo "Summary:"
|
|
echo "--------"
|
|
echo "All 6 drives have been formatted with GPT partition tables"
|
|
echo ""
|
|
echo "To check in Proxmox Web UI:"
|
|
echo " 1. Login to Proxmox: https://192.168.11.11:8006"
|
|
echo " 2. Go to: Datacenter > Storage"
|
|
echo " 3. Click 'Add' to see available disks"
|
|
echo ""
|
|
echo "To check via command line:"
|
|
echo " pvesm status"
|
|
echo " lsblk"
|
|
echo ""
|
|
|