Home NAS Setup

Follows my notes on building a home made Network Attached Server (NAS).

These are notes are not a step-by-step tutorial, instead they are a complete guide from I've done to solve some difficulties that I've been facing. For topics that I've found interesting notes I'll provide the reference. For the solutions that I came up, I'll try to describe more detailed.

Hardware

I have assembled to cheapest computer possible to work as NAS:

Operational System

For the NAS OS I've choosen OpenSUSE 15.1.

Disks and Filesystems

In order to have some redundancy and not trow away I've decided to use the RAID software available on linux with mdadm. I'm using RAID level 5, which permits to miss one of my tree disks without loosing any data. As file systems I've played safe and chose EXT4 for / and XFS for /mnt/storage.

Notables Software

The most important softwares that work as glue between the NAS and theirs clients.

Energy Saving

Here in my house the NAS doesn't need to be on 24h/7, it would be an waste of power and also annoying extra heat and noise. So I've decided start it on demand. To accomplish this it necessary other computer able to wake up the NAS, since it is necessary to 'sense' in the network that some other device is looking for the server and also must capable of sending 'magik packets'. The other computer that I'm using to do this task is one Raspberry Pi 2.

There are few software options to this in the web (please refer the links provided below). However, none of them were exactly were I was looking for. So I wrote a small set of Python scripts, called pySleepWake. In this set there are two Python scripts: the first 'sleep.py' must go in the server and the second 'alarm.py', should be placed in the device that will be turned on all the time. The controlled variable used to suspend the NAS was taken as the network rx and tx traffic average in a given time window.

Here are some links that I've read as references:
https://askubuntu.com/questions/43374/power-management-sleep-wake-up-server-when-accessed
http://rolandtapken.de/blog/2013-07/use-autofs-wake-fileserver-demand
https://serverfault.com/questions/389286/automatic-wake-on-lan-in-linux-when-accessing-remote-filesystem
http://rolandtapken.de/blog/2013-07/suspend-nas-when-idle
https://askubuntu.com/questions/105536/tool-to-shutdown-system-when-there-is-no-network-traffic
https://gist.github.com/n1trux/b3310af725e3e17d4be7

Networking & Remote Access


Setup



Raspberry Pi Setup


Firewall [X]

https://serverfault.com/questions/74773/when-using-nfs-how-do-i-make-user-a-on-the-server-appear-as-user-b-on-the-clien
https://feeding.cloud.geek.nz/posts/setting-up-raid-on-existing/
https://askubuntu.com/questions/505446/how-to-install-ubuntu-14-04-with-raid-1-using-desktop-installer
https://askubuntu.com/questions/505897/installing-ubuntu-14-04-on-asus-zenbook-raid/532790
https://blog.hostonnet.com/grub-install-warning-this-gpt-partition-label-contains-no-bios-boot-partition-embedding-wont-be-possible
https://ubuntu-mate.community/t/ubuntu-mate-16-04-sometimes-needs-long-to-shut-down/5524/9
http://blog.erratasec.com/2016/10/configuring-raspberry-pi-as-router.html#.WasLmheQxhE
https://h3x.no/2011/07/09/tuning-ubuntu-mdadm-raid56
https://unix.stackexchange.com/questions/1314/how-to-set-default-file-permissions-for-all-folders-files-in-a-directory#1315
https://blog.shadypixel.com/monitoring-hard-drive-health-on-linux-with-smartmontools/
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki