Sunday,20-December-2020
Raspberry Pi4 - NAS my version , and combined with Hamachi and 4G access
EN
There are many articles over the web, how to make use of Raspberry as NAS. Well, here is my story in “color” and hopefully it will help you in your project.
What I bought for that purpose:
- Raspberry Pi4 / 4Gb ram version - probably 1Gb one will do the job just fine
- SATA to USB board (mine is from Aliexpress)
- 5V few ampers power supply (come with the board)
- some raspberry cooler (probably work well even without it but just in case)
My initial idea was to be able to use it behind 4G network, something that some ready one NAS can`t do.
What happen, you`ll see at the end, and anyway we are just at the beginning.
This time will try my best to write it just as step by step manual not as novel.. so here we go:
Downloading Raspbinan
For the time of testing and writing this, I used: 2020-12-02-raspios-buster-armhf-lite.img You`ll fin it on the developer`s website. How to write it over the SD card will not be described here, but for sure won`t be an issue if you already use Raspberry
Installing OMV [open media vault]
Many of the topics advised to download ready compiled IMG file and just write over the SD card. Somehow the new one need to be manually installed. Or in other words:
https://sourceforge. … penmediavault/files/
Open that link, and then select: OMV 5.x for Single Board Computers, after that get to the PDF manual and follow the instruction.
Based on them is what I typed:
- login with the Pi user and password (what ever it is)
sudo raspi-configs
- start the use of SSH (much easy to use without connected monitor) , next:
sudo apt-get update
sudo apt-get upgrade
(If the upgrade halts, with a prompt to read, press q to “quit” and the upgrade will proceed.) When updates and upgrades are complete, type:
sudo reboot
When the reboot end copy and paste:
wget -O - https://github.com/OpenMediaVault-Plugin-Developers/installScript/raw/master/install | sudo bash
Now, you need to wait. It will take some time. When ready reboot the Pi:
sudo reboot
After the restart end, is ready to go via GUI interface.
Just to add quick remark here:
- I connect the raspberry to the network via LAN.
- also in my router I assign static IP to it:
And knowing that IP, make it easy to connect and set up.
To do something with the settings, now can go inside via the WEB interface, in my case: 192.168.1.3:
Default user name and password: admin / openmediavault . In any tutorial is strongly advised right away the password to be changed, so I have done it also:
- changing the build in initial admin password
that done, next are some setting on the network interface:
- NETWORK
From here I stop the WLAN interface and leave only the ETH0 (LAN). Somehow it was messing and slowing the boot process.
Despite I stop the “wait for network…bla bla” in raspi-config settings, still it hang on one place during the boot cycle.
Odd enough, when it was only with Raspbian Light installed, boot was just fast without any side “effects”. All began after OMV been installed. Keep that in mind!
- POWER management
I installed it on Raspberry, so I left that untouched because no need for it
- STORAGE > disks
Here, can be seen what drives are available for use. Because I add extra 240Gb SSD, it can be seen also.
Just not yet set to be used.
- STORAGE > smart
I think that option is good to have in case storage will be over harddrives, but I use SSD. Nothing to set.
- STORAGE > File system
Here, you mount (getting in use) the drive. You can format and prepare the drive also from here, or to format it in advance via external software as (Mini Tool partititon wizard). I`ve seen few videos that it work good with NTFS formated drive, but choose to format mine in EXT4. When formatting is ready press “mount”. When see it “Mounted” and “Online” you`re ready to go. Once set the users, again from here can be eddicated quota limitation for each user. If you want to..
- ACCESS > Users
Here, you can add one guest user without password and make everyone to have access to the folder/drive. Or like me, with levels and dedicated users to filter who do wat.
What you see is what I choose and work for my idea. Also, both of the users I select to be only in group “users” nothing more. And it worked just fine
- ACCESS > Shared folders
Here you must created folders that will be accessed/shared. You see my example with two created and set in use.
Pay attention on “Permissions” tab in that extra settings.
Already having users, must be set some privileges:
One thing extra, that I check and set was that: ACL in Shared folder
- SERVICES
All was set until here, so now the time to choose the services what the NAS will control.
In the shot above is shown the one used for windows and also work well for linux. Or at least with my Mint with SAMBA installed was able to read and write just fine.
And how to set the folders to be used with that service seen here:
Now, the NAS is good to go and use!
USING HAMACHI
the thing that I have in mind and start that topic with, was to try achieve access via 4G network. Because I use internet from mobile provider, the IP is common like 83.xxx.yyy.zzz for whole base station, and the SIM IP:10.xxx.xxx is some sub-net class. In other words if I try with 83.xxxx nothing will happen.
Many years back I was using HAMACHI to get some computers connected as in local network. Perhaps paid VPN service will be just fine, but LogmeIn offer 5 machines in free license so why not to try again..
First need account to be created and logged in:
Once inside, make your personal network:
Select it type:
I found that on the shot above to be best option for me, because if any two of the computers added are online and can work ans desired. It`s up to you to leave the new coming users to be approved before adding them or just to join free and automatic.
When you install the HAMACHI software, login with your account and the computer will appear with it unique IP in the list. Then just add it to your network.
In that example you see that my desktop and NAS are online.
Ok, for the windows was easy, but what about the Open media vault / Raspberry?
How to install it:
Open terminal (SSH connection to the Pi) and type:
sudo apt-get update
sudo apt-get install lsb lsb-core
sudo reboot
Then we need to install the package itself:
- go to https://www.vpn.net/linux
- somewhere at the bottom you`ll see : logmein-hamachi_2.xxxx_armhf.deb <-some version
The number can be any new version they have. Then you give right click over it and copy the full link.
After that been done, add it again in terminal:
sudo wget https://www.vpn.net/installers/logmein-hamachi_2.xxxxxx_armhf.deb
Next install the package by running:
sudo dpkg -i logmein-hamachi_2.xxxx_armhf.deb
Once everything is installed, log into Hamachi with:
sudo hamachi login
After getting the “ok” from the login process, you need to type the nickname for that machine:
sudo hamachi set-nick what_ever_name
Then must be connected to the server as user:
sudo hamachi attach your@registered_mail_for_hamachi_account_here.com
To attach it to your network, open the online page/as shown above and add it.
Last, you should add it as autostart into the raspbian OS:
sudo update-rc.d logmein-hamachi defaults
sudo reboot
Now, presuming all is installed correctly should come something like that:
and already can be seen online.
Add USB 4G MODEM
I own one Huawei 4G USB modem. It is actually with pseudo router function so if go in web browser and type 192.168.8.1 you`ll see settings, and SIM control.
What I have done was:
- as the raspberry is on, i plug the USB stick and give it some time. After that I type:
sudo lsusb
What list me all USB devices, and I see it there. That was good, so next I check if it was configured automatically
sudo ifconfig
As you can see, the interface was there UP and running. That was really good! What next?
To add it to auto start interface in Open Media Vault.
That set, saved and system restarted I get that one:
All interfaces where UP and running.. But there was one thing extra missing-accessing it via my Android phone.
And here what I made next to be able to:
I went to the website again, and choose mobile. There are some easy settings,and it will generate VPN settings for your smartphone. With mine (android 10) in other networks, just choose new VPN account ant write what Hamachi generate for me(in the red rectangle I mark the button what need to press and it show what goes where).
That done, and yes already have it working:
As you can see , once again I access the NAS via my 4G sim and the NAS itself was connected via 4G router with second sim card in it:
That`s all.. Hope will be in good use to someone else. Cheers!
Add comment
Fill out the form below to add your own comments