Skip to main content

Backupserver petit-backup

Armbian von hier.

Grundsetup

Armbian Setup
Create root password: ****************************************
Repeat root password: ****************************************

Choose default system command shell:

1) bash
2) zsh

1

Please provide a username (eg. your first name): admin

Create user (admin) password: ****************************************
Repeat user (admin) password: ****************************************

Please provide your real name: Admin

Set user language based on your location? [Y/n] n

At your location, more locales are possible:
[..]
Please enter your choice: 154) Skip generating locales
System Setup
#Passwordless Sudo
sudo visudo
#Edit line: %sudo   ALL=(ALL:ALL) NOPASSWD:ALL

#Image auf neuen Stand bringen
sudo apt update
sudo apt upgrade
sudo apt dist-upgrade

#Hostname
echo "petit-backup" | sudo tee /etc/hostname

#Add SSH Key
mkdir ~/.ssh
echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCsLI18nShd47L6o4dL2sIbhJAlWdXXc7BBSqhslTBMVziY6OBazW2jxxU0eN+Wi3RYEuOUd3xt6f56m6NgB96MxvRbfhD06FCetrEzEX/k7yWRVlvyMOSX0RjTr2UWPqOpXmLvbpOvTX4m4+rhpXlXJ1FB/jiZGNYvQEXot8PFTkMBdP0rHsdXiHhJvJy8Y/jDoErrCrK+Yger9ziCeskr3t/KET1nD6e/g4lQwVr7YftMw9s/0RiSVU4VQnUHjMiyXMpg8SD54YkmaQ8TJ14dQ3LVvMjXNGhg3fmmmxQMWot64oLe5HvNJigmKDfYxUzQuX8Ba2zAcnvHkLp/RpVB krume@YatagarasuDrive" > ~/.ssh/authorized_keys
chmod -R u=Xrw,g=r,o= ~/.ssh

#Fix stupid default SSH settings
sudo sed -i 's/PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config
sudo sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config

#Install Kernel 5.17.5 (edge) with armbian-config (see https://forum.armbian.com/topic/19336-armbian-ubuntu-2204-jammy-with-zfs-211-for-odroid-hc4/)
sudo armbian-config
ZFS
sudo apt install linux-headers-edge-meson64
sudo apt install zfs-dkms zfsutils-linux

sudo zpool create -f -m /mnt/data petit-backup-data raidz /dev/sda /dev/sdb /dev/sdc /dev/sdd

Die aktuelle Version von ZFS hat einen Bug, wodurch das automatische Importieren des Pools beim Boot nicht funktioniert: https://github.com/openzfs/zfs/issues/11587
Fix: 30 Sekunden delay für den Dienst zfs-import-cache hinzufügen:

/etc/systemd/system/zfs-import.target.wants/zfs-import-cache.service
[Unit]
Description=Import ZFS pools by cache file
Documentation=man:zpool(8)
DefaultDependencies=no
Requires=systemd-udev-settle.service
Requires=zfs-load-module.service
After=systemd-udev-settle.service
After=zfs-load-module.service
After=cryptsetup.target
After=multipathd.target
After=systemd-remount-fs.service
Before=zfs-import.target
ConditionFileNotEmpty=/etc/zfs/zpool.cache
ConditionPathIsDirectory=/sys/module/zfs

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStartPre=/usr/bin/sleep 30
ExecStart=/sbin/zpool import -c /etc/zfs/zpool.cache -aN $ZPOOL_IMPORT_OPTS

[Install]
WantedBy=zfs-import.target

BackupPC

#BackupPC
sudo apt install backuppc
#TODO