Migrating Plex, new NAS build
My old media server was dying slowly. Not dramatically. No smoke, no clicking. Just a ZFS pool that kept going degraded, and me clearing the errors. Then clearing them again. I lost count somewhere around a dozen.
When you’ve written a cron job whose only purpose is to tell you your pool is still sick, it’s time to move.
Luckily for me, I have some very generous friends. I’m still good friends with my boss from my MSP. He happened to be retiring the old backup target for Veeam, and he gave it to be gratis. 24x 4TB drives in 3 enclosures, ~100TB raw storage. I could not be more grateful. I also put out the call to my “PlexPals” on a discord server, and they came through with supremely generous donations.
Seriously, thank you all.
This is the story of building the replacement, which I named NAStalgia, and moving everything onto it. It took most of August and September. Not everything went to plan.
The old box
The old server ran TrueNAS with a single pool: six 8 TB drives in RAIDZ2. RAIDZ2 can lose two drives and keep going, which is exactly why I’d been able to ignore the problem for as long as I did. It was running degraded, errors kept coming back, and the pool held around 22 TB of media, the Plex library that the whole house uses, as well as my friends.
The plan was simple on paper: build a bigger, more redundant server, copy everything over, switch Plex across, and put the old box out to pasture.
The hardware: a pack-rat special
I have a problem, ain’t looking for a fix.
You know how every man has that one peice of wood that they keep around just in case? They know it will be useful sometime down the line, they just don’t know what for. That’s me, except with random tech stuff.
So naturally, I didn’t buy a server. I assembled one out of things I already had, plus a few things I didn’t.
- Motherboard and CPU: a spare desktop board (Z390) and an Intel “F” series CPU. The F means no integrated graphics. That will come up later.
- RAM: 48 GB. Well below the usual ZFS rule of thumb for this much storage (128 would be ideal). I accepted that. I don’t know if you’ve seen RAM prices in 2026, but dang. We make do.
- Drive enclosures: three external 8-bay enclosures, connected over SAS (SFF-8644 cables).
- HBAs: three SAS host bus adapters, one per enclosure. That filled all three of the board’s full-length PCIe slots. This will also come up later.
- Drives: 24 used 4 TB drives, mostly WD Reds with a couple of oddballs, plus four more as cold spares on a shelf.
First boot: nothing. A VGA warning light on the board and no POST.
No integrated graphics (Intel “F” series), and every slot taken by an HBA, means no video output. The board refused to boot without something to display on. I borrowed a graphics card, pulled one HBA, got through setup, put the HBA back, and it has run headless ever since. It only needed a GPU to get started. After a tweak in the BIOS, it doesn’t need one to boot.
Three enclosures, 24 spinning drives, and a desktop power supply in one corner of the room. Surprised I didn’t blow a fuse, honestly.
Mapping the hardware before trusting it
Old drives have old data on them. Twenty-two of the 24 still had ZFS labels from a pool called tank in a previous life. Those got wiped first, so the new install wouldn’t get confused about what belonged where.
Then, I needed to know the physical layout, because it matters for the pool design. Each 8-bay enclosure is split internally into two banks of four drives, each on its own SAS lane. I didn’t trust the manual (scrounged from the deep corners of the internet) on which bays were which bank, so I tested it: unplug one SAS cable from an enclosure, list drives by serial number, see which four vanished. Plug it back, repeat. Top four bays are one bank, bottom four are the other.
I also built a table of every drive: serial number, enclosure, bay. The enclosures’ fault LEDs don’t work for some reason, so when a drive fails, the only way to find it is by serial number. That table has already earned its keep, more than once.
Designing the pool around the failure modes
This is the part I spent the most time on.
The new pool is four RAIDZ2 vdevs, six drives each. Each vdev can lose any two drives. The trick is which six drives go in each vdev.
Six enclosure banks, six drives per vdev. So each vdev gets exactly one drive from each bank.
Walk through the failures:
- One drive dies: every vdev is fine. Normal.
- A whole bank drops (bad cable, bad lane): every vdev loses exactly one drive. Everything stays online.
- A whole enclosure dies (power supply, HBA): that’s two banks, so every vdev loses two drives. Still online. Badly degraded, but no data loss.
If I were to lay the vdevs out the lazy way, one enclosure per vdev, then a single enclosure failure loses a whole vdev, which loses the whole pool. Same capacity, but a terrible, awful, no-good, very bad day for me.
Drives were added by their /dev/disk/by-id paths, so ZFS doesn’t care what order the cables are plugged in.
The rest of the box: a mirrored pair of SSDs for VMs, a mirrored pair of small NVMe drives for Plex’s application data, and a mirrored SSD boot pool. I went with the “Mission Critical” TrueNAS release instead of the shiny beta. A storage server is not where I want to find new bugs. This is meant to be boring.
Copying 22 TB: the broken pipe
Or: how I learned to start worrying and not trust the Claude.
ZFS makes moving a pool easy in theory. Take a snapshot, then stream it:
ssh root@old-nas "zfs send -R tank/storage@migration" | pv | zfs receive -v media-pool/storage
zfs send -R sends the dataset and everything under it, snapshots included. pv shows progress. zfs receive writes it into the new pool.
Twenty-two terabytes over a gigabit network is a couple of days of copying. It ran for about 54 hours. It reached 92%. Home stretch baby! It’s almost like I know what I’m doing!
Then: broken pipe.
The SSH connection had dropped. Normally that’s not fatal, because zfs receive can save a resume token and pick up where it left off. But only if you tell it to, with -s.
I had not done so.
Claude had given me that zfs send command, and the omission was Claude’s, but I ran it without checking, so it’s mine too. An important lesson that I have not forgotten. (Also, don’t try doing this at 2am next time, maybe.)
No resume token meant starting over from zero. Fifty-four hours, gone. Sub optimal. I was less than pleased.
The second attempt:
ssh -o ServerAliveInterval=30 -o ServerAliveCountMax=6 root@old-nas \
"zfs send -R tank/storage@migration" | pv | zfs receive -s -v media-pool/storage
Two changes:
- The SSH keepalive options make a quiet connection less likely to get dropped.
-smeans if it does drop, I can resume instead of restarting. It finished without incident, which is the only kind of finish in which I’m interested.
Lesson: for any long zfs send, -s on the receive side is not optional. It costs nothing and might save your drywall.
Moving Plex’s brain… soul?
Moving the media was the easy part. Moving Plex’s own data (the database, settings, authentication, watch history, metadata, artwork) was where things got interesting.
The original plan was to keep Plex’s data on an NFS share as before. I changed my mind for a couple reasons.
- Plex’s database is R/W intensive. It’s the most impactful factor as far as the UX goes. If the appdata is slow, then when you sit in from of your TV to watch a movie, everything crawls, things take a long time to load, artwork struggles, just generally bad.
- It really doesn’t like network hiccups, and I’d been having plenty of those (more below).
Instead, I created a dedicated volume on the NVMe pool and attached it directly to the Plex VM as a second disk. No network prereq, and storage as fast as I could make it. (My users have reported an increase in performance!)
Then the fun started. (Read: uncomfortable song-and-dance)
- A typo in a symlink. I moved the data, pointed Plex at the new location with a symlink, and got the path slightly wrong. Plex didn’t find its data, so it helpfully created a fresh, empty setup. When I opened it, the server looked unclaimed. No library, no users, nothing.
- Was the real data gone? Checking timestamps on the directories showed the original database was intact. Plex had been looking in the wrong place and wrote data there.
- Rather than gamble, I pulled a known-good copy from the old Plex VM, which had been shut down cleanly before the move. To do that I had to boot it, so I changed its IP address first to avoid a conflict with the new one.
- The old VM’s IP changed back once it came up. Two machines, same address. Half the network fell over. That took a while to figure out.
- Not my first rodeo. It’s actually my second rodeo. I’ve migrated Plex before and always this is the issue. So, instead of copying directly to the new VM, I copied the known-good data to a share, then shut down the old VM, so I could play with the data without worry.
- File ownership. The copy came over owned by my user instead of the
plexuser. Plex couldn’t read its own database. Onechown -R plex:plexlater, it could.
After that, Plex came up with every library, every user, and every half-watched episode where it should be.
The network gremlins
Through all of this, the new server kept dropping off the network. Not occasionally. Regularly. The only fix was to physically unplug the Ethernet cable and plug it back in.
It turned out to be several unrelated problems stacked on top of each other, which is just my luck.
The onboard Intel NIC has a known Linux driver bug. The
e1000edriver throws “Detected Hardware Unit Hang” and the link stays down until something physically resets it. The fix is to turn off some network offload features:ethtool -K eno1 tso off gso off gro off ethtool --set-eee eno1 eee offOn TrueNAS, you can’t just drop a systemd unit in
/etc, because a system update can wipe it. These went into TrueNAS’s own init scripts so they survive updates and reboots. That tested working; Haven’t had any issues since.The physical interface had picked up its own IP address on top of being part of a bridge. Two interfaces on one NIC, same subnet. That caused intermittent outages, my monitoring flapping between “Everything’s down!!!” and “Everything’s fine!!!,” and Tailscale disconnecting without recovering.
VMs couldn’t talk to the host. That’s how MACVLAN networking is designed, but it’s not what I wanted. Switched to a proper Linux bridge.
A stale NFS mount on another VM kept trying to reach a share that had moved.
There was also a red herring: one device was negotiating at 100 Mbps instead of gigabit, which looked like it might be related, but wasn’t.
At one point I locked myself out completely while trying to reset the network config. With no graphics card, there’s no screen. I recovered it by logging in blind on a keyboard and typing the commands to rebuild the bridge from memory, then checking from another machine to see if it worked.
It did work, but I do not recommend it.
Into the closet
Once things were stable, the server moved to its permanent home in a closet. Every cable was labeled before it was unplugged. The cold spares came along and stayed within arm’s reach. These drives have to be at least a decade old, no for sure they were ripe for failure.
The first scrub after the move found three drives faulted at once. Old drives don’t love being moved, and frankly the pool wasn’t healthy when it was in production before I took possession.
Because of the pool layout, none of it was dangerous. The failures were spread across different vdevs, and no vdev lost more than it could handle. I swapped in spares one at a time, using the serial number table to find each bad drive, and let the resilvers run.
During the chaos, ZFS also reported a “permanent error” in pool metadata. That message sounded terrifying, and the official advice is to restore from backup. That would, uh… suck wind.
Don’t panic.
Before doing anything drastic, I cleared the errors and ran another scrub once the resilvers were done. The scrub came back clean and the error was gone. It was fallout from three simultaneous failures. No real damage. Sanity only slightly compromised.
Since then, a few more of the original drives have failed and been replaced. That was always the deal with a batch of used drives. Which means the real lesson here is boring: keep more spares than you think you need, and reorder before you’re down to the last one.
I’m down to the last one.
Who will watch the watchman?
After all the network drama, I set up monitoring with Uptime Kuma. But, of course, it was running in a docker container in a VM on the server it was monitoring. If the server’s down, it can’t tell me.
So there’s a second instance on a Raspberry Pi that watches the first. Simple and cheap, just like me.
What I’d do again, and what I wouldn’t
Again:
- Design the pool around how the hardware actually fails, not just around capacity.
- Test the physical layout instead of trusting documentation.
- Keep a table of serial numbers and bay locations.
- Keep cold spares on hand, and more of them.
- Choose stable over shiny for anything that holds data.
- Have a second monitor that doesn’t share a failure with the first.
Not again:
- Run a multi-day
zfs sendwithout-s. - Change a VM’s IP while it’s off and assume it’ll stick.
- Trust a command, from a person or an AI, without reading it first.
Nastalgia has been running ever since. The old server is out to pasture. I’ll get around to wiping its drives eventually. As a matter of fact, one good turn deserves another. Time to re-purpose some old hardware as a backup box!
For how I kept the documentation in step with all of this, see Using Claude to Document My Homelab.