I’ve written two articles previously, first was moving Gitea from FreeBSD to Linux and the second was a followup on accessing TrueNAS shares from a nested VM. The first was a few weeks ago, the second a few days. I took a long weekend and also took advantage of some Black Friday sales to upgrade the drives in my TrueNAS box, some of which were 8 years old. This should honestly be a series called “Readventure in sysadmining” as it’s turning out to be quite the adventure. Home labs for the win!

I swapped out 6 3TB drives for 6 shiny new 6TB drives thinking: hey, some of these are getting old in the tooth. They’re likely to start failing soon, and I could save myself a few dollars in the process.

Got home, swapped and resilvered each drive (5x6TB in an RAIDZ2 with one hot spare). TrueNAS makes this ridiculously easy.

And then I found out that my Ubiquiti CloudKey Gen2 was having a hard time. Some of you will know this… that little whine then click of a failing hard drive. At first I thought it was my TrueNAS Core box, and then sadly realized it was the CloudKey with it’s little 2.5” drive. So off I went to Best Buy to get an SSD to replace it.

Which didn’t work.

Turns out the CloudKey itself was pretty much dead, and nothing I did would restore it. So the SSD was returned (thank you, Best Buy) as there was no longer a need for it. Swapped it for a 1TB NVMe SSD to stick in the TrueNAS box (as all the SATA connectors were used and the motherboard allowed for four NVMe SSDs). Now two are in use: one for the boot drive, and another for all of the TrueNAS apps (containers) and VMs, on its own dedicated Stripe pool.

Moving the apps was as easy as telling it to move from one pool to another in the web UI.

Moving the VMs was a little more involved but easy enough. Each VMs dataset must be moved from one pool to another, which is easily accomplished by finding the dataset involved (i.e. Fedora-k9krs2) and moving it from one pool (storage in my case) to another, which was named apps. Within the apps dataset, another dataset named VMs was created so that all the VMs were nicely organized together. Before doing this, ensure the VM is powered off.

zfs snapshot -r storage/Fedora-k9krs2@migrate
zfs send storage/Fedora-k9krs2@migrate | zfs receive apps/VMs/Fedora-k9krs2

Now edit the virtual machine’s disk device and change the dataset it was using, in my case from storage/Fedora-k9krs2 to apps/VMs/Fedora-k9krs2. Save and start. Easy!

Once the drives were upgraded, it was time to copy all of the Plex media from the old TrueNAS Core box to the TrueNAS Scale box with the new drives. Exposing the Plex metadata and media files themselves via Samba to the virtual machine that was created for Plex using the wonderful tutorial mentioned in a previous post worked like a champ. View history and all settings retained! Some work needed to be done to ensure that there were no FreeBSD binaries still hiding in there, and finally symlinking the /var/lib/plexmediaserver/Library/Application Support/Plex Media Server directory to the Samba share, so that all the metadata is stored on external to the VM.

All of this was being done waiting for the new CloudKey Gen 2 to arrive. Because the CloudKey runs my home network and my Unifi Protect (doorbell cameras and other cameras) and my last backup was 4 years ago, I was pretty nervous. There was no way to get any data from the drive (it was more or less empty, yet through my panic trying to mount the Linux RAID (mdadm) drive, having retired my Fedora laptop last year, learning how to use USB passthrough in a TrueNAS VM was accomplished!). My operating assumption at this point, based on everything researched, was that the network would need to be reconfigured from scratch.

But lo and behold, when it arrived and was powered up, and when I logged into it using my Ubiquiti account and oh-my-gosh-my-prayers-were-heard it told me there was an online backup from two weeks ago and would I like to restore it? Heck yeah I would!

And it worked, which was amazing and literally made my day. No network/camera reconfiguration!

It may not sound like much but it was a pretty eventful few days. It’s not often that I get back to my sysadmin roots beyond typical OS updates and such, so this was fun. The next step, although I think I’ll wait a few weeks, is to see if the promise of updating TrueNAS from Core to Scale (aka FreeBSD to Linux) holds true. That feels like some kind of amazing wizardry that will be interesting to see.

Share on: TwitterLinkedIn


Related Posts


Published

Category

Linux

Tags

Stay in touch