[HowTo] Debian 9 with OpenMediaVault 4 | First working step by step tutorial for everyone. Beginner friendly.
Attention: You will find this guide also on gnubee github site. Nobody should be punished to use a data spying service from an asshole company like google :)
Hey all,
In this "beginners" tutorial i will show you how you can set up OMV with your gnubee.
If something is not working or you need help, write here. i will help you with normal words, so everyone can understand it. Not only IT-nerds!
-> IF you really cant get your gnubee running with my help and this tutorial, i can also make an disk image of my 120gb SSD Operationsystem drive. So you only must burn it on a 120gb ssd drive and stick it in the first drive and your gnubee will run.
Disclaimer | Why i wrote this tutorial:
I'am a person that cares about privacy and i love the open source movement! This is why i bought the gnubee.
After getting it, it was a nightmare to setup (Believe me i was working 1 month like a full time job on the gnubee).
I'am not a programmer or an it-guy. I had a lot of struggle with other devices, like my OpenWRT Router set-up for perfect privacy, but all of them can't compete against the gnubee. It would be so damm easy if the producer of the gnubee would make an sd-card or HDD image that works like sd-cards with the raspberry pi! But no, they decided to be "real special":"Only "Geeky IT-Programmer" should use the Gnubee. It is not for everyone". For me all people are equal and we should help us all and share all our knowledge. This is want the open source movement stands for right? I was banging for help, but i didn't get people that really wanted my gnubee to run. Only telling me more Nerdstuff and wanted me to use other Images that don't work! Not really read want my problem is and help me at the point of my problem with normal words everyone can understand.
-> It is really sad that people are acting like instagram influencers after they learned to programm and think only if you speak their language your are worth to use their nerdy stuff. Everyone is equal and welcome. Thats the open Source spirit!
What you need:
- Gnubee Personal Cloud 1 or 2
- Power supply 12V 3A (not less because with less the gnubee won’t read your drives)
- Optional: USB-to-UART debug cable to get your IP (You get the IP also in your Router under your connected devices)
- Sata Harddrive with 10GB minimum -> SSD recommend for the first slot for a silent debian operating system
and the same drive size for the other 5 drives if you want to use raid
- USB-Stick formatted in FAT32
- Sata to USB Adapter to mount your drive in linux (easier than format/split the drive with terminal):
- Linux OS on your Computer with an Ethernet port (Or an adapter USB to Ethernet)
- Make sure no Drive name in your gnubee is "gnubee_root".
GnuBee will everytime boot from this drive first, we don't want that for a fresh new start
- 2 hours time or more!
Read before start:
I tried to write every step down, so most people should understand it and can make the gnubee running.
If in the installtion process while installing a gui, inferface "pop-up" will pop out, chose everytime "yes", "y", "ok" or hinting enter and let all things like it is). Passwort is allways "GnuBee" or "gnubee" or this this passwort you chose in the "xxx" sector (Point 15). You can save 1 hour time if you instead want to install Debian 8 with OMV3. Working the same, only the inferface is looking more ugly.
HowTo:
1. Connect your sata drive, that you want to use in the first slot for the os with your pc (with adapter mention above or internal socket if you use a tower pc) Use hard drive utilities (or gparted,) or another program to make 3 partions: sda1 formatted in ext4 min. 6GB (This is for your os), sda2 formatted in swap 4-8GB and sda3 ext4 all the rest GB of your drive for your data storage (If you want no data storage on this drive, what i recommend, use all space instead for sda1). Please Format all other drives you want to use with your gnubee to ext4 too with the adapter also. We only doing this because we don't want that gnubee is booting from on of this drives because there is the drive name "gnubee_root" on one of them)
2. Connect the first drive you want to use for the os to the first slot 1. Connect all other drives that you want to use to Slot 2-5.
3. Download this image for libreCMC OS prepared for debian install:
Rename the image to gnubee.bin and put it on your usb-stick fat32 formatted
4. Insert the stick on the front site of your gnubee (blue usb port) and push the on button (GB1: red button / GB2: Switch) (Only Power supply connected no SD card)
5. Wait until no led is blinking and the led on top is shining permanent. Disconnect your usb-stick and push the red button.
6. Insert your Ethernet cable (blue port) and connect it to your router. Connect an other cable in the black port and to your pc / notebook. Push the red button again to power up.
7. Wait until only the lower led is shining permanent. Type in your browser 192.168.10.1 and your in the luci libreCMC of your gnubee. (If your pc refuse the connection to system: Make sure there is no SD Card in your Gnubee and no drive connected with the name "gnubee-root")
9. After the reboot you can access ssh with terminal on your pc (Passwort is “gnubee”) with this code:
(if yu connected a device with the same ip before you must delete your fingerprint settings, console should show you how you can do this
10. Now type "fdisk -l" in the terminal. You will see your drives you created sda1 sda2 and if you made it sda3.
"fdisk -l"
Device Start End Sectors Size Type
/dev/sda1 8390656 234441614 226050959 6G Linux filesystem
/dev/sda2 2048 8390655 8388608 4G Linux swap
(/dev/sda3 8390656 234441614 226050959 110G Linux filesystem)
10. Then you should be able to run the installer succesfully:
Type this code:
sh debian-jessie-install
-> write in "/dev/sda1" and type "CONFIRM" wait until the progress is successfully completed.
Now you got Debian on your drive!
-> After install reboot with by typing this:
reboot
11. Go to the terminal of your router -> network devices and check for your new the gnubee device and the ip address of it (It is the device with gnubee hostname). Please write down your IP, you will need it later also.
Alternative / Optional:
Connect the USB-to-UART debug cable to the “headphone jack” of your gnubee and the pc if you use the orginal one. (You can also buy one that you can connect to the 3 Pins TXD RXD GND)
Than use this code in a new terminal window:
screen /dev/ttyUSB0 57600
Type this command to get your ip adress of the gnubee in the connected termnimal to gnubee:
ip addr
After that:
Remove the USB-to-UART debug cable
12. Connect to your gnubee with the ip that we wrote down from the last point with terminal:
(Now you are connecting not over blue port direct to your pc, you will connect over your router, you need a pc that is connected to your router / same network). Connect to your gnubee again (IP Adress is only my example):
->Passwort should be now "GnuBee"
13. Then finish the jessie installation (Could be you must use a new router, or a switch because your gnubee get no stable internet connection, of course the ip adress will change also if you change router)
then:
vim debian-modules-install
add "--no-check-certificate" after "wget"
Let all other things like it is
save with pressing "esc" -> and entering ":wq" -> after that press enter
then:
sh debian-modules-install
(or "bash debian-modules-install" also works)
then
reboot
!!!(Skip Point 14 and go to Step 31 if you want only the fast Debian 8 & OMV 3 installion (Not Debian 9 & OMV4)!!!
14. Upgrade to stretch (Debian 9)
Reconnect with ssh again with the new IP again (In my case "ssh
ro...@192.168.1.204") and type in:
vim /etc/apt/sources.list
Edit/Replace the old deb command to this new ones:
-> Hit ESC-> type “:wq”
Then upgrade the packages:
apt update
then:
apt full-upgrade
-> change in the installtion process "localhost" to "gnubee"
then:
apt autoremove
then:
reboot
15. Reconnect again to ssh with your Gnubee Ip. Install some preliminary packages and set up a non-root user (replace xxx below with your own username). Everything from here on should be done as this user unless explicitly stated otherwise. Rember the Passwort you must create in this section, you need it later.
apt-get install mdadm sudo
then:
adduser xxx
then:
adduser xxx users
then:
adduser xxx sudo
then:
su xxx
then:
cd ~
16. Install the tools needed and download the sources. This step also pins a particular version of OMV4 to avoid issues introduced since the creation of this guide. (PMV 4.0.18-1)
sudo apt-get install build-essential devscripts php-dev libpam-dev xsltproc dh-systemd git postfix quilt fakeroot unzip
then:
then:
cd openmediavault
then:
git checkout 6be37d09087957e86ee6f39dc4c30bb96f0a52cc
then:
cd deb/sources
then:
then:
cd ..
17. Build some support libraries
cd libjs-extjs6/
then:
debuild -b -uc -us
then:
cd ../php-pam/
then:
debuild -b -uc -us
then:
cd ..
18. Build OpenMediaVault
make install_build_tools
then:
make clean binary
then:
cd ..
then:
find . -name *.deb
19. Set up a local repository to install from and install OpenMediaVault
sudo mkdir /var/local/deb-repo
then:
sudo cp `find ./ -name *.deb` /var/local/deb-repo
then:
cd /var/local/deb-repo
then:
sudo bash -c 'dpkg-scanpackages . | gzip > Packages.gz'
then:
cd -
20. Add created local repo to Source List:
sudo vim /etc/apt/sources.list
-> Add "deb file:/var/local/deb-repo/ ./" and save it like before: press esc -> then “:wq” and enter)
21. Install Open Media Vault 4:
sudo apt-get update
then:
sudo apt-get install openmediavault
22. Start OpenMediaVault
sudo omv-initsystem
(If you skipped steps before for OMV3, start here after you completed Point 31)
23. Point your web browser to the GnuBee (Type in the ip adress you wrote down) and you should log in to OpenMediaVault with the username "admin" and password "openmediavault".
(You can also write in the open terminal if you don't find the letter ;) : "sudo ifconfig|grep 192"
24. !!!DO NOT REBOOT OR SHUTDOWN!!! This is a real important part in this guide. If you do it wrong, you can start from beginning!
Type in the terminal:
cat /etc/network/interfaces
What you will see is like this:
auto lo
iface lo inet loopback
auto eth0.1
iface eth0.1 inet static
address 192.168.1.1
netmask 255.255.255.0
auto eth0.2
iface eth0.2 inet dhcp
-> This is totally stupid because the auto static adress is 192.168.1.1. Normally with an SoC Systemfor example armbian os with the omv script in armbian-confg the settings will be made automatically right for you. 192.168.1.1 is most of the time the adress of your router. So with this settings your gnubee wont work and you can't connect it again. Your settings should look like this, we change it in the next point:
auto lo
iface lo inet loopback
iface lo inet6 loopback
# eth0.2 network interface
auto eth0.2
allow-hotplug eth0.2
iface eth0.2 inet dhcp
iface eth0.2 inet6 auto
privext 2
pre-up echo 1 > /proc/sys/net/ipv6/conf/$IFACE/autoconf
pre-up echo 1 > /proc/sys/net/ipv6/conf/$IFACE/accept_ra
pre-up echo 0 > /proc/sys/net/ipv6/conf/$IFACE/disable_ipv6
# eth0.1 network interface
auto eth0.1
allow-hotplug eth0.1
iface eth0.1 inet static
address 192.168.1.203
gateway 192.168.1.1
netmask 255.255.255.0
dns-nameservers 192.168.1.1
iface eth0.1 inet6 manual
pre-down ip -6 addr flush dev $IFACE
25. -> Change IP Settings in Open Media Vault!
The Gnubee 1 got 2 Lan Ports: eth0.1 (blue port) and eth0.2 (black port).
The Gnubee 2 got 3 Lan Ports: eth0.1 (blue port), eth0.2 (black port) and eth0.3.
You can use this port like you want, but i recommend this settings:
1. One Port should be static, so you can use the ip adress from before forever (The port you chose for static will be the port you can connect your gnubee with your router for your home network)
2.One Port should be DHCP Auto so in theory you should get with it internet and can connect it to other devices with other ips, also direct to a pc)
The Static adress:
-> So in OpenMediaVault in your Browser go to "network->inferfaces".
Click add and chose the port you want to use for static, the connection port you want to go to your router
(not eth0.0, eth0).
In my case i used eth0.1.
Write this settings in:
IP4 Method -> Static
Adress -> The Ip Adress from before (that you wrote down)
netmask -> 255.255.255.0
gateway -> The Ip of your router (You can find it also in the router inferface)
IP6 Method -> Disabled
DNS-Server -> Again IP Adress of your Router
Set MU to 0
-> Safe settings!
DHCP Adress:
Click add and chose the port you didn't used before for DHCP, the connection you want to use for other connection stuff (not eth0.0, eth0 or the used port before).
In my case i used eth0.2.
Write this settings in:
IP4 Method -> DHCP
IP6 Method -> Auto
Set MU to 0
-> Safe too and apply all settings with the button in the big yellow field!
26: In your router set this ip adress with gnubees mac adresse (you can find it also in your router under ip4 devices) as static too. In dns settings of your router you can do this! And set leasetime to "infinite" Also write down the Ip Adress you set for gnubee and the mac adress down on a paper. I mean save it! It is the access ticket to your OMV Device!
27. Reboot and be happy! Congratulations. Now you can shutdown or reboot your gnubee and it will allways go to this adress you was choosing before. After changing the IP adress in OMV it is possible that after you again open your gnubee website that you want to apply the settings again because of the yellow field. If you get an error after applying. Click on refuse and check if network settings are still the same. After this there should be no more error.
-> You can change this ip adress to an adress you like anytime! Only make sure that you change the ip adress for the gnubee under your static adresses in your router too after changing it in omv!
28. Now it is time to set up your gnubee. Change settings, set up Raid, make folders, create user, share folders with users. I won't explain this here, you can find a lot of tutorial in the web and it is allways the same :) Only keep in mind that sda1 is your OS and sda2 is your swap! Let it like it is!
29. Optional: Upgrading OpenMediaVault
New versions of OpenMediaVault come out all the time. To upgrade to the latest do the following steps. But it is not nessarsay so "Never update a perfect running system):
cd openmediavault/
then:
git pull
then:
cd deb/
then:
make clean binary
then:
cd ..
then:
sudo cp `find ./ -name *.deb` /var/local/deb-repo
then:
cd /var/local/deb-repo
then:
sudo bash -c 'dpkg-scanpackages . | gzip > Packages.gz'
then:
sudo apt-get update
then:
sudo apt-get upgrade
30. Optional (I Dont care): You can set language of debian in ssh also change hostname if you want in ssh (pr hostname in omv interface). Duckduckgo.com for tutorials :D
--------------------------------
31. Alternative fast OMV Install: Debian 8 with OMV3
Install OpenMediaVault:
Again in ssh use this 3 lines
then:
chmod +x omv-jessie-install
then:
./omv-jessie-install
-> Continue with Point 23