TrueNAS Administration Guide

TrueNAS Administration Guide#

The complete UNAS-Pro backup architecture, schedules, TrueNAS node configuration, and recovery procedures are documented in Unifi UNAS-Pro Backup Strategy.


1. TrueNAS Scale: Initial Setup & Security#

Virtual Machine Configuration (Proxmox)#

  • Initial Setup: Create the VM. Add a second virtual disk (10GB) for apps and home directories.
  • Post-Login: Verify the Time Zone is accurate.
  • Duplicate Serial Error: If Proxmox reports Disks have duplicate serial numbers, add serials manually in the PVE host:
    nano /etc/pve/qemu-server/212.conf
    # Add serial strings:
    scsi0: Storage:vm-212-disk-0,discard=on,size=32G,ssd=1,serial=PROX-001
    scsi1: Storage:vm-212-disk-1,discard=on,size=1G,ssd=1,serial=PROX-002

Datasets & Users#

  1. Datasets: Create HP3-10Gb-Apps-HomeDirs. Add sub-datasets Apps (Type: Apps) and HomeDirs (Type: Generic).
  2. Standard User: Create user marc for SMB shares.
  3. Sync User: Create backupuser. Set a home directory, uncheck Samba authentication, and do not set a password.
  4. Admin Hardening: - Create user marcoue with full admin rights.
    • Upload SSH keys and enable 2FA for marcoue.
    • Disable the default truenas_admin account once verified.

SSH Hardening#

sudo nano /etc/ssh/sshd_config
# Modify/Add:
PermitRootLogin prohibit-password
PubkeyAuthentication yes

sudo systemctl restart sshd
  • Services: Go to System > Services > SSH and disable “Allow Password Authentication.”

2. System & Networking Optimization#

Startup Scripts & Cron#

  • Cron Shutdown: (System Settings > Advanced)
    • Command: /sbin/shutdown -h now
  • Init Scripts: (Post Init)
    • Command: iperf3 -s -d
  • Session Timeout: (Access > Configure) Set to 2147482.

Host Identification & Email#

  • Hostname/NetBIOS: Set to HP2TrueNAS.
  • Gmail OAuth/SMTP: - Use OAuth login if available.
    • SMTP: smtp.gmail.com | Port: 25 or 587.
    • Use an App Password from 1Password.

3. Data Protection & Replication#

Periodic Snapshots (Source)#

  • Path: Data Protection > Periodic Snapshot Tasks.
  • Settings: Uncheck “Recursive” (unless needed). Uncheck “Taking Empty Snapshot.”
  • Schedule: Daily at 08:30, retention 7 days.

Replication Task (Remote Server Pull)#

  1. Source: Different System.
  2. Connection: New SSH (Semi-Auto).
  3. Settings: Admin: marcoue, User: backupuser. Enable passwordless sudo.
  4. ZFS Commands: Check “Use Sudo for ZFS Commands.”
  5. Schedule: Every hour at 08:45.

4. Syncthing Deployment#

TrueNAS Scale Implementation#

  1. System Settings > Advanced > Sysctl:
    • Var: fs.inotify.max_user_watches | Value: 524288.
  2. Apps > Advanced: Disable “Host Path Safety Check.”
  3. App Setup: Install Enterprise Version. Use Host Path for storage (e.g., /mnt/HP1-4TBSSD-Raid0/HP1Storage).

5. Hardware-Specific Configurations#

Mac Pro Auto-Restart (After Power Outage)#

cd /sys/bus/pci/devices/0000:00:1f.0
sudo chmod -R 777 config
setpci -s 0:1f.0 0xa4.b=0

Wake-on-LAN (WOL) Persistence#

Create a systemd service to ensure WOL stays active:

UniFi UDM Device SSH Configuration

UniFi Device SSH Configuration#

This guide covers hardening and configuring SSH access for UniFi consoles (UDM-SE, UNVR, UNAS-Pro) and management of secondary devices like Switches and Access Points.


1. Console Configuration (UDM-SE, UNVR, UNAS-Pro)#

SSH Key Setup#

  1. Edit the authorized keys file to add your public keys:
nano .ssh/authorized_keys
# Restart the service
systemctl restart sshd

Install Tailscale#

For complete subnet advertising (10.1.0.0/16), exit node setup, and route approval guidelines, see the Tailscale Guide.

UPS Tools (NUT Server & Client)

UPS Tools (Network UPS Tools) Setup Guide#

This guide covers the installation of a NUT Server on a central VM (230) and the configuration of NUT Clients (Proxmox nodes) to ensure graceful shutdowns across your infrastructure.


1. NUT Server Installation (VM 230)#

1.1. Prerequisites & Software#

# Verify USB visibility (Ensure USB passthrough is configured in Proxmox)
lsusb

# Install NUT suite
apt update && apt install nut nut-client nut-server -y

1.2. Ubuntu 24.04 (NUT 2.8.1) Library Fix#

If USB scanning fails on Ubuntu 24.04, create the following symlinks:

Wake-on-LAN (WOL) Configuration & Inventory

Wake-on-LAN (WOL) Configuration & Inventory#

This guide covers how to enable, persist, and verify Wake-on-LAN (WOL) across Linux nodes and Proxmox hosts, followed by a comprehensive MAC address inventory for the local and remote clusters.


1. Verification & Manual Activation#

Check WOL Support#

Use ethtool to check if your network interface supports the “Magic Packet” (designated by the letter g).

# Replace eno5 with your actual interface name
ethtool eno5 | grep Wake-on

Output Interpretation:

Netgear Switch GS110TPv3

Netgear Switch GS110TPv3#

codex resume 019fe6f1-4f8a-7413-be32-70dd7a25a64f

How to reach the switch#

The Netgear GS110TPv3 is managed through the primary UniFi LAN.

  1. Connect the Netgear switch uplink to an available port on a UniFi network switch.

  2. Use the Netgear’s g1 port as the uplink. It carries the management LAN and tagged VLANs.

  3. In the UniFi Network application, configure the UniFi uplink port with:

    • Native Network: LAN (1)
    • Tagged VLAN Management: Allow All (or an equivalent trunk profile)
    • STP: enabled/Auto; BPDU Guard disabled
  4. From a device on the same LAN, browse to: