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
Add another disk to your VM/CT
Reboot it
Install the required dependencies:
apt update -y
apt install xfsprogs -y
Create a Volume Group and Logical Volume with your disk in it
Create an XFS Filesystem in /dev/mapper/backuppc–vg-backuppc–lv
mkfs.xfs /dev/mapper/backuppc--vg-backuppc--lv
- 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
- 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
- Mount the path
mount /var/lib/backuppc
- Copy your data back to the new directory
rsync -avh /opt/backuppcdata /var/lib/backuppc
Done. Rebooting is recommended.