Files
proxmox/scripts/fix-ct-2301-corrupted-rootfs.sh

42 lines
1.8 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
# CT 2301 (besu-rpc-private-1) - Corrupted rootfs recovery
#
# Root cause: Mount fails with "wrong fs type, bad superblock" - filesystem on
# vm-2301-disk-0 is corrupted (ext4 superblock invalid).
#
# Options:
# 1. RECREATE: Destroy container and recreate with fresh disk (data loss)
# 2. RESTORE: Restore from backup if available
# 3. RECOVERY: Attempt fsck (risky, may not work)
#
# Usage: Run on Proxmox host ml110 (${PROXMOX_HOST_ML110:-192.168.11.10}) or via: ssh root@${PROXMOX_HOST_ML110:-192.168.11.10} 'bash -s' < scripts/fix-ct-2301-corrupted-rootfs.sh
set -euo pipefail
PROXMOX_HOST="${PROXMOX_HOST:-192.168.11.10}"
VMID=2301
echo "=== CT 2301 Rootfs Recovery Options ==="
echo ""
echo "Diagnosis:"
echo " - Container: besu-rpc-private-1 (${RPC_PRIVATE_1:-192.168.11.232})"
echo " - Error: mount fails - 'Can't find ext4 filesystem', 'bad superblock'"
echo " - Root cause: Corrupted or invalid filesystem on vm-2301-disk-0"
echo ""
echo "Option A - fsck (already attempted - backup superblocks invalid):"
echo " # e2fsck -fy -b 8193 /dev/pve/vm-2301-disk-0 - failed"
echo " # Disk appears unrecoverable; prefer Option B or C"
echo ""
echo "Option B - Recreate container (DATA LOSS):"
echo " 1. pct destroy $VMID --purge 1 # Removes container and disk"
echo " 2. Create new CT with same VMID and IP ${RPC_PRIVATE_1:-192.168.11.232}"
echo " 3. Reinstall Besu, restore config from other RPC nodes"
echo ""
echo "Option C - Restore from backup:"
echo " vzdump $VMID # Backup other containers first"
echo " pct restore $VMID /path/to/backup.tar.zst --storage local-lvm"
echo ""
echo "To run fsck attempt (Option A), execute on host:"
echo " ssh root@$PROXMOX_HOST 'pct stop $VMID 2>/dev/null; e2fsck -fy /dev/pve/vm-2301-disk-0 2>&1 || true'"
echo ""