Where is all your data stored? Read how I was able to easily implement a second-hand NAS for my homelab. Incurring some hiccups, and obstacles along the way.
Time to read: 11 minutes
Preface
Creating a Home NAS is always on the list of someone who has ever worked in I.T. While there are simple methods such as enabling file sharing under advanced options on a Windows folder that can be easily executed by someone who is not the most technically inclined— to get the most out of a NAS, and do it right, is a different story.
What is a NAS?
NAS stands for Network-Attached Storage. This simply means data stored on the network that can be accessed from a machine on the same network. Whether uploading family photos, storing backups, or downloading Linux ISOs onto a new PC when needed— the ability is there.
What is needed?
My simple goal of the NAS is to create a central repository where my data can be stored. Not to be confused or relied on for a backup(I still need to implement a backup system in my homelab). There are a few items that need to be checked off my list for the NAS to fit my needs.
What are my needs?
First, I need to assess what my needs are, then I can curate the hardware, software, and storage methods as I seek fit. The following is what I deemed necessary:
- Universal access from different machines and operating systems
- User access control integration for file access
- Backup features to store desired data
- Cloud synchronization from devices
- Hard drive redundancy
- Relatively low power consumption
- FREE software solutions
The Hardware
Of course, to run the NAS, there is some hardware that is needed to store the data, power the machine, and make logical hardware and software decisions. I just so happened to receive a second-hand proprietary NAS unit that seemed to be collecting dust. It’s an iomega ix4-300d machine that has four hard drive bays, 2 USB 2.0 ports, 2 ethernet ports, dc power port, and a USB 3.0 port on the front. It also came with four used hard drives. x2 2TB Hitachi HDDs, and x2 Seagate 1TB HDDs. Score!
For a long while I tried researching the best method to create a NAS for my needs and limitations. Cost, like many others, was the driving factor for my decisions and blueprints. Needless to say, when offered the free NAS device, I was starstruck. The plan beforehand, was to use my Raspberry PI 4 that hosts some containers currently and create an additional container to run a NAS. I would simply connect some external USB HDDs and accept the “janky” and “inefficient” setup. But now with a much higher quality hardware setup, I can really utilize the true potential of a NAS setup.
The Software
The software portion is where I was much less experienced in— but still extremely eager to learn. I had always heard of OpenMediaVault and TrueNAS (for good reasons as well). Now, being that I didn’t have an additional computer laying around, or a few hundred dollars burning a hole in my pocket to build a small server to host a NAS software, I did not need to venture down the avenue of the software too much.
Initially, I was very interested in TrueNAS or OpenMediaVault for the software to use in the setup, but because of the second-hand NAS I received, I would soon begin using Lenovo’s proprietary software because of compatibility restrictions between TrueNAS and Lenovo’s Marvell CPU. This is because the processor is not ARM64-based, so it is incompatible with TrueNAS requirements. I naively assumed the processor was indeed ARM64, and attempted to override the built-in Operating System, and flash boot TrueNAS from a USB drive. It was only after finding out that the machine and software were not compatible, that I accepted that I would need to use the proprietary software. Needless to say, I was disappointed but still determined to continue forward with the project.
RAID Questions
Now on the horizon of the NAS project, I needed to assess what RAID method I would use for my NAS setup. When it comes to storing data, RAID is almost always used due to the various options, tools, and reliability. But let’s answer the following questions to better understand— What is RAID? Why use RAID? Which RAID should I use?
What is RAID?
RAID stands for: Redundant Array of Independent Disks. Meaning that the data you store on hard drives are fault tolerant and it is one of the many methods used to store data in both an enterprise environment, and home enthusiast environment.
Why use RAID?
Using RAID allows one to add a layer of protection to a user’s stored data. Any form of drive that stores data is bound to fail at one point or another (some sooner than others). RAID offers a solution to the dreading day that one of the NAS hard drives fails and loses data. RAID can copy data to multiple disks which allows the user to simply replace the failed hard drive with a new drive without losing any data.
Which RAID should I use?
There are four main different types of RAID labeled with numbers, that each have different functionalities.
- RAID 0 — Contrary to the fault tolerant trophy RAID carries, RAID 0 does not provide fault tolerance because it does not copy data to an additional hard drive. Instead, it stripes data to the two hard drives. If one drive fails, data is lost.
- RAID 1 — Each drive has a copy of the data so when one of the hard drives failed, data is not lost.
- RAID 5 — Three or more disks are required for RAID 5. Data is not duplicated but the data is striped across the hard drives. Parity is also used across the hard drives to ensure that once a hard drive fails, it can be replaced and the data is not lost, and the data can then be rebuilt on the new hard drive.
- RAID 10 — RAID 10 is combining RAID 1 and RAID 0. Four disks are required. Two sets of two disks are copied using the RAID 1 method. The two sets are then striped using RAID 0. Note: RAID 10 can only use 50% of the data storage.
RAID Ultimatum
So which RAID am I going to use? It boiled down to RAID 10 and RAID 5 for me. I have four hard drives, and a small enterprise-level NAS unit. The idea of being able to hot-swap a failed hard drive and almost instantaneously have my data restored using RAID 10 is appealing, but I don’t keep cold drive spares currently. RAID 10 is also more expensive for drive costs, and the fact that half of the storage is rendered “unusable”. RAID 5 allows more storage and includes parity but the slower performance of reading and writing, as well as the slower rebuilding of the array. Ultimately, I chose RAID 10 because of the speeds, reliability, and because after calculating the “lost” or “unusable” data, I’d still have three TB of hard drive space to store data.
Edit: I ended up switching to RAID 5 after the unforeseen circumstance below where I valued the storage space above all the previously mentioned pros and cons.
Unforeseen Circumstances
Once I began setting up the hardware aspect of the NAS, I remember plugging it in and checking the GUI and seeing hard drive error messages in the logs or alerts. One of the Seagate 1TB HDDs seemed to be not detected on the NAS. I disconnected the drive and connected it into my main workstation in attempts to see what may be the issue. No dice. The hard drive was not being detected at all on my machine. The drive was also completely silent when bringing my ear to it. I attempted some hard drive scans and repair tools to see if it was recoverable in any way, but the attempts were futile. The little guy had met his maker, and I had taken a whole step backwards.
I had pondered for a while on what I could do next to overcome the unforeseen obstacle. I went online shopping eventually in search for some deals when I stumbled across a deal on a 2 Terabyte hard drive. $100.00 for (x2) Seagate – Barracuda 2TB. These drives are not anything special. They are not Western Digital Reds or super high-quality drives specifically created for Network-Attached Storage systems but— for my case, they were plenty enough. This is a small home project, where I will not be overanalyzing the write and read speeds because they need to be top-notch. Or worrying every waking moment because the longevity of the hard drives from statistics and reviews deem it to fail any second. This is not an enterprise environment after all!
The Final Push
Now back on my feet with my newly purchased hard drives, I swapped both the 1 TB HDDs in the NAS for the new Seagate 2 TB HDDs. This places the storage capacity to 8 TB in total. I started reconsidering my options for RAID and before I knew it, I was settled on RAID 5 to be able to leverage more storage but still retaining the option of a hot-swap in the event that one of the hard drives fail. Next, I ran through the setup after inserting the hard drives and connecting the machine to my network. I completely wiped the previous hard drives of any old stored data and factory reset the NAS. The user interface of the setup is definitely dated, showing it’s age, but was very straightforward in allowing me to configure. Some configuration options included: write caching, SNMP, CIFS, personal cloud, UPS management, and users and groups. A lot to play with!
I saw the personal cloud option and was extremely excited to configure and setup. I could offload/access photos and files from my phone directly to this NAS. But I was let-down when I saw there was a CVE with no patch in regards to the personal cloud feature from the NAS. Boo! Therefore, the device data synchronization need of mine was thrown out the window and lay vulnerable in the road. I setup users and groups and file shares pertaining to the users and groups. On Windows and MAC a User-Access-Control window appears in order to authenticate the user requesting access to one of the file shares. The option of integrating Active Directory to manage users and groups through a domain is available with this NAS if I do decide to create an environment in the future. The NAS was officially setup and live in action.
Performance and Review
The NAS has been in production for over a year now and I have not seen a single dip in performance or accessibility. It is a very basic setup and does exactly what I need it to do. Read and write speeds are nothing to gloat about, as it averages about 32 Mb/s when copying a file from my machine to one of the file shares. The expectations were not set entirely high for me and I haven’t been let down since. The capacity of the hard drives on the NAS currently sits at 5.4 TB of space to utilize. I have not even come close to using up the storage quota.
Let’s review if all my needs were satisfied:
- Universal access from different machines and operating systems
- User access control integration for file access
Backup features to store desired dataCloud synchronization from devices- Hard drive redundancy
- Relatively low power consumption
- FREE software solutions
Final thoughts
I had a super fun time implementing this NAS into my homelab and despite all the trouble that arose during the setup phase, I still enjoyed my time nonetheless. It was straightforward, fit majority of my needs, and a new experience to jot down in my journal. For future instances of setting up a NAS, I am still very interested in playing with TrueNAS or OpenMediaVault to utilize some more features, and configurations to test and learn. As well as building a machine with hardware specifications in mind to truly optimize the NAS for it’s performance and reliability. Overall, this was a fun experience!