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/HP1ProxmoxBackupServer2.2 Configure Credentials#
nano /etc/samba/.smbcredsFile Content:
username=proxmox
password=private2.3 Set Permissions#
Change permission to Read-Only by root:
chmod 400 /etc/samba/.smbcreds2.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/HP1ProxmoxBackupServer2.5 Permanent Mount (fstab)#
nano /etc/fstabAdd line:
//10.1.1.225/HP1ProxmoxBackupServer /mnt/HP1ProxmoxBackupServer cifs vers=3.0,credentials=/etc/samba/.smbcreds,uid=34,gid=34,defaults 0 03 Datastore Management#
3.1 Remove a Datastore#
systemctl restart proxmox-backup.service
systemctl restart proxmox-backup-proxy.serviceproxmox-backup-manager datastore remove Backups# Delete files (Delay if large, check progress with df -h)
rm -r /mnt/datastore/Backupssystemctl disable zfs-import@Backups3.2 Import Datastore from Previous Install#
- Import ZFS Pool:
zpool import -f Backups- Configure Datastore Config:
nano /etc/proxmox-backup/datastore.cfgAdd:
datastore: Backups
path /mnt/datastore/BackupsIf mount fails:
mkdir -p /mnt/datastore/Backups
zfs set mountpoint=/mnt/datastore/Backups Backups4 ZFS Pool Operations#
4.1 Create Pool#
Stripe (Raid0):
zpool create -f -o ashift=12 Backups /dev/sdb /dev/sdcMirror (Raid10 Style):
zpool create -f -o ashift=12 Backups mirror sda sdb mirror sdc sdd mirror sde sdf mirror sdg sdh4.2 Quota Management#
# Set quota to 2722G
zfs set quota=2722G Backups# Verify quota
zfs get quota Backups# Remove quota
zfs set quota=none Backups4.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=14.4 Destroy ZFS Pool#
systemctl restart proxmox-backup.service
systemctl restart proxmox-backup-proxy.servicezpool destroy -f Backups5 Troubleshooting Disk Issues#
5.1 Wipe Busy Device#
If “Device or resource busy” appears:
wipefs -fa /dev/sdbdd if=/dev/zero of=/dev/sdb bs=1M count=1000udevadm settle
reboot5.2 Force Wipe All#
wipefs --force --all /dev/sda6 Performance & Maintenance#
6.1 Benchmark#
proxmox-backup-client benchmark6.2 Crontab for HP1 (Recursive Backup)#
Allows backing up the PBS VM into the same VM.
crontab -eEntry:
# 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-agent7 Proxmox VE (Host) Backup Setup#
7.1 Install Tools#
apt update && apt install cifs-utils -y7.2 Setup SMB Mount#
mkdir -p /mnt/pve/Softwarenano /root/.smb_credentials
# [Add username=xxx and password=xxx]chmod 600 /root/.smb_credentials7.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/fstabsystemctl daemon-reload
mount -a