Proxmox Backup Server (PBS)#


1 Installation & Post-Install#

1.1 Post-Install Optimization#

Run this script to configure repositories and optimize settings:

bash -c "$(wget -qLO - [https://github.com/community-scripts/ProxmoxVE/raw/main/misc/post-pbs-install.sh](https://github.com/community-scripts/ProxmoxVE/raw/main/misc/post-pbs-install.sh))"

1.2 Install File Browser#

bash -c "$(wget -qLO - [https://github.com/tteck/Proxmox/raw/main/misc/filebrowser.sh](https://github.com/tteck/Proxmox/raw/main/misc/filebrowser.sh))"

2 Setup VM with SMB Datastore#

2.1 Create Mount Directory#

mkdir /mnt/HP1ProxmoxBackupServer

2.2 Configure Credentials#

nano /etc/samba/.smbcreds

File Content:

username=proxmox
password=private

2.3 Set Permissions#

Change permission to Read-Only by root:

chmod 400 /etc/samba/.smbcreds

2.4 Manual Mount Test#

mount -t cifs -o rw,vers=3.0,credentials=/etc/samba/.smbcreds,uid=34,gid=34 //10.1.1.225/HP1ProxmoxBackupServer /mnt/HP1ProxmoxBackupServer

2.5 Permanent Mount (fstab)#

nano /etc/fstab

Add line:

//10.1.1.225/HP1ProxmoxBackupServer /mnt/HP1ProxmoxBackupServer cifs vers=3.0,credentials=/etc/samba/.smbcreds,uid=34,gid=34,defaults 0 0

3 Datastore Management#

3.1 Remove a Datastore#

systemctl restart proxmox-backup.service
systemctl restart proxmox-backup-proxy.service
proxmox-backup-manager datastore remove Backups
# Delete files (Delay if large, check progress with df -h)
rm -r /mnt/datastore/Backups
systemctl disable zfs-import@Backups

3.2 Import Datastore from Previous Install#

  1. Import ZFS Pool:
zpool import -f Backups
  1. Configure Datastore Config:
nano /etc/proxmox-backup/datastore.cfg

Add:

datastore: Backups
    path /mnt/datastore/Backups

If mount fails:

mkdir -p /mnt/datastore/Backups
zfs set mountpoint=/mnt/datastore/Backups Backups

4 ZFS Pool Operations#

4.1 Create Pool#

Stripe (Raid0):

zpool create -f -o ashift=12 Backups /dev/sdb /dev/sdc

Mirror (Raid10 Style):

zpool create -f -o ashift=12 Backups mirror sda sdb mirror sdc sdd mirror sde sdf mirror sdg sdh

4.2 Quota Management#

# Set quota to 2722G
zfs set quota=2722G Backups
# Verify quota
zfs get quota Backups
# Remove quota
zfs set quota=none Backups

4.3 Emergency disk space reclaim without waiting 24 hours#

# Set the cutoff to 1 minute
proxmox-backup-manager datastore update Backups --tuning gc-atime-cutoff=1,gc-atime-safety-check=0
# Run the Garbage Collection
proxmox-backup-manager garbage-collection start Backups
# Restore Safety Defaults
proxmox-backup-manager datastore update Backups --tuning gc-atime-cutoff=1445,gc-atime-safety-check=1

4.4 Destroy ZFS Pool#

systemctl restart proxmox-backup.service
systemctl restart proxmox-backup-proxy.service
zpool destroy -f Backups

5 Troubleshooting Disk Issues#

5.1 Wipe Busy Device#

If “Device or resource busy” appears:

wipefs -fa /dev/sdb
dd if=/dev/zero of=/dev/sdb bs=1M count=1000
udevadm settle
reboot

5.2 Force Wipe All#

wipefs --force --all /dev/sda

6 Performance & Maintenance#

6.1 Benchmark#

proxmox-backup-client benchmark

6.2 Crontab for HP1 (Recursive Backup)#

Allows backing up the PBS VM into the same VM.

crontab -e

Entry:

# Pour permettre la sauvegagrade de la VM dans la même VM
00 03 * * * /usr/bin/systemctl stop qemu-guest-agent 
30 03 * * * /usr/bin/systemctl start qemu-guest-agent

7 Proxmox VE (Host) Backup Setup#

7.1 Install Tools#

apt update && apt install cifs-utils -y

7.2 Setup SMB Mount#

mkdir -p /mnt/pve/Software
nano /root/.smb_credentials
# [Add username=xxx and password=xxx]
chmod 600 /root/.smb_credentials

7.3 Persistence & Mounting#

echo "//10.1.2.2/Software /mnt/pve/Software cifs credentials=/root/.smb_credentials,iocharset=utf8,noperm,_netdev,nofail 0 0" >> /etc/fstab
systemctl daemon-reload
mount -a