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>
108 lines
3.1 KiB
Bash
Executable File
108 lines
3.1 KiB
Bash
Executable File
#!/bin/bash
|
|
# Script to wipe all 6x 250GB drives (sdc, sdd, sde, sdf, sdg, sdh)
|
|
# Run on R630-01 as root
|
|
# WARNING: This will destroy all data on these drives!
|
|
|
|
set -e
|
|
|
|
# Colors
|
|
RED='\033[0;31m'
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
BLUE='\033[0;34m'
|
|
NC='\033[0m'
|
|
|
|
# Drives to wipe
|
|
DRIVES=("sdc" "sdd" "sde" "sdf" "sdg" "sdh")
|
|
|
|
echo "=========================================="
|
|
echo "Wipe All 250GB Drives"
|
|
echo "=========================================="
|
|
echo ""
|
|
echo -e "${RED}WARNING: This will destroy ALL data on these drives!${NC}"
|
|
echo "Drives to wipe: ${DRIVES[@]}"
|
|
echo ""
|
|
read -p "Are you sure you want to continue? (type 'yes' to confirm): " confirm
|
|
|
|
if [ "$confirm" != "yes" ]; then
|
|
echo "Aborted"
|
|
exit 0
|
|
fi
|
|
|
|
echo ""
|
|
echo -e "${BLUE}=== Step 1: Removing from ubuntu-vg ===${NC}"
|
|
echo "-----------------------------------"
|
|
|
|
# Check if ubuntu-vg exists and has mounted volumes
|
|
if vgs ubuntu-vg &>/dev/null; then
|
|
echo "Checking ubuntu-vg status..."
|
|
|
|
# Unmount any mounted logical volumes
|
|
echo " Unmounting logical volumes..."
|
|
umount /dev/ubuntu-vg/* 2>/dev/null || true
|
|
|
|
# Deactivate volume group
|
|
echo " Deactivating ubuntu-vg..."
|
|
vgchange -a n ubuntu-vg 2>/dev/null || true
|
|
|
|
# Remove physical volumes from ubuntu-vg
|
|
echo " Removing physical volumes from ubuntu-vg..."
|
|
for drive in "${DRIVES[@]}"; do
|
|
if pvs 2>/dev/null | grep -q "/dev/${drive}3.*ubuntu-vg"; then
|
|
echo " Removing /dev/${drive}3 from ubuntu-vg..."
|
|
pvremove "/dev/${drive}3" -y -ff 2>/dev/null || echo " (Already removed or not in VG)"
|
|
fi
|
|
done
|
|
|
|
echo -e "${GREEN} ✓ Removed from ubuntu-vg${NC}"
|
|
else
|
|
echo -e "${YELLOW} ubuntu-vg not found or already removed${NC}"
|
|
fi
|
|
echo ""
|
|
|
|
echo -e "${BLUE}=== Step 2: Wiping All Drives ===${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} Wiping /dev/$drive...${NC}"
|
|
|
|
# Unmount any partitions
|
|
umount /dev/${drive}* 2>/dev/null || true
|
|
|
|
# Wipe filesystem signatures
|
|
echo " Removing filesystem signatures..."
|
|
wipefs -a "/dev/$drive" 2>/dev/null || true
|
|
|
|
# Zero out first 100MB
|
|
echo " Zeroing first 100MB..."
|
|
dd if=/dev/zero of="/dev/$drive" bs=1M count=100 status=progress 2>/dev/null || true
|
|
|
|
echo -e "${GREEN} ✓ /dev/$drive wiped${NC}"
|
|
echo ""
|
|
done
|
|
|
|
echo "=========================================="
|
|
echo -e "${GREEN}All Drives Wiped Successfully!${NC}"
|
|
echo "=========================================="
|
|
echo ""
|
|
echo "Next steps:"
|
|
echo "1. Create Ceph OSD on one drive (for third OSD):"
|
|
echo " ceph-volume lvm create --data /dev/sdc"
|
|
echo ""
|
|
echo "2. Or create OSDs on multiple drives (for better performance):"
|
|
echo " ceph-volume lvm create --data /dev/sdc"
|
|
echo " ceph-volume lvm create --data /dev/sdd"
|
|
echo " ceph-volume lvm create --data /dev/sde"
|
|
echo " # ... etc"
|
|
echo ""
|
|
echo "3. Verify:"
|
|
echo " ceph osd tree"
|
|
echo " ceph health"
|
|
echo ""
|
|
|