Skip to content

🛠️ Project: The Warp Core Refit v3 (Side-by-Side Migration)

Status: 🛡️ Safe Mode / Implementation
Target: ds9-truenas (TheWarpCore)
Objective: Non-destructive migration to Unified Storage (/vault).


📊 Capacity Check

  • Total Capacity: 5.3 TB
  • Current Usage: ~417 GB (plus downloads)
  • Free Space: ~4.8 TB
  • Feasibility:GO. We have ample space to duplicate all data 10x over.

🏗️ The Architecture: "The Atomic Monolith"

We create one master dataset (vault) shared by all nodes.

Hierarchy (New)

/mnt/TheWarpCore/vault              [DATASET: lz4, recordsize=1M]
├── /downloads                      [FOLDER]
│   ├── /torrents
│   │   ├── /video                  <-- starfleet-compute
│   │   └── /audio                  <-- subspace-comm
│   └── /manual
├── /media                          [FOLDER]
│   ├── /movies                     <-- Hardlinks work here
│   ├── /tv
│   └── /audiobooks
└── /app_data                       [FOLDER]

📅 Execution Plan (Safe Mode)

⚠️ WARNING: Run this on TrueNAS (192.168.1.100) as root.

Phase 1: Build & Clone (No Downtime)

We create the new structure and copy data. The old datasets (infra_storage, subspace-comm) remain Read/Write and active for existing clients.

#!/bin/bash
POOL="TheWarpCore"
ROOT="vault"

# 1. Create New Dataset
zfs create -o mountpoint=/mnt/$POOL/$ROOT -o compression=lz4 -o atime=off -o recordsize=1M $POOL/$ROOT

# 2. Create Structure
mkdir -p /mnt/$POOL/$ROOT/downloads/torrents/{video,audio}
mkdir -p /mnt/$POOL/$ROOT/media/{movies,tv,audiobooks,music}
mkdir -p /mnt/$POOL/$ROOT/app_data

# 3. Set Permissions (GID 3000)
chown -R 3000:3000 /mnt/$POOL/$ROOT
chmod -R 775 /mnt/$POOL/$ROOT
find /mnt/$POOL/$ROOT -type d -exec chmod g+s {} \;

# 4. INITIAL SYNC (Copy Only - No Delete)
# We use rsync to clone data. This takes time but is safe.
echo "Syncing Media..."
rsync -avP /mnt/$POOL/infra_storage/media/ /mnt/$POOL/$ROOT/media/

echo "Syncing Downloads..."
rsync -avP /mnt/$POOL/subspace-comm/downloads/ /mnt/$POOL/$ROOT/downloads/torrents/audio/
# Note: Adjust source path for video downloads if they live elsewhere

Phase 2: Dual-Running (Testing)

  1. Export /vault: Create a new NFS Export in TrueNAS for /mnt/TheWarpCore/vault.
  2. Test Client: Update only enterprise-dev or a test LXC to mount /mnt/vault.
  3. Verify: Check if files are visible, writable, and permissions are 3000:3000.

Phase 3: The Cut Over (Maintenance Window)

  1. Stop Apps: Stop Docker stacks on starfleet-compute and subspace-comm.
  2. Final Sync: Run the rsync commands again (they will be fast, checking only checksums/new files).
  3. Update Mounts:
    • Edit /etc/fstab on clients.
    • Change remote path from /mnt/TheWarpCore/infra_storage -> /mnt/TheWarpCore/vault.
  4. Restart Apps: Start Docker stacks.
  5. Verify: Test playback, downloads, and hardlinking.

🛑 Rollback Plan (If things break)

  1. Stop Apps.
  2. Revert Mounts: Edit /etc/fstab to point back to /mnt/TheWarpCore/infra_storage.
  3. Restart Apps.
  4. Status: Back to original state. New data in /vault can be inspected or deleted.

Phase 4: Cleanup (T+2 Weeks)

Only after 2 weeks of stable operation: 1. Delete /mnt/TheWarpCore/infra_storage. 2. Delete /mnt/TheWarpCore/subspace-comm.