Table of Contents

Proxmox Backup Server

Install on Proxmox VE

No Subscription

cat <<EOF >> /etc/apt/sources.list.d/proxmox.sources

Types: deb
URIs: http://download.proxmox.com/debian/pbs
Suites: trixie
Components: pbs-no-subscription
Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg
EOF
apt update
apt install proxmox-backup-server

Enterprise

cat <<EOF >> /etc/apt/sources.list.d/pbs-enterprise.sources

Types: deb
URIs: https://enterprise.proxmox.com/debian/pbs
Suites: trixie
Components: pbs-enterprise
Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg
EOF
apt update
apt install proxmox-backup-server

iSCSI

apt update && apt install open-iscsi
nano /etc/iscsi/iscsid.conf

set startup to automatic in /etc/iscsi/iscsid.conf

# To request that the iscsi service scripts startup a session, use "automatic":
# node.startup = automatic
#
# To manually startup the session, use "manual". The default is manual.
node.startup = automatic
iscsiadm --mode discovery -t sendtargets --portal 10.52.12.13:3260
iscsiadm --mode node --targetname iqn.2004-04.com.qnap:ts-435xeu:iscsi.target-0.965df6 --portal 10.52.12.13:3260 --login
iscsiadm --mode session -P 3
fdisk -l
gdisk /dev/sdb1
fdisk -l
mkfs.ext4 /dev/sdb1
mkdir /mnt/backup
blkid
mount UUID=d6ed961a-717e-404b-9d8c-71cea8ecda04 /mnt/backup

/etc/fstab

UUID=d6ed961a-717e-404b-9d8c-71cea8ecda04 /mnt/backup ext4 _netdev 0 0

load new fstab

systemctl daemon-reload

create datastore on pbs

proxmox-backup-manager datastore create remote-iscsi /mnt/backup

CHAP

configure chap settings in /etc/iscsi/iscsid.conf

# *************
# CHAP Settings
# *************

# To enable CHAP authentication set node.session.auth.authmethod
# to CHAP. The default is None.
#
# NOTE: currently this attribute is checked for validity but then
# ignored, so even if it is set to None, CHAP will be used if the
# credentials (username/password and possibly username_in/password_in)
# are set. This behavior is deprecated, and in the future CHAP will
# not be used if authmethod is set to None.
#
node.session.auth.authmethod = CHAP

# To configure which CHAP algorithms to enable, set
# node.session.auth.chap_algs to a comma separated list.
# The algorithms should be listed in order of decreasing
# preference - in particular, with the most preferred algorithm first.
# Valid values are MD5, SHA1, SHA256, and SHA3-256.
# The default is MD5.
#node.session.auth.chap_algs = SHA3-256,SHA256,SHA1,MD5

# To set a CHAP username and password for initiator
# authentication by the target(s), uncomment the following lines:
node.session.auth.username = initiator-iscsi
node.session.auth.password = <12-16 alphanumeric>

# To set a CHAP username and password for target(s)
# authentication by the initiator, uncomment the following lines:
node.session.auth.username_in = target-iscsi
node.session.auth.password_in = <12-16 alphanumeric>

Commands

iscsiadm --mode node --targetname iqn.2004-04.com.qnap:ts-435xeu:iscsi.target-0.965df6 --portal 10.52.12.13:3260 --login    # login
iscsiadm --mode node --targetname iqn.2004-04.com.qnap:ts-435xeu:iscsi.target-0.965df6 --portal 10.52.12.13:3260 --logout   # logout

SMB

apt update
apt install

test mount smb share

mount -t cifs -o user=<username-sub> //<username-sub>.your-storagebox.de/<username-sub> /backup --verbose

create credentials file

cat <<EOF >> ~/.sharelogin
user=username  
password=password
EOF

make file only readable by root / current user

chmod 0400 ~/.sharelogin

add to /etc/fstab

//<username-sub>.your-storagebox.de/<username-sub> /backup cifs credentials=/root/.sharelogin,uid=backup,gid=backup,noperm,rw 0 0
#//<username-sub>.your-storagebox.de/<username-sub> /backup cifs credentials=/root/.sharelogin,uid=backup,gid=backup,file_mode=0777,dir_mode=0777,noperm,rw 0 0
proxmox-backup-manager datastore create remote-smb /backup

Client

proxmox-backup-client backup etc.pxar:/etc/ --repository <username>@<realm>!<token>@<hostname>:<datastore>             # backup etc to archive etc.pxar on pbs
backup-pve-config.sh
#!/bin/bash
export PBS_REPOSITORY=pbs-pveuser@pbs!pve-config-backup@pbs01:backupstore-01
export PBS_PASSWORD=<pbs api token>
export PBS_FINGERPRINT=<backupstore-01 fingerprint>
 
/usr/bin/proxmox-backup-client backup etc.pxar:/etc/ config-db.img:/var/lib/pve-cluster/config.db --include-dev /etc/pve --keyfile /etc/pve/priv/storage/backupstore-01.enc