Proxmox Backup server to USB Drive: A Practical Guide¶
For using a all purpose external drive (22TB) that can be used for any VM, including PBS, I like mounting it to the host and creating Viotiofs drives on the VMs. This just makes the external drives so flexible and easy to use.
Step 1: Mount your USB drive to host¶
I still haven't find an easy way to do this in Proxmox VE, so I still utilize Cockpit to easily to this.
Step 2: Creating a Directory Mapping¶
At the Datacenter level, Add a Directory Mapping, you can call it something like PBS-Directory, and you can add this to a sub folder of where it's mounted on the host (in the case you might create other directory mappings for other purposes). So the directory mapping my be to /mnt/external22TB/backups.
Step 3: Create the PBS VM¶
First grab the iso if you haven't already. You can click on your local storage under your node in the file tree, then click on ISO Images. Navigate to the proxmox backup server downloads, https://www.proxmox.com/en/downloads/proxmox-backup-server, right click on the Download button for the latest installer, and copy the link. You can then click the Download from URL button in proxmox and paste the link.
The VM needs 10GB of storage, 2 GB of RAM and 2 cpus.
Step 4: Mount the storage¶
Go to the PBS VM in proxmox and go to Hardware. Add a Virtiofs. Select the directory id you created from earlier, i.e. PBS-Directory.
Hope over to the PBS web application at the IP of the PBS VM and port 8007. Enter the console, we're going to mount the storage.
To mount the drive inside of the VM, run the following:
Then add it to fstab
Add this line
Tip
Replace <Name-Given-to-Virtiofs-in-proxmox> with the Directory Mapping ID, i.e. PBS-Directory. You can call the the mount folder whatever you like, I chose /mnt/pbs-backup.
Now you can click Add Datastore, give it a name like backup-local, choose Local, and choose the mounted path, i.e. /mnt/pbs-backup. Set the desired prune options. Click on the Datastore you just created, and you should see an accurate representation of the size of the physical drive. Let's adjust one setting - click on Options, and set Verify New Snapshots to Yes. This will ensure our snapshots are good after it takes the snapshots.
Step 5: Create a User account for PVE to use¶
Go to Configuration -> Access Control, and click Add to create a new user. You can call it proxmox, and give it a password. Click on the user, then click Permissions. Click Add, and set the path to /datastore and give the role of DatastoreAdmin.
Step 6: Configure PBS as a storage device¶
Back in Proxmox VE, click on Datacenter -> Storage, then click Add, choose Proxmox Backup Server. The id can be pbs-backup-local. For Server enter the IP address of the PBS VM. Add the username (proxmox@pbs) we just created and password. Then for datastore, this will be /datastore/backup-local, or whatever you called your datastore. You should now see this pbs-backup-local drive under your other drives in the filetree.
Step 7: Configure the backup job¶
Go to Datacenter -> Backup. Click Add, and for storage, select the pbs-backup-local. Select a schedule that you want. Select the VMs and LXCs that you want to backup. You are now good to go!