Moving the BackupPC volume to an LVM

If you wish to move BackupPC to a different array of disks with LVM and XFS (highly recommended), then you have to do the following:

Let’s assume /dev/mapper/backuppc–vg-backuppc–lv is our Logical Volume

  1. Add another disk to your VM/CT

  2. Reboot it

  3. Install the required dependencies:

apt update -y
apt install xfsprogs -y
  1. Create a Volume Group and Logical Volume with your disk in it

  2. Create an XFS Filesystem in /dev/mapper/backuppc–vg-backuppc–lv

mkfs.xfs /dev/mapper/backuppc--vg-backuppc--lv
  1. Copy all the data in /var/lib/backuppc to a secondary directory
mkdir /opt/backuppcdata
# Use Archive mode to preserve links and most data
rsync -avh /var/lib/backuppc /opt/backuppcdata
  1. Mount your /dev/mapper/backuppc–vg-backuppc–lv to the /var/lib/backuppc directory by adding it to your /etc/fstab file as an XFS Filesystem.
# /etc/fstab
# BackupPC Volume
/dev/mapper/backuppc--vg-backuppc--lv /var/lib/backuppc xfs     defaults        0 2
  1. Mount the path
mount /var/lib/backuppc
  1. Copy your data back to the new directory
rsync -avh /opt/backuppcdata /var/lib/backuppc

Done. Rebooting is recommended.