diff --git a/Agap-Installation.md b/Agap-Installation.md index 69a7d25..aa0d725 100644 --- a/Agap-Installation.md +++ b/Agap-Installation.md @@ -2,7 +2,20 @@ Steps to set up a fresh Agap server from scratch. -## 1. Network +## 1. Storage + +Set up LVM volumes and mount points before anything else. See [[Storage]] for the full layout and LVM commands. + +Required mount points: + +| Mount | Purpose | +|-------|---------| +| `/mnt/ssd` | DB data, thumbnails, encoded video | +| `/mnt/backups` | All backups | +| `/mnt/misc` | Gitea data | +| `/mnt/media` | Immich photo originals | + +## 2. Network ### Netplan (bridge) @@ -47,14 +60,14 @@ sudo systemctl enable --now caddy - Ports **80** and **443** forwarded on the router (source and target, remote IP empty) - Port **10051** forwarded for Zabbix active agent connections -## 2. GPU & Docker +## 3. GPU & Docker ```bash sudo ./nvidia-docker-install.sh # Docker + NVIDIA Container Toolkit ./install-cuda.sh # CUDA toolkit (no driver) ``` -## 3. Zabbix Agent (host) +## 4. Zabbix Agent (host) Install agent and plugins: @@ -88,7 +101,7 @@ In Zabbix UI, link these templates to the `AgapHost` host: - **Linux by Zabbix agent active** - **Nvidia by Zabbix agent 2 active** -## 4. Custom Zabbix UserParameters +## 5. Custom Zabbix UserParameters Add backup monitoring to `/etc/zabbix/zabbix_agent2.d/gitea_backup.conf`: @@ -104,7 +117,7 @@ UserParameter=dbs.backup.age,f=/mnt/backups/dbs/.last_sync; [ -f "$f" ] && echo UserParameter=immich.backup.age,f=/mnt/backups/media/.last_sync; [ -f "$f" ] && echo $(( $(date +%s) - $(stat -c %Y "$f") )) || echo -1 ``` -## 5. Root Cron Jobs +## 6. Root Cron Jobs ```bash sudo crontab -e @@ -117,7 +130,7 @@ Add: 30 3 * * * rsync -a --delete /mnt/ssd/dbs/ /mnt/backups/dbs/ >> /mnt/backups/dbs/cron.log 2>&1 && touch /mnt/backups/dbs/.last_sync ``` -## 6. Services +## 7. Services Start all Docker services: diff --git a/Storage.md b/Storage.md index 0978c87..54ab7d0 100644 --- a/Storage.md +++ b/Storage.md @@ -2,6 +2,23 @@ Agap uses [LVM](https://wiki.archlinux.org/title/LVM). +## Layout + +| Disk | Size | VG | LV | Mount | +|------|------|----|----|-------| +| `nvme0n1` | 238GB | `ubuntu-vg` | `ubuntu-lv` | `/` (OS) | +| `sda` (SSD) | 447GB | `ssd1` | `main` | `/mnt/ssd` | +| `sdb` (HDD) | 931GB | `hdd1tb` | `backups` | `/mnt/backups` | +| `sdb` (HDD) | 931GB | `hdd1tb` | `misc` | `/mnt/misc` | +| `sdb` (HDD) | 931GB | `hdd1tb` | `media` | `/mnt/media` | + +| Mount | Contents | Size | +|-------|----------|------| +| `/mnt/ssd` | DB data, thumbnails, encoded video | 447GB | +| `/mnt/backups` | All backups (gitea, dbs, media) | 400GB LV | +| `/mnt/misc` | Gitea data | 280GB LV | +| `/mnt/media` | Immich photo originals | 251GB LV | + ## Common Commands First, create partition using `sudo fdisk /dev/sda`.