[TUTORIAL] xfsdump a running pve node root partition?

racitup

Member
Dec 9, 2021
18
2
8
44
Would it be possible to use xfsdump (or xfs_copy) to backup a running pve node root partition, which is xfs within a LV?
The reason:
I only have one PVE, so no cluster. I have all my containers backed up offsite to PBS.
But not backing up the PVE makes me a bit vulnerable. I've made all sorts of tweaks to networking, am storing some files on the PVE, etc.
The backup wouldn't need to be very often, maybe once per month.

For bonus points: is it then possible to upload the dump to the same PBS server?


Edit: I answered my own question, however the bonus points are still up for grabs!

Bash:
#!/bin/bash
# Use xfsdump to backup the root pve fs
prefix="/var/lib/vz/snippets/"
mkdir -p "$prefix"
fn=$(date "+%Y%m%d_%H%M%S")_$(hostname)_pveroot.xfsdump
fp="$prefix$fn"
echo "XFS dumping / to $fp"
# Install the xfsdump package first
xfsdump -f "$fp" -L "$fn" -M "$fn" /
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!