I’ve received a PI from my Friend; he was also interested in building a simple and cheap NAS. I’ve got this: https://thepihut.com/products/raspberry-pi-zero-essential-kit (roughly 1.900 HUF as the time of writing).
Getting the hardware
The first days was mostly about reading the docs, and understanding what do I need to achieve that; so I’ve created a list, to see what do I need to make it happen.
- Power adapter (actually, I didn’t had to buy it, as it works with my phone charger)
- Active USB HUB (the PI doesn’t have enough power for storage / networking / display / etc), and I wanted to make sure on that won’t be a bottleneck. I’ve chosen this: https://edigital.hu/usb-portbovites/d-link-dub-h7e-7-port-hi-speed-usb-20-hub-p298546 ( 6.990 HUF ).
- USB -> Ethernet adapter: https://edigital.hu/egyeb-portbovites/approx-appc07v2-usb-20-rol-rj45-re-10100-lan-adapter-p360353 ( 4.090 HUF)
- 1,5 m HDMI Cable (4.000 HUF )
- Wireless keyboard (if you have an USB keyboard / mouse, you won’t need that) (costs vary, I shouldn’t count this)
So, it costs around ~ 16.980 HUF, but I didn’t had to buy power adapter, and display (my TV speaks HDMI fluently) :)
The Software part of things
Finally, I was able to connect everything, and it was surprisingly easy. It comes with a Raspbian pre-installed (https://www.raspbian.org/), and as it’s a debian derivate, it was easy to install things.
I’ve tried to install vlc, but I coundn’t figure out the correct video output, so I’ve just used omxplayer ( https://www.raspberrypi.org/documentation/usage/video/ ), and it worked perfectly, with sound (HDMI can transfer sound, I didn’t knew that). Well, almost perfectl, I cannot do fullscreen, so the top and the bottom of the desktop was visible until it went to powersave (and became dark).
Setting up the NAS
I’ve installed samba and autofs with
$ apt-get -y install samba autofs
If this command fails to you, you just have to update your package repository by issuing
$ apt-get update
and retry. After that, I’ve added a samba password with
$ smbpasswd -a pi
The last thing I did is to setup samba share to the directory where autofs mounts things; which is
I did that by removing all unnecessary (homes, printers, etc) share and adding this block:
[media] comment = RPI Media path = /media/pi quest ok = no browseable = yes create mask = 0660 read only = no
It’s safe in a home LAN environment, when the device is not reachable from the public internet / outside the LAN.
BUT if you want to connect it to some meshnet, or reach the NAS from the outside internet, it’s definietly NOT safe enough, and you shouldn’t even try to do it without really understanding the attack surface.
The whole process without any prior knowledge of this kind of devices took ~8 days, including everything (waiting for equipment, being too tired / drunk to do anything, and things like that), so I wasn’t in a hurry.