Imaging a bare-metal system using Proxmox Backup Client
Since I like to image systems I’m testing, here’s the process I use to capture the boot drive of a bare metal system in Proxmox Backup Server. I start by booting into a Debian Live image (the small one without a GUI).
Next, I install Proxmox Backup Client from apt packages:
#Run as root
sudo bash
#Add repo
wget https://enterprise.proxmox.com/debian/proxmox-release-bookworm.gpg -O /etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg
echo "deb http://download.proxmox.com/debian/pbs-client bookworm main" > /etc/apt/sources.list.d/pbs-client.list
#Install PBS
apt update
apt install proxmox-backup-client -y
After that, I set the environment variables for the backup client (I have a doc I can copy/paste from into my USB KVM):
#Environment variables - these will be your Proxmox Backup user and stuff
export PBS_REPOSITORY=user@realm@dns_name.lan:datastore
export PBS_PASSWORD=api_key
export PBS_FINGERPRINT="fingerprint"
And finaly, run the image itself. The ‘backup-id’ comes across as ‘host’ in PBS, so I name it only once per physical system, and I can add notes later in the PBS UI as to which backup of the dxp4800 this was. Syntax is
#Backup command
#root.img is the name of the image (stored in the backup), you can add this multiple times for multiple disks
#/dev/nvme0n1 is the disk that will be copied into root.img
#backup-id is the 'host name' as stored in Proxmox Backup Server
proxmox-backup-client backup root.img:/dev/nvme0n1 --backup-id "ugreen-dxp4800"
Restore works similarly, except we do restore instead of backup:
#Restore command
#Copy the backup id from the PBS UI
#root.img is the name of the image from the backup
#/dev/nvme0n1 is the disk we are restoring onto
proxmox-backup-client restore host/hostname/2024-06-30T12:11:46Z root.img - | sudo dd of=/dev/nvme0n1 status=progress bs=1M