Home Network-Attached Storage (NAS) Setup
Post
Cancel

Network-Attached Storage (NAS) Setup

Motivation

Since expanding my machine collection from one MacBook pro to 1) a work laptop running ubuntu 20.04, 2) a personal MacBook pro 3) a ThinkPad running ubuntu 20.04, I need help passing files between the machines. Also, I have long been paranoid about losing my files from cloud drives, especially when my files are spreading all over my google accounts, I want the files saved on my physical driver. NAS has become my solution.

What is NAS

A NAS system is a storage device connected to a network that allows storage and retrieval of data from a centralized location for authorized network users and heterogeneous clients. Source

To explain it more intuitively, a centralized location could be one of your computers with extensive storage, and network users could be your other machines. When they are all under the same LAN, the devices can access that centralized storage to have a more organized storage system and many other benefits.

Physical parts

To start, I need physical parts. SSD, server, internet, bootable USB driver. The hardware requirements depend on your NAS solution. I used openmediavault, such that my parts were following their prerequisites.

Essential parts:

SSD

  • 2 x 1TB WD Red SA500 Internal SSD - WDS100T1R0A - SATA III 6 Gb/s, 2.5”/7mm, Up to 560 MB/s
  • These two 1T SSD are my storage. I will use one as my primary storage and the second as the backup that sync the content of the first one.

Server

  • Intel NUC PC
  • Given by my friend Aaron and he 3D printed the enclosure.

USB driver

  • SAMSUNG MUF-64AB/AM FIT Plus 64GB - 300MB/s USB 3.1 Flash Drive
  • It turned out I needed two USB drivers, but luckily I have one spare USB stick.

Ethernet switch

  • TL-SG108E TP-Link 8-Port Gigabit Easy Smart Switch
  • Not necessary but since it’s black Friday 50% off and my router only has one LAN port, so why not

Network setup

  • NETGEAR - 32 x 8 DOCSIS 3.0 Cable Modem (CM700-100NAS)
  • Google Nest Wifi - Mesh Router (AC2200) and 1 point
    • I had this pair back in 2019. It has been very buggy this year in 2022, and I don’t know why.

Here are the parts and the final result, I think it ended up very beautiful.

Software side

I used openmediavault 6.x as my NAS solution, and Rsync as my data backup solution.

Issues:

1. Install

While the documentation says that the system can be installed on the same USB stick used to boot up, I have encountered this problem that would not let me do so, which seems a known issue. Most of the solutions I found are working around the issue, using another media to boot, and installing it on the USB drive.

Luckily I have one spare USB drive so I just burned the ISO directly into that USB using balenaEtcher. I used one USB to boot up as the ISO source and installed the Debian/openmediavault system to a second USB drive. Since I used a USB stick as the system boot drive, I have also installed openmediavault-flashmemory-plugin not to kill the USB too soon.

2. Gmail notification

I couldn’t receive the test email when setting up the email notification. After some searches, I found this post. Then I realized I had always entered the wrong input for the settings.

In the document, it has following instruction:

Gmail can be used in notifications. If you have 2FA enabled for the account, then is necessary to create an app password. Please use the following settings:

1
2
3
4
5
6
7
8
9
SMTP Server: smtp.gmail.com
SMTP Port: 587
Encryption mode: STARTTLS
Sender email: rootthe@gmail.com (include domain)
Authentication required: Yes
Username: rootthe@gmail.com (include domain)
Password: <the app password here>
Primary email: rootthe@gmail.com
Secondary email: optional

Here the email rootthe@gmail.com should be the one you want to receive the notification, and the password is supposed to obtain from this link.

Result

After following the setup guide and creating a shared folder, I can now attach the shared folder to all my laptops and move all my files to the NAS to centralize my file system.

Data Safety

After setting up the NAS system with openmediavault as my solution, another concern is about data safety. I decided to go with rsync inspired by this post. I would do the same job as the answer suggested in the post, using rsync to sync the files between my 2 SSDs. Rsync stands for remote sync. It is a tool to synchronize remote files and local files. It is easy to use, but the timing of the sync might cause issues like losing some files before the next sync begins.

Following the doc, I set a local rsync task that sync my two SSDs every 23 hours.

Steps:

  1. Created 2 shared folders on 2 drives.
  2. WebUI -> Services -> Rsync -> Tasks
  3. Create new task with type local, and set source shared folder and destination folder to be 2 folders on 2 SSDs from step 1.

Side Notes

By assembling my shopping list, I have learned something more about network, here is my notes and my reference.

ModemRouter
Brings Internet to homeBrings Internet to devices
Has public IP addressAssigns local IP address
Uses a WAN networkCreates a LAN network
  • Modem uses a coax cable connection, to connect the home to the Internet Service Provider (ISP) from the wall outlet.
  • Router uses an Ethernet cable connect to the modem, when using wireless router, it connects to the devices via wifi signal. ISP -> Modem -> Router -> Devices.

Google nest wifi router:

  • The router has two ports on the bottom. One is WAN (Wide Area Network) port, have “globe” icon on it. Another is LAN (Local Area Network) port, has “<->” icon on it. The WAN port connects to modem which in turn connects to the Internet. The LAN port is for devices to connect directly using Ethernet cable when they don’t have wifi access.
This post is licensed under CC BY 4.0 by the author.