Raspberry Pi NAS V2 - Continuous Updates
by Tinker92 in Circuits > Raspberry Pi
69 Views, 0 Favorites, 0 Comments
Raspberry Pi NAS V2 - Continuous Updates
In this article, builld a home-made Raspberry Pi NAS that enables you to store your files, backup your photos on your phone, do remote download and manage movies videos and watch them on other clients - like your laptop and phone, recently I rebuild it by attaching another 2.5" disk to it, also I reprint the case with a Bambu Lab 3D printer. Most NAS tutorials focus more on hardware, here I talk both hardwares and software to build this all functional NAS.
Supplies
Required:
- Raspberry Pi 4 (recommend 8Gb, 4Gb can also work)
- A MicroSD card for installing Raspberry Pi OS (recommend 64 Gb)
- Some 2.5" disks, you can use the ones from your old laptop
- SATA to USB cable
- 5V power supply
- Some wires
Nice to have:
- A 5V cooling fan with PWM
- A NO (normally open) switch for power button
- A USB hub with power supply if you want to connect more disks
- A SSD1306 OLED display
Install Raspberry Pi OS
Firstly go to Raspberry Pi website: https://www.raspberrypi.com/software/, and download the Raspberry Pi Imager on your computer. Then connect a MicroSD card to your computer, flash the OS to the card, make sure you select the Raspberry Pi OS Lite (64-bit), do not use “Desktop Version” as Open Media Vault can not run on desktop version, you can set hostname, user name and WiFi SSID and password before flashing it to MicroSD card. Once you've done, insert the card into your Raspberry Pi and start it up.
Install Open Media Vault on Raspberry Pi
OpenMediaVault (OMV) is an open-source network-attached storage (NAS) operating system based on Debian Linux, designed for use with home and small business servers, we can install OMV directly on our Raspberry Pi following this document on GitHub.
Before install that, you'll need to ssh connect to your Raspberry Pi, personally I use Termius (https://termius.com/) for that, just put your local IP address of your Raspberry Pi, user name and password you're able to connect to your Raspberry Pi.
Once you're connected, run below commands to install Open Media Vault on your Raspberry Pi:
After that, connect the disk to your raspberry Pi, here I connect two of them to Raspberry Pi USB3.0 port via a USB hub with power supply and later use LVM (Logical Volume Manager) to extend them to a larger file system, you can also connect just one disk. A Rasberry Pi all USB ports can provide maxium 1.2A, a 2.5 inch disk needs around 1A, therefore if you want to connect more disk, a USB hub with power supply is required.
Once you have Open Media Vault installed, open your Raspberry Pi IP address, in my case it's 192.168.2.118, use user name "admin" and init password "openmediavault" to login.
Setup Open Media Vault and File Browser
First, install below plugins for future use (you can find that under System -> Plugins):
- openmediavault-filebrowser
- openmediavault-lvm
- openmediavault-cputemp
Next, if you connect only one disk to your Raspberry Pi, go under Storage -> Disk, format your disk, and go to Storage -> File Systems, create a File System using that disk, and finally under Storage -> Shared Folders create a Share Folder with the File System.
And if you have more than one disk, first go to Storage -> LVM, as mentioned before LVM (Logical Volume Manager) is used to connect disks and extend the logical size, I didn't use RAID here. Go to LVM -> Physical Volumes, add your disks there, then go to LVM -> Volume Groups, create a volume group with these disks, then in LVM -> Logical Volumes add this volume group. In Storage -> File Systems create a file system with the volume group, finally under Storage -> Shared Folders create a share folder.
After that go to Service -> File Browser, as perviously we installed the plugin, select the share folder we created perviously, and click the "Enabled", apply the change. Click the "Open UI" button on this page or visit http://<your raspberry pi IP>:3670 to access File Browser (File Browser uses port 3670). Where you can now create folders and upload files to realize the basic NAS feature.
Docker Container and Others
I'll continue to update more advanced softeare in NAS in coming weeks, include docker and some fun containers that allow you to play movies, romate download and do automatic image backup. So far if you have any questions, please post comments below, I'll check and solve problems with you.