Category: Home Lab

  • Building a 6-SSD NAS on a Mini PC (and Everything That Went Wrong)

    Building a 6-SSD NAS on a Mini PC (and Everything That Went Wrong)

    My photos lived on two aging boxes: a Synology DS412+ that’s older than some of the photos on it, and a first-generation Drobo I no longer trusted. Neither had failed yet. That “yet” was doing a lot of work.

    So I built a replacement. The goal was simple and non-negotiable: don’t lose anything. Speed, noise and price all came second. This is the build, the choices, and every place it fought back.

    The hardware

    The Beelink ME mini, a small dark-gray rounded cube with a circular speaker-style grille on top
    The whole NAS. Six drives live inside this.

    The heart of it is a Beelink ME mini, a palm-sized box with an Intel N150, 12 GB of LPDDR5, 64 GB of onboard eMMC, and, unusually, six M.2 slots.

    Into those went six 2 TB NVMe drives: four WD_BLACK SN7100s and two SN770s. Same capacity, close enough in behavior, all detected on first boot.

    BIOS information screen showing an Intel N150 and 12288 MB of memory
    The BIOS: Intel N150, 12 GB of LPDDR5.

    BIOS NVMe configuration listing four WD_BLACK SN7100 2TB and two SN770 2TB drives
    All six drives detected before anything else happens. Check this first.

    One caveat worth knowing before you buy: the slots aren’t equal. Slot 4 is PCIe x2 and the only one that also takes SATA M.2. The other five are PCIe x1, NVMe only. For a NAS that mostly talks over the network, x1 per drive is plenty. Your network is the bottleneck long before the drives are.

    Back of the ME mini: AC power, USB, two LAN ports and HDMI
    Around the back: power, USB, HDMI and two 2.5 GbE ports. The second port is what makes the direct desk cable possible later.

    Choosing the software: ZFS, because boring is good

    When data loss outranks everything, the answer is ZFS. It checksums every block, so it notices silent corruption instead of handing you a damaged photo years later, and it can repair it from redundancy.

    I went with TrueNAS Community Edition (25.10). I ruled out Btrfs RAID 5/6, which still carries warnings I’m not willing to bet photos on.

    The layout: one RAIDZ2 vdev, six drives wide. Any two drives can die and nothing is lost. That leaves about 7.1 TiB usable out of 12 TB raw. That’s a steep tax, and I’d pay it again.

    TrueNAS pool creation with layout RAIDZ2, disk size 1.82 TiB, width 6, one VDEV
    Layout RAIDZ2, width 6, one vdev.

    TrueNAS pool review: pool tank, 1 x RAIDZ2 of 6 x 1.82 TiB, estimated usable raw capacity 7.28 TiB
    The review screen before committing. (The dashboard later reports 7.13 TiB after ZFS overhead.)

    The boot-drive puzzle

    TrueNAS wants its own boot device and won’t share it with the data pool. On a box with six slots, that normally means sacrificing one slot (and the pool shrinks to five drives).

    But the ME mini has that 64 GB eMMC chip. Boot from eMMC, keep all six slots for data. That was the plan, anyway.

    TrueNAS installer Choose Destination Media screen listing mmcblk0 at 58 GB and six 1.82 TB NVMe drives
    The installer’s target list: the eMMC (mmcblk0) on top, the six data drives below. Pick only the eMMC.

    Where it fought back, round 1: the installer

    The TrueNAS installer failed on the eMMC with “Failed to find partition number 2 on mmcblk0.” It’s a known installer bug with eMMC storage, reported on this exact mini PC: the leftover factory partitions and the eMMC’s read-only boot areas trip it up.

    The fix, from the installer’s shell: turn off the read-only flag (force_ro) on the eMMC’s two boot areas, then zero out the start of the device with dd so the installer sees a blank disk instead of fighting the old partitions. The exact commands are in the guide at the bottom.

    Next try: installed, booted, web UI up.

    A small surprise afterwards: the Storage dashboard reported “2 unassigned disks.” They’re not disks. They’re the eMMC’s hardware boot partitions (mmcblk0boot0 and boot1). Ignore them, and never add them to a pool.

    TrueNAS storage dashboard: 2 unassigned disks, pool tank healthy with 7.13 TiB usable, scrub scheduled Sundays
    A healthy empty pool, and the “2 unassigned disks” that aren’t really disks.

    Round 2: the 3 TB copy

    The migration was 3.1 TB and about 246,000 files from the old Synology to the new share, over SMB, using rsync.

    The first run died overnight. The Mac went to sleep (my power settings had it napping after a minute), the SMB mount dropped, and rsync stopped. Lesson one: a long copy is only as reliable as the machine running it.

    sudo pmset -a sleep 0
    

    Then caffeinate around the job to make sure, and a modern rsync (3.x, not the ancient one macOS ships) so a restart resumes instead of starting over.

    I wrapped it in a small watchdog script that restarts rsync if it exits, and logs everything.

    Then a sneakier failure: the old Synology remounted itself under a new name (MainBackup-1 instead of MainBackup), and the copy quietly stalled. No error, no progress, just a log that stopped growing. The fix was a second little script that watches the log and sends a macOS notification when something looks wrong: a non-zero exit, no rsync running, a log gone quiet, or that rogue -1 mount.

    Three days later: ALL DONE rc=0. Every file accounted for.

    Round 3: Lightroom

    The photos are only half of it. The other half is the Lightroom catalog: years of edits, ratings and keywords that point at file paths. Move the files, and the catalog sees nothing but missing photos.

    The rule I wish someone had tattooed on me years ago: never “remove and re-import.” That throws away the edits. Instead, point Lightroom at the new location with Find Missing Folder, and it reconnects everything in place.

    After the relink, a few hundred photos were still missing. I tracked every one down with a small script that lists missing photos by folder. They turned out to be old duplicate imports and stray card folders, nothing with edits on it. Missing photos: zero.

    Before the cleanup I took a ZFS snapshot, so even the deletions were reversible. Snapshots cost almost nothing until you need them, and then they’re priceless.

    Hardening

    A NAS isn’t done when the copy finishes. Right now it has:

    • Automatic snapshots: daily (kept two weeks) and weekly (kept two months).
    • A weekly scrub, where ZFS reads every block and checks it against its checksum. The first one finished clean.
    • Auto TRIM, since the pool is all flash.
    • A direct 2.5 GbE cable from the desk Mac to the NAS, which skips the router and makes browsing the catalog feel local.

    The cable is its own tiny network with fixed addresses on both ends. On the Mac:

    sudo networksetup -setmanual "USB 10/100/1G/2.5G LAN" 10.10.10.2 255.255.255.0
    

    On the NAS, the second port gets a static address through TrueNAS’s own API:

    midclt call interface.update enp2s0 '{"ipv4_dhcp": false, "ipv6_auto": false,
      "aliases": [{"type": "INET", "address": "10.10.10.1", "netmask": 24}]}'
    midclt call interface.commit '{"checkin_timeout": 120}'
    midclt call interface.checkin
    

    That checkin_timeout is the clever part. TrueNAS applies the change and rolls it back automatically if you don’t confirm within 120 seconds. On a headless box with no keyboard attached, a typo in a network setting can’t lock you out.

    Still on the list: email alerts, a backup of the TrueNAS config kept somewhere other than the NAS itself, and setting the BIOS to power back on after an outage.

    What I’d do differently

    • Disable sleep before starting any long copy, not after the first one dies.
    • Mount network shares by IP, not by name. Name lookups on a home network are flakier than they look.
    • Monitor, don’t babysit. The notification script should have existed on day one.
    • Snapshot before every risky step. It took five seconds each time and turned scary cleanups into undoable ones.

    Next

    With the photos safe, the fun part started: running Immich on the NAS for face recognition and search across the whole library. That’s the next post.


    Appendix: the step-by-step guide

    The same build, as a checklist you can follow. Each step says where to run it, what to run, why, and what to do if it fails. Replace anything in <angle brackets> with your own values.

    Before you start: steps 3 and 4 erase disks. Back up anything on the drives you’re about to use, and double-check device names before running dd.

    1. Make the installer USB

    • Where: your computer.
    • Run: download the TrueNAS Community Edition ISO from truenas.com, then write it to a USB stick with Raspberry Pi Imager (“Use custom”) or balenaEtcher.
    • Why: the NAS boots the installer from USB.
    • If it fails: if the NAS won’t boot from the stick, rewrite it with the other tool, and try a USB 2.0 port (some mini PCs are pickier about USB 3 at boot).

    2. BIOS settings

    • Where: the NAS, with a monitor and keyboard attached (press Del or F7 during power-on on most Beelinks).
    • Run: disable Secure Boot; put the USB stick first in the boot order. Check that all six NVMe drives are listed.

    BIOS security tab with Secure Boot disabled
    Secure Boot: Disabled.

    • Why: the installer won’t start with Secure Boot on, and a missing drive is much easier to fix now than after the pool exists.
    • If it fails: a drive not listed is usually not fully seated. Power off, unplug, reseat it.

    3. Install TrueNAS to the eMMC

    • Where: the TrueNAS installer menu.
    • Run: choose Install/Upgrade and pick the eMMC (mmcblk0, about 64 GB) as the boot device, not one of the NVMe drives.
    • Why: this keeps all six NVMe slots free for data.
    • If it fails with “Failed to find partition number 2 on mmcblk0”: pick Shell from the installer menu, then:
    lsblk                                     # confirm mmcblk0 is the eMMC (~58 GB)
    echo 0 > /sys/block/mmcblk0boot0/force_ro
    echo 0 > /sys/block/mmcblk0boot1/force_ro
    dd if=/dev/zero of=/dev/mmcblk0 count=1024  # ERASES the eMMC's partition table
    sync
    exit
    

    force_ro is a read-only switch on the eMMC’s boot areas; dd blanks the first 512 KB, which holds the old partition table, so the installer starts clean. Back at the menu, choose Install/Upgrade again and select only mmcblk0. If the force_ro lines print an error, carry on; the dd line is the one that matters. Triple-check the device name: dd to an NVMe drive by mistake would wipe it instead.

    4. Create the pool

    • Where: TrueNAS web UI → Storage → Create Pool.
    • Run: add all six NVMe drives as one RAIDZ2 vdev.
    • Why: RAIDZ2 survives any two drives failing at once.
    • If it fails: you’ll see “2 unassigned disks” afterwards. Those are the eMMC’s boot areas (mmcblk0boot0/1). Ignore them; never add them to a pool.

    5. Share it

    • Where: web UI.
    • Run: create a dataset (e.g. photos), a regular (non-admin) user for file access, and an SMB share on the dataset. In your router, give the NAS a fixed IP (DHCP reservation).
    • Why: a non-admin user limits damage if a computer is compromised; a fixed IP makes mounting reliable.

    TrueNAS datasets page showing pool tank with a dataset shared via SMB
    A dataset on the pool, shared over SMB.

    • If it fails: if your computer can’t see the share by name, use the IP. Name lookups on home networks are flaky.

    6. Mount the share and stop sleep

    • Where: Mac → Finder → Go → Connect to Server (Cmd-K), then Terminal.
    • Run:
    smb://<nas-ip>/<share>          # in Connect to Server
    sudo pmset -a sleep 0           # in Terminal: never sleep
    pmset -g | grep " sleep"        # check: should show 0
    
    • Why: a sleeping Mac drops the network share and kills the copy.
    • If it fails: if a second copy of the share appears as <share>-1 in /Volumes, eject both and mount again. Never copy to the -1 one. Restore sleep afterwards with sudo pmset -a sleep 10 (or whatever you had).

    7. Install a modern rsync

    • Where: Mac Terminal (needs Homebrew).
    • Run:
    brew install rsync
    /opt/homebrew/bin/rsync --version     # should say 3.x
    
    • Why: macOS ships an old rsync. A current one shows overall progress and resumes cleanly.
    • If it fails: on an Intel Mac the path is /usr/local/bin/rsync.

    8. Copy, with automatic retries

    • Where: Mac Terminal. Save this as copy.sh:
    #!/bin/bash
    SRC="/Volumes/<old-share>/Photos/"   # trailing slash: copy the contents
    DST="/Volumes/<new-share>/photos/"
    LOG="$HOME/copy.log"
    while true; do
      /opt/homebrew/bin/rsync -a --partial --info=progress2 \
        --exclude='.DS_Store' --exclude='._*' \
        "$SRC" "$DST" >> "$LOG" 2>&1
      RC=$?
      if [ $RC -eq 0 ]; then echo "ALL DONE rc=0 $(date)" >> "$LOG"; break; fi
      echo "rsync exited rc=$RC $(date), retrying in 30s" >> "$LOG"
      sleep 30
    done
    

    Then run it: caffeinate -i nohup bash copy.sh & and watch it with tail -f ~/copy.log.
    – Why: -a keeps dates and permissions; --partial keeps half-copied big files so a retry continues them; the loop restarts after any hiccup; caffeinate keeps the Mac awake while it runs.
    – If it fails: the loop retries by itself. The exit code in the log tells you why:
    – rc=23: some files couldn’t be copied (often broken links or permission errors). Search the log for rsync: lines; fix or exclude those paths.
    – rc=12, rc=30 or rc=255: the connection dropped. Remount the share; the loop picks up where it left off.
    – The log stops growing but nothing errors: a share probably remounted under a new name (-1). Check ls /Volumes.

    9. Verify the copy

    • Where: Mac Terminal.
    • Run:
    /opt/homebrew/bin/rsync -a --dry-run --itemize-changes \
      --exclude='.DS_Store' --exclude='._*' "<SRC>" "<DST>"
    
    • Why: a dry run lists anything still different. No output means the copy is complete. Add --checksum for a slow, byte-by-byte check.
    • If it fails: files listed = copy again (rerun step 8).

    10. Relink Lightroom

    • Where: Lightroom Classic → Library → Folders panel.
    • Run: right-click the top folder showing a ? → Find Missing Folder… → choose the same folder on the NAS. Then Library → Find All Missing Photos to see what’s left.
    • Why: this reconnects the catalog (edits, ratings, keywords) to the new location.
    • If it fails: never remove and re-import; that throws away edits. Relink each remaining missing folder the same way.

    11. Turn on the safety nets

    • Where: web UI.
    • Run:
    • Data Protection → Periodic Snapshot Tasks: daily (keep 2 weeks) and weekly (keep 2 months), recursive.
    • Storage → (your pool): turn on Auto TRIM (all-SSD pool) and check the weekly scrub schedule.
    • Before any risky cleanup, take a manual snapshot: Datasets → (dataset) → Create Snapshot.
    • Why: snapshots undo mistakes (including deletions); scrubs catch silent corruption early.
    • If it fails: if a scrub reports errors, check the drive’s health under Storage → Disks before anything else.

    12. Optional: a direct cable to your desk

    • Where: Mac Terminal, then the NAS shell (System → Shell in the web UI).
    • Run: the networksetup and midclt commands from the Hardening section above, with your own interface names. Check which link you’re on with route -n get 10.10.10.1.
    • Why: a point-to-point link skips the router, so it’s faster and quieter.
    • If it fails: if you don’t run interface.checkin within 120 seconds, TrueNAS rolls the change back on its own. Fix the typo and try again.
    • Label the two ports and their cables. They look identical but now do different jobs. Swap them and the NAS boots fine but your router can’t see it (see step 13).

    13. After a power cut or unplugging

    • Where: the NAS, then the web UI shell.
    • Run: press the power button (it stays off after power loss unless the BIOS option Restore on AC Power Loss is set to Power On, which is worth doing in step 2). Wait two minutes. If the apps (Immich etc.) don’t come back, check:
    midclt call docker.status
    ip route | grep default
    
    • Why: the apps service needs a working default route when it starts.
    • If it fails:
    • Network lights on but the NAS is unreachable: link lights glow even on a powered-off or half-configured machine. If you use the direct cable, check the cables aren’t swapped between the two ports.
    • docker.status says “Unable to determine default interface”: the NAS booted without a network (e.g. swapped cables). Fix the cabling, confirm ip route shows a default via … line, then restart the NAS. The apps don’t retry on their own.