One day, a tiny resistor on your hard drive may decide to explode for no apparent reason. You spend days looking for a donor drive and how to swap ROM chips. Then you realize you need to send it to a professional repair shop that has all the required and expensive tools. You know that this is not a cheap option and there is a chance that you lose your files, but you have to take your chances even if it costs an arm and a leg, because your files are way more important to you. After a couple of days, maybe a week or two, you finally receive the good news! Your hard drive is spinning again and you need a new hard drive to move all the files from it, for one last time. You receive the new hard drive back, open the bubble wrap around it, and verify that all your valuable files are there! Finally, you can have a sip of coffee with a smile on your face.
You are happy that your files are back, but what if it happens again! What if next time you are not this lucky! You know that you need to back up your files and those important project data, but it’s not very convenient to always carry an external drive and hook to all your devices! Your laptop, smartphone, PC, tablet.. You need something more sophisticated to automate things. You need a network attached storage that is accessible to all your devices, but they are way more expensive than an external hard drive. Those professional ones with hot swappable drives are even more expensive than a typical laptop!
What about creating your own NAS with a cheap Raspberry Pi? Yeah, a $35, power efficient, single board computer with all the required peripherals! Besides that, all you need is a powered Sata to USB converter and a box that you can 3d print! There are even free open source software to install on your raspberry pi and also your laptop, to sync your files.
Any backup solution, is better than just relying on your luck! And the more data redundancy, the better, but usually, more redundancy means spending bigger!
There are not a lot of people who get 96 terabytes of server grade, Kioxia drives for free and rackmount servers are noisy and big. Also, online backup solutions are not the best choice for a lot of people, because of the cost, privacy issues, internet speed and the size of files. Having RAID on laptops is also nice, but most manufacturers don’t add hardware RAID to their products, even with today’s tiny NVMe drives.
That’s why a lot of people consider a NAS as their local backup solution and some build their own NAS, because it’s a cool thing to do and can cost you less. You can attach more than one hard drive to a Raspberry Pi, because it has 4 USB ports and with a powered USB3 hub, you can even attach more drives. You have to use externally powered SATA to USB boards, because a Raspberry Pi cannot supply a lot of current to external USB devices. SATA converter kits and also Externally Powered USB Hubs can solve this problem. You can 3d print an enclosure for your hard drive, converter board and the Raspberry Pi. You can also stack more drives on top of each other to create a NAS with a bigger storage or to use software RAID.
Designing a 3d enclosure for your NAS is not a very complicated task with the help of online apps like TinkderCad. If you have a 3d printer, you can slice the output STL file and print it yourself, or you can use online services to print your file. After receiving your box and assembling the components, you need to prepare a micro SD card for your Raspberry Pi. You can download the Raspberry Pi OS lite from the raspberry pi website and write that image to your SD card using Etcher or the Raspberry Pi Imager. After booting the OS, you can use SSH to connect to the Linux terminal and install OpenMediaVault to manage your NAS.
OpenMediaVault or OMV is a NAS solution based on Debian Linux which you can install on your Raspberry Pi. It has a Multi-lingual, Web-based graphical user interface to let you manage services like CIFS, FTP, NFS, SSH, rsync, iSCSI, AFP and TFTP, which are crucial on a NAS device. It supports software RAID, Windows, Linux and Apple file systems and Hardware Monitoring. You can handle user and group management, access control, Quotas, Partitioning and volume management, Link aggregation and system security using OMV.
It is a simple and easy to use, out-of-the-box solution that will allow everyone to install and administrate a Network Attached Storage without deeper knowledge, but it can be extended using plugins. You can install plugins for other features like LDAP, SAN, LVM and ZFS. There are also 3rd party plugins, thanks to the modular design of the framework.
The installation on Raspberry Pi is a little bit different, but this guide can help you get it installed using an installer script. The link to this guide and other resources are in the description. Follow the instructions carefully, otherwise you may lose network connectivity. An 8 gigabyte SD card is enough to install Raspberry Pi OS Lite and OMV, but it is better to go higher since finding an 8 gigabyte SD card is harder than a 32GB one these days. Plus, you will have more storage for plugins, updates and future upgrades.
After installation, you can login to the web GUI and config your NAS. In the first steps, you can change the web admin password, hostname and IP address. Then you can wipe your hard drive, mount it and enable different services that you need like NFS and rsync. You also need to add some users for your devices and manage the permissions and ACL on the shared folders.
If you need to have a shared network drive in windows, you can enable CIFS. In Linux you can benefit from NFS and Rsync. Using Rsync you can sync your important files with your NAS. It only syncs the files that are new or are changed and you can set up Cronjobs to do that periodically.
Rsync is a command line tool, but there are various Desktop apps in Linux to help you use it in a graphical interface. You can use GRSync or Luckybackup. You can exclude folders and files to prevent temporary files and shared libraries from the transfer. You can use patterns to exclude or include files and folders.
There are also apps like FE File Explorer in android and iOS to help you explore your shared folders. You can also open media files, directly from the NAS. Having a NAS is also very convenient for transferring your pictures and videos out of your smartphone or tablet.
You can also create a DIY NAS with a Raspberry Pi Compute Module 4. It has a PCI express interface, but you need a carrier board to access it. The pcie port lets you use a hardware Sata or RAID card. You can achieve higher speeds using those cards or create redundant arrays.
One of the main advantages of creating a DIY NAS is the cost, especially in home and small business use cases. You can have the boards and the box and also accessories for even less than a 100 boxes. Plus it’s cool to create a network drive with your own design and marking and you can learn new skills along the way, but it’s not going to be as easy as buying a commercial NAS.
A commercial NAS with native SATA ports and gigabit networking can be a lot faster compared to a raspberry Pi 4 or even the compute module 4 with a SATA card.
A lot of people build their own NAS for the experience and the fun of putting one together. That’s a very valid reason, especially if you want to gain familiarity with the technology and NAS server software. You can also customize it as much as you want and future software and hardware upgrades will be easier.
But if you simply want to get a reliable storage, you can buy one off the shelf and save a ton of time. If a lot of users are going to use your NAS simultaneously, or you need low latency and high speeds, buying a more power commercial NAS or a better SBC is the wiser solution. You can even go for a small ITX motherboard. OMV is based on Debian and you can install it on a server or PC too.
That’s it for now. Tell use your opinion about the software or hardware that you prefer to use for your NAS. Do you want to buy a commercial NAS or do you prefer building one yourself?