Tuesday, May 12, 2020

NASPi - NAS Server with Raspberry Pi

After more than 8 years, I decided to retire my old Edimax NAS with something better, faster, quieter, colder and energy-efficienter solution. Possible candidate were Synology 218+, currently perhaps the best NAS device for home usage, but price without hard disks is a little too high (ca 320€), and than you need to buy two NAS hdds, for example WD Red or something like that. And price comes on to 500+ €. This was too much for my budget. There are, of course, cheaper devices like Synology 218 or 218j, but I wanted the best model.
 
= >
 

These days, a new version of Raspberry Pi with 4 GB RAM, Gigabit Ethernet and USB 3.0 come to me, and I wanted to try it for NAS purpose with SSD discs. Tried OpenMediaVault with discs connected direct over USB ports, but from some reason thing hasn't work. Then I found external USB case with 2 bays for 2.5" discs and RAID support - ICY BOX IB-RD2253-U31. This thing is made for Windows and doesn't support EXT3/EXT4 file system but just NTFS, and while OpenMediaVault doesn't support NTFS, a had to renounce OMV and to find some other possibility. ICY BOX case has its own power adapter, but I changed it with USB adapter, so I could power both devices - Raspberry Pi and IcyBox with one double USB charger of 2,5A.

So, finally I made it with Samba. For the first, of course, it is important to update the system and mount the disc unit:

sudo apt-get updatecd 
sudo apt-get upgrade

sudo fdisk -l

sudo mkdir /media/pi/IcyBox
sudo mount -t ntfs /dev/sda1 /media/pi/IcyBox

Now, second step is to install Samba software:

sudo apt-get install samba samba-common-bin


Third step is to configure Samba editing "smb.conf" file and under Share Definitions make our section icyboxpi (you can give some other name):

sudo nano /etc/samba/smb.conf

#======================= Share Definitions =======================
[icyboxpi]
path = /media/pi/IcyBox
writeable=Yes
create mask=0777
directory mask=0777
public=no

This options are pretty clear - writeable = Yes if you want to write in this folder, otherwise should be No; public is no if you want to access to the folder with username and password. After change you need to save changes and close the editor. Next you need to add your pi user with password to Samba:

sudo smbpasswd -a pi

Then, restart Samba share:

sudo system ctl restart smbd

Our Samba share is ready to serve the files through the network. If you don't know machine name or IP Address of your Raspberry Pi, you get it with hostname (machine name) or hostname -I (IP Address). Now, you need just to map your network share and assign drive letter:

1. Right click on MyComputer => Map network drive...

2. Choose wanted drive letter and assign path to the folder:
3. Enter your credentials (username and password given with smbpasswd command).

That's it. Now you can use your RaspberryPi Nas.

Enjoy!!!










Sunday, May 3, 2020

Raspberry Pi Monitor in a few seconds

If you want to monitor your Rasperry Pi device through the simple Web interface, there is RPi-Monitor. Simple free tool shows you basic data (processor, distribution, kernel, firmware versions), uptime, CPU data (load, frequency, temperature) and memory usage (RAM, Swap, SD card).
There are some other additional possibilities, such statistics, alerting etc.





Installation

Installation is extreme simple:

sudo apt-get install dirmngr
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 2C0D3C0F
sudo apt-get update
sudo apt-get install rpimonitor

Now you can start the app in your web browser with IP of your device and Port 8888:
If you need to update the app, you will find in upper left corner commands to update:

 
So, in this case, command is:
sudo /etc/init.d/rpimonitor update

And this is all - you can monitor your Raspi.

Maintain

Additional, you can activate automatic update:


sudo /etc/init.d/rpimonitor install_auto_package_status_update

If you want to deactivate automatic update, you need run:
sudo /etc/init.d/rpimonitor remove_auto_package_status_update

Upgrade

Also, from time to time you need to upgrade your software to newer version, if your installation is not in last status. It is also very easy:

sudo apt-get update
sudo apt-get upgrade
sudo /etc/init.d/rpimonitor update
Enjoy!!!💪