How to build a NAS with BananaPi and LEGO

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.

The Parts

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.

bananapi.JPG

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)

The storage

hdd

For storage I decided to take a normal 2,5″ notebook drive. I took a Samsung ST15000LM006 with 1,5TB of storage.

Additional Parts

sdcard

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.

power

To power the whole thing up a 5V/2A Power supply with micro USB connection is needed.

cable

The last part you need to build the NAS is a BananaPi-SATA-cable, like many electronic shops offer it.

The Case

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:

Quantity Element number Part Color
1 6004927 Plate 16×16 grey
1 300526 Brick 1×1 black
2 300426 Brick 1×2 black
1 362226 Brick 1×3 black
1 301026 Brick 1×4 black
1 611226 Brick 1×12 black
2 300326 Brick 2×2 black
1 300226 Brick 2×3 black
1 300126 Brick 2×4 black
2 4181144 Brick 2×6 black
2 6037390 Brick 2×8 black
4 235726 Brick Corner 1x2x2 black
1 306926 Flat Tile 1×2 black
4 416226 Flat Tile 1×8 black
1 302426 Plate 1×1 black
6 302326 Plate 1×2 black
5 362326 Plate 1×3 black
1 371026 Plate 1×4 black
7 366626 Plate 1×6 black
4 346026 Plate 1×8 black
1 447726 Plate 1×10 black
3 302226 Plate 2×2 black
1 302126 Plate 2×3 black
2 383226 Plate 2×10 black
1 244526 Plate 2×12 black
1 4211389 Brick 1×1 grey
2 4211388 Brick 1×2 grey
1 4211428 Brick 1×3 grey
2 4211394 Brick 1×4 grey
1 4211415 Flat Tile 1×1 grey
2 300423 Brick 1×2 blue
1 362223 Brick 1×3 blue
3 301023 Brick 1×4 blue
1 300323 Brick 2×2 blue
1 300223 Brick 2×3 blue
1 4181139 Brick 2×6 blue
4 302423 Plate 1×1 blue
1 302323 Plate 1×2 blue
3 362323 Plate 1×3 blue
5 371023 Plate 1×4 blue
2 366623 Plate 1×6 blue
5 ????* Plate 1×8 blue
1 302223 Plate 2×2 blue
2 302023 Plate 2×4 blue
2 379523 Plate 2×6 blue
3 303423 Plate 2×8 blue
4 303223 Plate 4×6 blue
2 303523 Plate 4×8 blue
2 4199519 Plate 6×6 blue
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
3 302424 Plate 1×1 yellow
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.

The Software

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
  • Monitoring
  • Statistic reports via E-Mail
  • supports Plug-Ins
  • configurable via web interface

Installation

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.

01_win32_disk
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.

02_win32_disk

First Login

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.

021_omv_boot.jpg

022_omv_boot_2.jpgIf 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:03_omv_login

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/).04_omv_putty
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.

05_omv_mount

To mount it, go to „Storage -> File Systems“ and press „CREATE“.
The HDD will be formatted and the file system will be created.06_omv_mount_2
Now select the created „/dev/sda1“ and „MOUNT“ it.

Create a User

For a share a user with its rights is needed.07_omv_user.jpg
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.08_omv_shared_folder
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.09_omv_share
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
Advertisements

Kommentar verfassen

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

WordPress.com-Logo

Du kommentierst mit Deinem WordPress.com-Konto. Abmelden / Ändern )

Twitter-Bild

Du kommentierst mit Deinem Twitter-Konto. Abmelden / Ändern )

Facebook-Foto

Du kommentierst mit Deinem Facebook-Konto. Abmelden / Ändern )

Google+ Foto

Du kommentierst mit Deinem Google+-Konto. Abmelden / Ändern )

Verbinde mit %s