Initial commit: homelab configuration and documentation

This commit is contained in:
2025-11-29 19:03:14 +00:00
commit 0769ca6888
72 changed files with 7806 additions and 0 deletions

28
scripts/zfs_setup.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/bin/bash
# zfs_setup.sh - Create ZFS pool 'tank' on Proxmox host SSDs
# Adjust device names (/dev/sda /dev/sdb) as appropriate for your hardware.
set -euo pipefail
POOL_NAME="tank"
DEVICES=(/dev/sda /dev/sdb)
# Check if pool already exists
if zpool list "$POOL_NAME" >/dev/null 2>&1; then
echo "ZFS pool '$POOL_NAME' already exists. Exiting."
exit 0
fi
# Create the pool with RAID-Z (single parity) for redundancy
zpool create "$POOL_NAME" raidz "${DEVICES[0]}" "${DEVICES[1]}"
# Enable compression for better space efficiency
zfs set compression=on "$POOL_NAME"
# Create a dataset for Docker volumes
zfs create "$POOL_NAME/docker"
# Set appropriate permissions for Docker to use the dataset
chmod 777 "/$POOL_NAME/docker"
echo "ZFS pool '$POOL_NAME' created and configured."