You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi tteck and everyone,
I'd like to propose a new utility for the community: PVE-OS-Rescue Kit.
While we have amazing scripts for LXC and VM backups, many users still struggle with a quick way to backup the entire Host OS to a physical USB stick for disaster recovery.
Key Technical Features:
Live LVM Snapshots: Backs up the root partition without stopping VMs/containers.
Smart Zeroing: Includes a "clean free space" script to shrink a 64GB partition down to a ~6GB compressed image.
Portable Logic: The restore scripts are stored on the USB drive itself, making it a true rescue tool even if the host is partially compromised.
UUID Detection: Automatically tracks the specific USB drive to avoid accidental overwrites.
This hybrid approach is a game-changer for Proxmox recovery. By decoupling the OS data from the partition table and bootloader, you’ve solved the "mismatched disk size" headache that usually plagues full-disk clones.
Here is how we should frame this technical distinction for the community:
PVE-OS-Rescue: The Hybrid Advantage
Unlike traditional cloning tools (Clonezilla/dd), this utility focuses on State Restoration:
Hardware Agnostic: Since you start with a clean Proxmox install, the installer handles the local hardware's specific partition alignment, UEFI/BIOS boot, and ZFS/LVM metadata.
The "Debug" Restore: By running the restore script during the Proxmox installer's Debug Mode, you can inject your saved OS state into a freshly prepared environment before the first boot.
Minimalist & Reliable: It avoids the risk of broken GRUB configurations or UUID mismatches on the primary disk, as the foundation is always a native, functional installation.
🚀 PVE-OS-Rescue Kit: Quick Start Guide
This guide explains how to turn a standard USB stick into a disaster recovery tool for your Proxmox host, allowing you to restore your entire OS in minutes—even onto disks of different sizes.
🛠 1. USB Drive Preparation
Plug a USB stick (16GB+ recommended) into your Proxmox server and prepare it to store your backups:
Identify the drive: Use lsblk (e.g., /dev/sdb).
Format to EXT4: Partition and format the drive.
Mount point: mkdir -p /mnt/pve_rescue.
Clone the Repo: Clone the scripts directly onto the USB drive so they are always available.
💾 2. Performing a Live Backup
There is no need to shut down your VMs or containers. The script uses LVM Snapshots to capture a consistent system state while it's running.
Optimization (Smart Zeroing): Run the cleanup script to zero out free space. This shrinks the final backup size significantly (e.g., from 64GB down to ~6GB).
bash
./clean_free_space.sh
Usa il codice con cautela.
Run the Backup:
bash
./backup_os.sh /mnt/pve_rescue
Usa il codice con cautela.
🛠 Technical Changes (v1.5.1 Update)
Deep-Scan Disk Detection:
Replaced the unreliable findmnt logic with a robust pvs + lsblk combination.
The system now precisely identifies the physical parent disk (e.g., /dev/sda or nvme0n1) directly from the pve Volume Group, preventing "empty directory" backup errors.
Three-Component Synchronized Set:
Moved from a single-file approach to a three-file synchronized set per session:
GPT Layout (.bin): Exact partition structure exported via sgdisk.
Boot Partition (.img): Surgical cloning of the EFI or BIOS Boot partition (automatically detected via fdisk).
OS Root (.img.gz): Compressed LVM snapshot image of the system.
Sequential Bare-Metal Restore:
The restore script now follows a logical recovery sequence:
Rebuild the partition table (Layout).
Inject the Bootloader/GRUB (Boot Part).
Write the system data (OS Image).
This enables restoration onto brand-new, empty disks without needing a pre-installed Proxmox environment.
Smart Snapshot Handling:
Added a pre-check that automatically detects and removes orphaned snapshots (root_snap_backup) before starting, preventing backup locks from previous failed attempts.
Set-Aware Deletion:
The menu deletion option (06) now recognizes the backup timestamp and simultaneously removes all three files in the set, keeping the USB storage clean and consistent.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi tteck and everyone,
I'd like to propose a new utility for the community: PVE-OS-Rescue Kit.
While we have amazing scripts for LXC and VM backups, many users still struggle with a quick way to backup the entire Host OS to a physical USB stick for disaster recovery.
Key Technical Features:
Live LVM Snapshots: Backs up the root partition without stopping VMs/containers.
Smart Zeroing: Includes a "clean free space" script to shrink a 64GB partition down to a ~6GB compressed image.
Portable Logic: The restore scripts are stored on the USB drive itself, making it a true rescue tool even if the host is partially compromised.
UUID Detection: Automatically tracks the specific USB drive to avoid accidental overwrites.
https://github.com/casamia67/pve-os-rescue
This hybrid approach is a game-changer for Proxmox recovery. By decoupling the OS data from the partition table and bootloader, you’ve solved the "mismatched disk size" headache that usually plagues full-disk clones.
Here is how we should frame this technical distinction for the community:
PVE-OS-Rescue: The Hybrid Advantage
Unlike traditional cloning tools (Clonezilla/dd), this utility focuses on State Restoration:
Hardware Agnostic: Since you start with a clean Proxmox install, the installer handles the local hardware's specific partition alignment, UEFI/BIOS boot, and ZFS/LVM metadata.
The "Debug" Restore: By running the restore script during the Proxmox installer's Debug Mode, you can inject your saved OS state into a freshly prepared environment before the first boot.
Minimalist & Reliable: It avoids the risk of broken GRUB configurations or UUID mismatches on the primary disk, as the foundation is always a native, functional installation.
🚀 PVE-OS-Rescue Kit: Quick Start Guide
This guide explains how to turn a standard USB stick into a disaster recovery tool for your Proxmox host, allowing you to restore your entire OS in minutes—even onto disks of different sizes.
🛠 1. USB Drive Preparation
Plug a USB stick (16GB+ recommended) into your Proxmox server and prepare it to store your backups:
Identify the drive: Use lsblk (e.g., /dev/sdb).
Format to EXT4: Partition and format the drive.
Mount point: mkdir -p /mnt/pve_rescue.
Clone the Repo: Clone the scripts directly onto the USB drive so they are always available.
💾 2. Performing a Live Backup
There is no need to shut down your VMs or containers. The script uses LVM Snapshots to capture a consistent system state while it's running.
Optimization (Smart Zeroing): Run the cleanup script to zero out free space. This shrinks the final backup size significantly (e.g., from 64GB down to ~6GB).
bash
./clean_free_space.sh
Usa il codice con cautela.
Run the Backup:
bash
./backup_os.sh /mnt/pve_rescue
Usa il codice con cautela.
Beta Was this translation helpful? Give feedback.
All reactions