My idea was to built a home NAS that is cheap and has a low power consumption. It should provide at least 1TB of storage and upload speed should be not as slow as the storage on my router. For my use its not so important to have a RAID system.
Heart of the NAS
The first thought was to take a RaspberryPi – it is cheap and has low power consumption. But it only has USB to connect a HDD. Into the bargain it shares its 100Mbit bus with the USB. So reading/writing content to HDD and network traffic uses one bus.
Later I find the specs of BananaPi and it was exactly i was looking for:
- Gigabit LAN
- SATA 2.0 Port
- cheap (about 35 Euros)
- low power consumption
- small size (like RaspberryPi)
For storage I decided to take a normal 2,5″ notebook drive. I took a Samsung ST15000LM006 with 1,5TB of storage.
To run the BananaPi there is also a SD-Card necessary. I took an available class 4 card I had on stock, but it is possible to take even better cards; the more faster it is, it is much more better.
To power the whole thing up a 5V/2A Power supply with micro USB connection is needed.
The last part you need to build the NAS is a BananaPi-SATA-cable, like many electronic shops offer it.
Searching the whole web for a case (that could mount the BananaPi and the HDD) does not result into any useful match.
So I decided to build my own NAS case with Lego.
After some prototyping with available Lego parts, I ordered the required parts on the Lego shop (Pick-A-Brick: https://shop.lego.com/Pick-a-Brick).
Watch how to assemble the whole case:
The parts you need are:
|4||235726||Brick Corner 1x2x2||black|
|1||306926||Flat Tile 1×2||black|
|4||416226||Flat Tile 1×8||black|
|1||4211415||Flat Tile 1×1||grey|
|5||242023||Corner Plate 1x2x2||blue|
|3||4206330||Flat Tile 1×1||blue|
|5||306923||Flat Tile 1×2||blue|
|1||243123||Flat Tile 1×4||blue|
|2||370026||Technic Brick 1×2||black|
|1||370126||Technic Brick 1×4||black|
|2||4211374||Technic Brick 1×10||grey|
|2||4211137||Technic Brick 1×14||grey|
|1||4121936||Roof Tile 1×2 45°||blue|
|3||303923||Roof Tile 2×2 45°||blue|
|1||4504380||Roof Tile 1x1x2/3, ABS||blue|
|2||4183060||Plate 1×2 W/Fork/Vertical/End||black|
|2||4144575||Plate 1×2 W/Stub/Along/Upper P||black|
|2||4107761||Plate 1×2 With Slide||black|
|2||6069000||Roof Tile 1×2 45° W 1/3 Plate||black|
|1||4215513||Wall Corner 1x1x1||grey|
|2||4211515||Wall Element 1x2x1||grey|
|2||6071299||Wall Element 1x4x1 ABS||grey|
|1||6092583||Plate 1×2 W. 1 Knob||yellow|
|2||306901||Flat Tile 1×2||white|
|1||4211865||2M Fric. Snap W/Cross Hole||grey|
* It seems that the 1×8 plate is not available in blue anymore in the shop. But its possible to replace a 1×8 with two 1×4 (or 1×2 + 1×6).
Its also possible to change the color from blue to e.g. red.
I take the free Linux distribution OpenMediaVault (OMV). It is specially designed for network attached storages.
It supports everything, what i need from my NAS:
- Different Protocols like Samba, NFS, FTP, SSH
- User and Group management
- Statistic reports via E-Mail
- supports Plug-Ins
- configurable via web interface
Got to http://www.lemaker.org/ and get the OMV version for BananaPi. If the link is down you can try the download section of http://simplenas.com.
Make sure to download the version for BananaPi and NOT for BananaPro!
Flashing the SD Card
To flash the downloaded Image to the SD Card, a disk imager ist necessary.
For Windows I recommend the „Win32 Disk Imager“. You get you copy on https://sourceforge.net/projects/win32diskimager/.
The flashing is very easy, just select your OMV version as the image file and „Write“ it to the SD Card.
This will delete all data on the device so make sure to use the correct device to write on!
For Ubuntu the tool „imagewriter“ should do the work too.
After a few minutes of writing the image to the SD Card, you can put the Card into your BananaPi.
After switching on the BananaPi, it would run the boot routine and start OMV.
It would try to get an IP Address from the DHCP server in your network.
If the Pi is connected with HDMI to a monitor or TV, the IP Address is displayed on the LogIn screen (in my case its „eth0: 192.168.42.41“).
The other way to get the IP Address is to have a look into your routers overview of devices. Search for „openmediavault“.
Now open a browser on your PC and type in the IP Addres of the BananaPi.
In my case its 192.168.42.41.
You should see the OpenMediaVault Login screen:
Type in the default Username and Password:
Username: admin Password: openmediavault
Changing default Passwords
The first thing to do after Login is to change the passwords.
There are two default passwords in the system:
Password for Web Interface:
It has to be changed with „System -> General Settings -> Web Administrator Password“
Password for root:
To change the Linux root password you have to connect via SSH to your sytem.
I use the free terminal software PuTTY (http://www.putty.org/).
To connect, select „SSH“ as connection type, type in your OMV’s IP with port 22 and OPEN.
Confirm the security alert with YES and login as
Username: root Password: openmediavault
To change the password, use the instruction „passwd“.
Close the connection with the command „exit“.
Adjust Date and Time
The BananaPi do not have an integrated real time clock, so is is necessary to retrieve the actual time via NTP (Network Time Protocol).
Navigate to „System -> Date & Time“, select your Time Zone, check the Box „Use NTP Server“ and press SAVE.
Update the System
Now its time to update the whole system.
Go to „System -> Update Manager“, click on „Check“ and then update the packages.
In my case it was not possible to update via „Update Manager“ (it shows 0 packages to update).
I have done it with SSH connection and „omv-update“.
Mount the Storage
To check, if the HDD connection is OK, go to „Storage -> Physical Disks“.
Device „/dev/sda“ should be your HDD.
To mount it, go to „Storage -> File Systems“ and press „CREATE“.
The HDD will be formatted and the file system will be created.
Now select the created „/dev/sda1“ and „MOUNT“ it.
Create a User
For a share a user with its rights is needed.
Go to „Access Rights Management -> User“ and „Add“ a user.
Share the Storage
The Store is mounted, what you need to use it in your network is to share it.
There are some differences by sharing data in a network; a Windows system is different to a Unix system.
If you want to get the data by a Windows PC you should enable the SAMBA service of your NAS; for a Unix PC NFS would be much more better.
Create a Shared Folder
Sharing operates on folders, so a shared folder has to be created.
Move to „Access Rights Management -> Shared Folders“ and „Add“ one.
In my example I used the root path („/“) as the „Path“ to share the (nearly) whole drive.
Create Samba Share
To use the NAS with a Windows PC you have to configure SAMBA on your NAS. Navigate to „Services -> SMB/CIFS“. Enable it.
On the Tab „Shares“ add a new one with the shared folder you created before.
Test the share with Windows
On Windows you open an explorer and type in the address line the IP address of your OMV with two leading backslashes:
In my case: „\\192.168.42.41“
If Windows finds your NAS, it will prompt for user informations. After putting in your username and password created before, you can access to your shared folder on your NAS.
Thats it. Now you got a basic NAS!
The next steps can be to create
- different users with different user folders
- guest users
- NFS shares
- enable power saving mode
- install a SQL server