<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>truenas on Samirtech</title>
    <link>https://samirtech.org/tags/truenas/</link>
    <description>Recent content in truenas on Samirtech</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Sat, 12 Sep 2026 12:10:00 +0100</lastBuildDate><atom:link href="https://samirtech.org/tags/truenas/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Building a 3-2-1 Backup System for My Homelab</title>
      <link>https://samirtech.org/posts/building-a-3-2-1-backup-system-for-my-homelab/</link>
      <pubDate>Sat, 12 Sep 2026 12:10:00 +0100</pubDate>
      
      <guid>https://samirtech.org/posts/building-a-3-2-1-backup-system-for-my-homelab/</guid>
      <description>After recovering my photos, I needed a backup design that did not depend on luck. The familiar 3-2-1 rule gives me a useful structure:
3 copies of important data; 2 different storage types or locations; 1 copy off-site. It is not a magic formula, but it forces me to think about failure scenarios instead of trusting one NAS.
My current layout Normandy is my active TrueNAS server and runs the live Immich library.</description>
      <content>&lt;p&gt;After recovering my photos, I needed a backup design that did not depend on luck. The familiar 3-2-1 rule gives me a useful structure:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;3 copies of important data;&lt;/li&gt;
&lt;li&gt;2 different storage types or locations;&lt;/li&gt;
&lt;li&gt;1 copy off-site.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It is not a magic formula, but it forces me to think about failure scenarios instead of trusting one NAS.&lt;/p&gt;
&lt;h2 id=&#34;my-current-layout&#34;&gt;My current layout&lt;/h2&gt;
&lt;p&gt;Normandy is my active TrueNAS server and runs the live Immich library. Its data is stored under the &lt;code&gt;Shepard&lt;/code&gt; dataset, including the Immich data and PostgreSQL data.&lt;/p&gt;
&lt;p&gt;Voyager is the second TrueNAS machine. It normally stays powered off or suspended, and receives local ZFS replication. That protects against some failures, but it is not enough on its own: a mistake, fire, theft or an encryption-key problem could affect both the data and the ability to recover it.&lt;/p&gt;
&lt;p&gt;I also have removable storage used for protected keys and configuration archives. The long-term off-site plan is an encrypted copy at Backblaze B2 and an incremental copy to a Raspberry Pi 4 with attached storage at my parents&amp;rsquo; home.&lt;/p&gt;
&lt;h2 id=&#34;the-three-copies&#34;&gt;The three copies&lt;/h2&gt;
&lt;p&gt;The first copy is the live data on Normandy. The second is Voyager, which is a separate NAS and receives replicated data. The third will be off-site, using encrypted cloud storage and/or the Pi 4 copy.&lt;/p&gt;
&lt;p&gt;The off-site copy matters because the two NAS machines are still in the same home. It protects against events that local replication cannot.&lt;/p&gt;
&lt;h2 id=&#34;different-storage-and-failure-modes&#34;&gt;Different storage and failure modes&lt;/h2&gt;
&lt;p&gt;Two TrueNAS systems provide useful redundancy, but they are still similar systems managed by the same person. That is why the design also includes cloud storage and removable/off-site media.&lt;/p&gt;
&lt;p&gt;The copies should not all be online and writable at the same time. Voyager is normally off, and offline key storage gives me a recovery route if the online systems are compromised or accidentally changed.&lt;/p&gt;
&lt;h2 id=&#34;keys-are-part-of-the-backup&#34;&gt;Keys are part of the backup&lt;/h2&gt;
&lt;p&gt;The recovery taught me that TrueNAS encryption keys and Duplicati/B2 passphrases must be backed up separately from the data. I have placed protected copies in a password manager and created encrypted archives on two USB drives.&lt;/p&gt;
&lt;p&gt;The USB drives are not the main backup. They hold the information required to unlock and rebuild the real backups.&lt;/p&gt;
&lt;h2 id=&#34;the-plan&#34;&gt;The plan&lt;/h2&gt;
&lt;p&gt;My practical plan is:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Keep Normandy as the live service.&lt;/li&gt;
&lt;li&gt;Replicate important datasets to Voyager on a schedule.&lt;/li&gt;
&lt;li&gt;Keep Voyager powered off or suspended when it is not being used.&lt;/li&gt;
&lt;li&gt;Back up Immich media, database dumps and configuration data to encrypted off-site storage.&lt;/li&gt;
&lt;li&gt;Build the Pi 4 off-site copy and make it incremental over Wi-Fi.&lt;/li&gt;
&lt;li&gt;Test restores and record the procedure.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The most important change is that every layer has a documented purpose. If one copy fails, I should know which copy to use next and what keys or software are required.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>How I Got My Old Photos Back After Wiping My NAS</title>
      <link>https://samirtech.org/posts/how-i-got-my-old-photos-back/</link>
      <pubDate>Thu, 10 Sep 2026 09:00:00 +0100</pubDate>
      
      <guid>https://samirtech.org/posts/how-i-got-my-old-photos-back/</guid>
      <description>There are some files you can download again. Family photos are not among them.
I recently learned that lesson in the most uncomfortable way possible. While moving to a new home, I reset my main TrueNAS server without properly reading what the reset operation would do. The result was that I wiped the system and thought I had lost years of photos and home videos.
This included the ordinary moments that become important only after time has passed—old computers, holidays, family pictures and photos of my son.</description>
      <content>&lt;p&gt;There are some files you can download again. Family photos are not among them.&lt;/p&gt;
&lt;p&gt;I recently learned that lesson in the most uncomfortable way possible. While moving to a new home, I reset my main TrueNAS server without properly reading what the reset operation would do. The result was that I wiped the system and thought I had lost years of photos and home videos.&lt;/p&gt;
&lt;p&gt;This included the ordinary moments that become important only after time has passed—old computers, holidays, family pictures and photos of my son. Some of the recovered photos went all the way back to 2009.&lt;/p&gt;
&lt;p&gt;I did eventually get them back, but not because I had a perfect backup system. I got them back because fragments of several old systems still existed and, after a lot of investigation, I managed to piece them together.&lt;/p&gt;
&lt;p&gt;This is what happened.&lt;/p&gt;
&lt;h2 id=&#34;the-mistake&#34;&gt;The mistake&lt;/h2&gt;
&lt;p&gt;My main storage server ran TrueNAS and hosted Immich, my self-hosted photo library. During our move to a new home, I was getting the homelab set up again and used the TrueNAS reset option. I did not stop and read carefully enough to understand exactly what would be reset or what the consequences would be.&lt;/p&gt;
&lt;p&gt;That mistake wiped the system I was relying on for my photo library. It was not a disk failure, ransomware attack or obscure software bug. It was a destructive action carried out by me during an already busy period, because I assumed I understood the option instead of verifying it first.&lt;/p&gt;
&lt;p&gt;Moving home meant equipment had been powered down, disconnected and relocated, and I was trying to bring several parts of the network and homelab back online. That context does not change the result, but it explains how easily a familiar-looking reset option turned into a serious data-loss incident.&lt;/p&gt;
&lt;p&gt;The full impact was not immediately obvious. The server could be rebuilt, containers could be redeployed and applications could be downloaded again. The irreplaceable part was the data: the original photos and videos behind Immich.&lt;/p&gt;
&lt;p&gt;I had backups—or at least I believed I did.&lt;/p&gt;
&lt;p&gt;That distinction became important very quickly.&lt;/p&gt;
&lt;h2 id=&#34;a-backup-existing-does-not-mean-it-can-be-restored&#34;&gt;A backup existing does not mean it can be restored&lt;/h2&gt;
&lt;p&gt;I had previously replicated data to a second TrueNAS machine. That sounded reassuring until I discovered that some of the replicated datasets were encrypted and I no longer had the required encryption key.&lt;/p&gt;
&lt;p&gt;The data was physically present, but parts of it were effectively locked away.&lt;/p&gt;
&lt;p&gt;I also had cloud backups in Backblaze B2, created using Duplicati. I no longer had the original Duplicati installation, but fortunately I had kept its passphrase. That gave me another possible route back to the files.&lt;/p&gt;
&lt;p&gt;At this point my recovery options looked something like this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;a second NAS containing replicas, some of which I could not unlock;&lt;/li&gt;
&lt;li&gt;Backblaze B2 data created by an application I no longer had running;&lt;/li&gt;
&lt;li&gt;more than one old Immich backup location;&lt;/li&gt;
&lt;li&gt;possible copies on older computers and external drives;&lt;/li&gt;
&lt;li&gt;a current Immich server that was already receiving new uploads.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It was not a clean backup. It was an archaeological dig.&lt;/p&gt;
&lt;h2 id=&#34;recovering-the-old-immich-system&#34;&gt;Recovering the old Immich system&lt;/h2&gt;
&lt;p&gt;I restored the older Immich installation on the second TrueNAS server and began checking what was actually there.&lt;/p&gt;
&lt;p&gt;That first successful login was a major relief. My wife&amp;rsquo;s photos appeared, and the oldest items in the library went back to 2009. Seeing the thumbnails was encouraging, but I did not yet treat that as proof of a successful recovery.&lt;/p&gt;
&lt;p&gt;An Immich library is more than a folder of images. It also has a PostgreSQL database containing users, albums, metadata and the relationships between assets. A working web interface can still hide missing originals, broken thumbnails or an incomplete database.&lt;/p&gt;
&lt;p&gt;Before doing more, I created a fresh database dump and ran checks against the restored database. The database appeared healthy, which meant the old instance could become a source for a safer migration.&lt;/p&gt;
&lt;h2 id=&#34;decrypting-and-pulling-the-files-back-from-backblaze&#34;&gt;Decrypting and pulling the files back from Backblaze&lt;/h2&gt;
&lt;p&gt;The Backblaze copy was not a normal folder that could simply be opened and copied. The files had been uploaded through Duplicati and were stored using its encrypted backup format.&lt;/p&gt;
&lt;p&gt;That meant the Backblaze bucket contained backup data, not immediately usable JPGs, MP4s and other originals. The encryption passphrase was therefore just as important as the B2 account details. Without it, I might have been looking at a complete cloud backup that I still could not restore.&lt;/p&gt;
&lt;p&gt;The recovery process was:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Reconnect the backup software to the correct Backblaze B2 account, bucket and backup location.&lt;/li&gt;
&lt;li&gt;Add the original encryption setting and passphrase from the old backup configuration.&lt;/li&gt;
&lt;li&gt;Run a restore rather than copying the encrypted backup objects directly.&lt;/li&gt;
&lt;li&gt;Select the required photo and Immich backup folders.&lt;/li&gt;
&lt;li&gt;Restore them to a separate recovery location on TrueNAS.&lt;/li&gt;
&lt;li&gt;Confirm that the output consisted of normal files that could be opened independently of the backup software.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The backup application handled decryption during the restore. The files written to the recovery dataset were usable originals; they did not require Duplicati or Backblaze every time I wanted to view a photograph.&lt;/p&gt;
&lt;p&gt;I kept the recovered files separate from the live Immich library at first. That gave me a safe working copy and meant I could compare, inspect and retry the restore without damaging the source or the active server.&lt;/p&gt;
&lt;p&gt;The cloud restore took patience. Backblaze download limits were reached more than once, so the recovery could not be completed in one uninterrupted run.&lt;/p&gt;
&lt;p&gt;I used &lt;code&gt;rsync&lt;/code&gt; for the subsequent file copies because interrupted transfers could be resumed without starting everything again. That mattered: some runs stopped in the 80–90 percent range, and the photo directories contained tens of thousands of files spread across many subdirectories.&lt;/p&gt;
&lt;p&gt;I also found two different backup roots in B2. That was useful because one could contain files missing from the other, but it made the recovery harder to reason about. I had to compare, resume and verify rather than blindly copying one folder and assuming it was complete.&lt;/p&gt;
&lt;p&gt;This stage taught me an important difference:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Copying files is an activity. Verifying that the correct files arrived is the recovery.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&#34;migrating-into-the-active-immich-server&#34;&gt;Migrating into the active Immich server&lt;/h2&gt;
&lt;p&gt;While I was recovering the old server, my active Immich instance was still receiving new phone uploads. I did not want to replace its database with an old one and risk losing everything added since the failure.&lt;/p&gt;
&lt;p&gt;Instead, I kept the restored Immich instance as the source and migrated its contents into the active instance using &lt;code&gt;immich-go&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The migration was not perfectly clean. Early attempts failed because the correct API access had not been configured. Later runs reported missing originals, server errors and thumbnail-related failures. The larger migration also produced many duplicates—which, in this case, was better than silently losing files.&lt;/p&gt;
&lt;p&gt;I reran the migration and reduced the remaining errors. By the final retries, my own library was down to a single failed upload caused by an empty file, while my wife&amp;rsquo;s migration had a much smaller number of remaining download errors to investigate.&lt;/p&gt;
&lt;p&gt;Most importantly, the old photographs began appearing in the current Immich mobile app. My wife&amp;rsquo;s library returned, then mine. Some thumbnails still needed to be regenerated, but opening the affected assets showed that many of the originals were present.&lt;/p&gt;
&lt;p&gt;That was the moment I could finally say: I have my photos back.&lt;/p&gt;
&lt;h2 id=&#34;verifying-that-the-recovery-was-real&#34;&gt;Verifying that the recovery was real&lt;/h2&gt;
&lt;p&gt;I did not rely only on Immich showing a thumbnail. Some thumbnails initially reported errors even though the original opened when selected. That is why I checked the restored files directly and compared selected files with SHA-256 hashes between the recovered Immich data and a separate restore-test copy.&lt;/p&gt;
&lt;p&gt;The verification included opening photographs and videos from different years, checking older material rather than only recent uploads, confirming that originals opened outside Immich, checking that the database was healthy, and making sure the active Immich server could display the migrated assets on the phone.&lt;/p&gt;
&lt;p&gt;This was also how I found that some items from before 2024 had not initially migrated. Seeing a library in the application was not enough; I had to check the timeline and retry the missing material.&lt;/p&gt;
&lt;h2 id=&#34;what-saved-the-photos&#34;&gt;What saved the photos&lt;/h2&gt;
&lt;p&gt;No single part of my setup saved me. Recovery was possible because several imperfect layers overlapped:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the second NAS still held a usable copy of the old Immich installation;&lt;/li&gt;
&lt;li&gt;I had retained the Duplicati encryption passphrase;&lt;/li&gt;
&lt;li&gt;Backblaze B2 contained files that could be restored;&lt;/li&gt;
&lt;li&gt;database backups preserved the structure of the Immich library;&lt;/li&gt;
&lt;li&gt;resumable tools let me continue large transfers after interruptions;&lt;/li&gt;
&lt;li&gt;I did not immediately delete the old sources after the first apparent success.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Any one of those could have been the difference between recovery and permanent loss.&lt;/p&gt;
&lt;h2 id=&#34;what-made-it-harder-than-it-needed-to-be&#34;&gt;What made it harder than it needed to be&lt;/h2&gt;
&lt;p&gt;I also made nearly every classic backup mistake:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I had encrypted replicas without being certain the recovery key was safely stored;&lt;/li&gt;
&lt;li&gt;I had not regularly tested a full restore;&lt;/li&gt;
&lt;li&gt;the backups were spread across different systems and folder structures;&lt;/li&gt;
&lt;li&gt;I was unsure which copy was the newest or most complete;&lt;/li&gt;
&lt;li&gt;the application, database and original media needed to be considered separately;&lt;/li&gt;
&lt;li&gt;my second NAS was usually powered off, so it was not a simple always-current replica;&lt;/li&gt;
&lt;li&gt;cloud download limits slowed recovery at exactly the time I most wanted it to be fast.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The problem was not that I had no backups. The problem was that I did not have a documented, tested recovery path.&lt;/p&gt;
&lt;h2 id=&#34;where-things-stand-now&#34;&gt;Where things stand now&lt;/h2&gt;
&lt;p&gt;The recovered photos have been migrated into the active Immich server. I have fresh database dumps, and I am keeping the restored server and old backup sets untouched until I have finished verification.&lt;/p&gt;
&lt;p&gt;There is also a separate collection of older family photographs recovered from a general Backblaze backup. I do not plan to import all of those into Immich. Instead, I will keep selected originals in a dedicated photos dataset so that an application is not the only way to access them.&lt;/p&gt;
&lt;p&gt;The next job is not glamorous, but it is important:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;verify totals and sample files from different years;&lt;/li&gt;
&lt;li&gt;confirm that original images and videos open, not just thumbnails;&lt;/li&gt;
&lt;li&gt;regenerate missing Immich thumbnails;&lt;/li&gt;
&lt;li&gt;create fresh, automated backups of both the media and database;&lt;/li&gt;
&lt;li&gt;keep an off-site copy;&lt;/li&gt;
&lt;li&gt;store the TrueNAS encryption keys and backup passphrases in more than one safe place;&lt;/li&gt;
&lt;li&gt;document the restore procedure and test it.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Only after that will I remove old or inaccessible backup sets.&lt;/p&gt;
&lt;h2 id=&#34;the-lesson&#34;&gt;The lesson&lt;/h2&gt;
&lt;p&gt;Before this happened, I thought of backups mainly as copies. Now I think of them as a recoverable system.&lt;/p&gt;
&lt;p&gt;A backup is not proven because a scheduled job says it completed. It is proven when you can rebuild the service, unlock the data, restore the database, retrieve the original files and confirm that they open.&lt;/p&gt;
&lt;p&gt;I was lucky. I had enough pieces left to reconstruct years of memories, including photographs I had not seen for a long time. The experience was stressful, slow and sometimes confusing, but it has given me a much clearer idea of how I want to protect my family&amp;rsquo;s data in future.&lt;/p&gt;
&lt;p&gt;This article is the first in a series about rebuilding my backup strategy properly. Next I will cover why backups matter, what the 3-2-1 rule actually means for a home server, how to back up Immich&amp;rsquo;s media and database together, and the system I am putting in place so that recovering from the next failure does not depend on luck.&lt;/p&gt;
</content>
    </item>
    
  </channel>
</rss>
