vHost verschieben

Alles klar — dann brauchst du jetzt das gleiche Vorgehen für die produktive Maschine, aber sauber als Runbook mit Checks, Wartungsfenster, Umzug und Rollback.

Wichtig: Auf deiner Produktivumgebung kann die „große Platte“ entweder wie bei deinem Test als /home (LVM) vorhanden sein oder als eigenes Device. Darum ist Schritt 1 immer: korrektes Ziel identifizieren (nicht blind /dev/sdb1).

Produktiv-Runbook: Plesk vhosts von / auf große Partition verschieben (AlmaLinux)

0) Vorbereitungen (Check + Info sammeln)

bash

df -h
lsblk -f
getenforce
du -sh /var/www/vhosts 2>/dev/null

Entscheidung:


Variante A (wie in deinem Test): Große Partition ist bereits /home

1) Wartungsfenster: Webserver stoppen

bash

systemctl stop nginx
systemctl stop httpd

2) Zielordner auf großer Partition anlegen

bash

mkdir -p /home/vhosts

3) Daten kopieren (sicher)

bash

rsync -aHAX --numeric-ids --info=progress2 /var/www/vhosts/ /home/vhosts/

4) Umschalten per bind mount (Plesk-kompatibel)

bash

mv /var/www/vhosts /var/www/vhosts.old
mkdir -p /var/www/vhosts
mount --bind /home/vhosts /var/www/vhosts

5) Persistenz in /etc/fstab

bash

grep -q "^/home/vhosts /var/www/vhosts" /etc/fstab || \
echo "/home/vhosts /var/www/vhosts none bind 0 0" >> /etc/fstab

mount -a

6) SELinux Labels fixen (Enforcing!)

bash

restorecon -Rv /var/www/vhosts
restorecon -Rv /var/www/vhosts/system

7) Plesk Repair + Services starten

bash

plesk repair fs -y
plesk repair web -y

systemctl start httpd
systemctl start nginx

8) Prüfen, dass es wirklich auf der großen Partition liegt

bash

df -h /var/www/vhosts
mount | grep /var/www/vhosts

9) Wenn alles OK: alten Ordner löschen (macht Platz auf /)

bash

rm -rf /var/www/vhosts.old


Variante B: Du hast eine separate neue Platte/Partition (nicht gemountet)

  1. Device finden:

bash

lsblk -f

  1. Mountpoint:

bash

mkdir -p /mnt/storage

  1. Mount (Device anpassen, z. B. /dev/sdb1 oder /dev/vdb1):

bash

mount /dev/DEIN_DEVICE /mnt/storage
df -h /mnt/storage

  1. Persistenz via UUID:

bash

blkid

/etc/fstab ergänzen (Beispiel):

text

UUID=xxxx /mnt/storage xfs defaults,noatime 0 0

Dann folgt der gleiche Ablauf wie oben, nur Ziel ist /mnt/storage/vhosts statt /home/vhosts.


Rollback (falls etwas schiefgeht)

bash

systemctl stop nginx
systemctl stop httpd

umount /var/www/vhosts

rm -rf /var/www/vhosts
mv /var/www/vhosts.old /var/www/vhosts

# fstab bind-zeile entfernen (manuell) und:
mount -a

systemctl start httpd
systemctl start nginx


Zwei kurze Fragen, damit ich dir die Kommandos 1:1 ohne Varianten ausgeben kann:

  1. In der Produktivumgebung: zeigt lsblk -f die große Partition als /home (wie im Test) oder als extra Device (z. B. /dev/sdb1)?

  2. Wie groß ist du -sh /var/www/vhosts auf Prod?

Wenn du mir die Ausgaben von lsblk -f und df -h von Prod reinkopierst, schreibe ich dir die finale Befehlsliste exakt passend (ohne „falls/variante“).

rm -rf /var/lib/psa/dumps/*
rm -rf /var/lib/psa/dumps/.[!.]* /var/lib/psa/dumps/..?* 2>/dev/null