vm-bhyve/Debian13/setup-debian-nfs.sh hinzugefügt
This commit is contained in:
47
vm-bhyve/Debian13/setup-debian-nfs.sh
Normal file
47
vm-bhyve/Debian13/setup-debian-nfs.sh
Normal file
@@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
# ============================================
|
||||
# Debian NFS-Client Setup für XigmaNAS-Server
|
||||
# Umgebung: bhyve VM (guest="debian")
|
||||
# Autor: (du 😎)
|
||||
# ============================================
|
||||
|
||||
set -e
|
||||
|
||||
# ---------- Konfiguration ----------
|
||||
SERVER="xigmanas.lan"
|
||||
DATASET_REMOTE="/Backups/docker"
|
||||
MOUNTPOINT_LOCAL="/docker/backups"
|
||||
LAN_IP="172.16.1.51" # IP der Debian-VM im LAN
|
||||
# ----------------------------------
|
||||
|
||||
echo "==> System aktualisieren und Pakete installieren..."
|
||||
apt update -y
|
||||
apt install -y nfs-common rpcbind nano
|
||||
|
||||
echo "==> Start- und Autostart der NFS-Dienste..."
|
||||
systemctl enable --now rpcbind
|
||||
systemctl enable --now nfs-client.target
|
||||
systemctl enable --now rpc-statd || true
|
||||
|
||||
echo "==> Lokale Mount-Verzeichnisse erstellen..."
|
||||
mkdir -p "${MOUNTPOINT_LOCAL}"
|
||||
|
||||
echo "==> Aktuelle fstab sichern..."
|
||||
cp /etc/fstab /etc/fstab.bak.$(date +%F_%H%M)
|
||||
|
||||
echo "==> NFS-Eintrag in /etc/fstab hinzufügen (NFSv4 über LAN)..."
|
||||
grep -q "${MOUNTPOINT_LOCAL}" /etc/fstab || cat <<EOF >> /etc/fstab
|
||||
|
||||
# XigmaNAS NFSv4-Export
|
||||
${SERVER}:${DATASET_REMOTE} ${MOUNTPOINT_LOCAL} nfs4 rw,_netdev,nofail,sec=sys,minorversion=1,proto=tcp,sourceaddr=${LAN_IP} 0 0
|
||||
EOF
|
||||
|
||||
echo "==> Mount testen..."
|
||||
mount -a || echo "WARNUNG: Mount fehlgeschlagen, bitte prüfen mit 'journalctl -xe'"
|
||||
|
||||
echo "==> Ergebnis prüfen:"
|
||||
findmnt -t nfs4 -o TARGET,SOURCE,FSTYPE,OPTIONS | grep "${MOUNTPOINT_LOCAL}" || true
|
||||
|
||||
echo
|
||||
echo "✅ Einrichtung abgeschlossen."
|
||||
echo "Falls du Tailscale nutzt: Der Mount läuft jetzt über ${LAN_IP} (nicht über 100.64.x.x)."
|
||||
Reference in New Issue
Block a user