This is an old revision of the document!


OpenMediaVault (OMV)

At the time being, this page is merely a cook book regarding setting up an OMV (2.1) server, it hopefully will get more structured as time goes by…

Download the latest (2.1 as of 20151105) .iso image of OMV from the OpenMediaVault Sourceforge's page.

“Burn” it to a USB key.

Boot the target machine with the created USB key.
NOTE: Make sure the target media for installation (HD, SSD, USB Key) is recognized by the system as /dev/sda, one might need to “play” with the BIOS boot options and/or physical plug order to achieve this. This is because the OMV installer won't let you choose a different target than /dev/sda to install the grub loader.
You can check and identify the available media using the “advanced options > Hardware Detection Tool (HDT)” option prior to launching the effective system install.

Follow the various installation steps.

At the final reboot, remove USB Keys and make an .iso copy of the newly created OMV system. Identify the device using lsblk then dd to iso file:

> lsblk
...
sdb             8:16   1   7.2G  0 disk 
├─sdb1          8:17   1   6.9G  0 part 
├─sdb2          8:18   1     1K  0 part 
└─sdb5          8:21   1   351M  0 part 
...

> sudo dd if=/dev/sdb of=/path/to/omv-base.iso

Once the machine has rebooted using the newly created OMV system, log in to the system and check the DHCP allocated address of the system using ip addr show.

Then login using the WebGUI with credentials admin:openmediavault.

Fixed IP

NOTE: for a “production” system it might be time to set a fixed IP to a NIC.

SSH server

First thing we'll do is go to the “Services > SSH” panel and activate the SSH service.

Session timeout & Admin password

In “System > General Settings” set Session timeout to your preference (20 here)

Next we'll change the admin password in “System > General Settings > Web Administrator Password”.

Date & Time

Activate NTP server in “System > Date & Time” (be.pool.ntp.org)

System update

One can use the WebGUI “System > Update Manager”, but we'll prefer loging in via ssh and using apt-get update then apt-get upgrade, so we get a better view of the process advancement and possibly of errors…

Additional packages

We'll install a couple of useful CLI packages:

> apt-get install htop ranger tmux

System Backup

As we'll start to “experiment” with potentially system breaking plugins, let's create a new iso copy we could revert to in case of major problem (see dd command above).

OMV-Extras (2.2)

The first plugin we need to install is the OMV-extras plugin, as it will open us the access to all the fancy plugins we long for. Once again we'll choose the CLI installation to have a better view of the process:

> wget http://omv-extras.org/openmediavault-omvextrasorg_latest_all.deb
> dpkg -i openmediavault-omvextrasorg_latest_all.deb
...
dpkg: dependency problems prevent configuration of openmediavault-omvextrasorg:
 openmediavault-omvextrasorg depends on apt-transport-https; however:
  Package apt-transport-https is not installed.
...

Let's try to fix this by installing the apt-transport-https package:

> apt-get install apt-transport-https
...
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 apt-transport-https : Depends: libcurl3-gnutls (>= 7.16.2) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Trying to fix things further:

> apt-get -f install

Seems to do the trick… Reload OMV WebGUI, the “System > OMV-Extras.org” icon is present, let's go to this panel and activate the following:

  • OMV-Extras.org
  • Download Managers
  • ZFS
  • Plex

Save > Apply (takes a while !)

Now to “System > Plugins” panel ⇒ we have a lot more plugins available.

Flash Memory (1.9)

As we're using a USB key for the system root, we'll try Flash Memory, an implementation of fs2ram…
Select it in the plugins list and “+ Install”.

Go to “Storage > Flash Memory”, read the Note.

> cp /etc/fstab /etc/fstab.bak
> nano /etc/fstab

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda1 during installation
# Added  noatime,nodiratime for fs2ram
UUID=ce637d63-64eb-4101-a244-b9b3b3ab556b /               ext4     noatime,nodiratime,errors=remount-ro 0       1

# swap was on /dev/sda5 during installation
# commented out for fs2ram
# UUID=5d2353f0-9a25-439d-affb-074096ff301c none            swap    sw              0       0

CTRL-x y

Enable button in WebGUI (Save - Apply)

> reboot

ZFS (0.6.4)

Now let's try to install the ZFS plugin.
“System > Plugins”, check openmediavault-zfs 0.6.4 ⇒ “+ Install”. (takes a lot of time)

Problem occur:

...
update-rc.d: using dependency based boot sequencing
insserv: There is a loop between service umountfs and zfs-import if stopped
insserv:  loop involving service zfs-import at depth 5
insserv:  loop involving service zvol at depth 4
insserv: There is a loop between service umountfs and zfs-import if stopped
insserv:  loop involving service umountfs at depth 4
insserv:  loop involving service networking at depth 3
insserv:  loop involving service umountroot at depth 6
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header
dpkg: error processing openmediavault-zfs (--configure):
...

Read this thread. It is advised to:

  • Install only zfs related packages (not the plugin)
  • Fix the problems (errors) as described above by @subzero79
  • Install the latest omv-extras plugin
  • Do an “Apt Clean” in omv-extras when the ZFS testing repo is selected
  • Install the latest version of the plugin (0.6.4.2)

OUR PROCESS

In OMV GUI:

  • Update Manager > Apply all updates
  • Update Manager > Upgrade OMV 2.7
  • OMV-Extras.org > Activate ZFS repository > Save > Apply (Took a couple of minutes !?)
  • Update Manager > 8 ZFS related updates:
    • grub-common 2.02-beta2.9-ZOL11-7aa9f6-wheezy
    • grub-pc 2.02-beta2.9-ZOL11-7aa9f6-wheezy
    • grub-pc-bin 2.02-beta2.9-ZOL11-7aa9f6-wheezy
    • grub2-common 2.02-beta2.9-ZOL11-7aa9f6-wheezy
    • libnvpair1 0.6.5.2-2-wheezy
    • libuutil1 0.6.5.2-2-wheezy
    • libzfs2 0.6.5.2-2-wheezy
    • libzpool2 0.6.5.2-2-wheezy
    • CHECK ALL > Upgrade

From the CLI, install ZOL:

> apt-get install lsb-release
> wget http://archive.zfsonlinux.org/debian/pool/main/z/zfsonlinux/zfsonlinux_6_all.deb
> dpkg -i zfsonlinux_6_all.deb
> apt-get update (took ages !? -> duplicate sources lists: omv-extras-org-stoneburner.list && zfsonlinux.list)
> apt-get install debian-zfs

Back to OMV GUI:

  • OMV-Extras.org > Apt Clean
    • Check for new updates (Update Manager)
  • Install the zfs plugin via the Plugin page of OMV

The ZFS icon should appear in the Storage section of the OMV menu.

Pool Setup

First set power management features on each physical disk in Storage > Physical Disks.

  • 1 - Minimum power usage with standby (spindown)
  • Disabled
  • 20 minutes

Wipe all disks.

Storage > S.M.A.R.T.:

  • Interval 3600
  • Standby
Devices: Monitor all pool disks

Storage > ZFS

To determine the physical block size of HDs:

> hdparm -I /dev/sda | grep -i physical

Add pool:

  • Name: Storage
  • Type: RAID-Z1
  • Devices: sda + sdb + sdc + sdd
  • Mountpoint:
  • Device alias: By Id
  • Set Ashift: 12

To activate compression:

> zfs set compression=on Storage

available: on | off | lzjb | gzip | gzip-[1-9] | zle | lz4

To check compression perfs:

> zfs get compressratio Storage

DuckDNS

http://www.duckdns.org

> apt-get install curl
> mkdir duckdns
> cd duckdns
> nano duck.sh

echo url="https://www.duckdns.org/update?domains=basecamp-w49&token=92e01e3a-7b3c-40b7-9210-e76e9daec03b&ip=" | curl -k -o ~/duckdns/duck.log -K -

> chmod 700 duck.sh
> crontab -e
> */5 * * * * ~/duckdns/duck.sh >/dev/null 2>&1

Ctrl-x y

Test the script:

> ./duck.sh
> cat duck.log

System > OMV-Extras.org > Activate repos: Download Managers + Plex
Save - Apply

SABnzbd (1.0.5)

System > Plugins > Section Downloaders > openmediavault-sabnzbd 1.0.5 > Install

Services > SABnzb:

Failed to execute command 'omv-mkconf sabnzbd getsettings': /etc/openmediavault/config.xml:1.1: Document is empty ^ /etc/openmediavault/config.xml:1.1: Start tag expected, '<' not found ^

Storage > ZFS
Add Object:

  • Type: Filesystem
  • Prefix: Storage
  • Name: OMV
  • Mountpoint:

Add Object:

  • Type: Filesystem
  • Prefix: Storage
  • Name: Entertainment
  • Mountpoint:

SABnzbd panel:

  • Enabled
  • Backup User Settings
    • Volume: Storage/OMV

Create SABnzbd download directories:

> mkdir -p /Storage/Entertainment/SABnzbd/Downloads
> chmod -r go+rw /Storage/Entertainment/SABnzbd/

Save + Apply
SABnzbd Web Interface > (English) Start Wizard:

  • primary usenet provider:
    • Host: ssl-eu.astraweb.com
    • Port: 443
    • Username: bitbox
    • Password: H——5
    • Connections: (20)
    • SSL: checked
  • Access:
    • viewable by any pc on my network
    • Password: admin:R—-d
    • Enable HTTPS
  • Indexer: EMPTY

https://192.168.1.34:9090/

Config:

In switches -> check Replace Spaces in Foldername
direct&200|direct&200|direct&200|direct&200|

SickBeard (1.0.10)

System > Plugins > openmediavault-sickbeard 1.0.10 (check) + Install
Services > Sick Beard > Repo: midgetspy/Sick-Beard.git / Branch: master + Enable

Sick Beard Web GUI:

Config:

direct&200|direct&200|direct&200|direct&200|
> mkdir -p /Storage/Entertainment/mediatheque/tv
> mkdir -p /Storage/Entertainment/mediatheque/movies
> chmod -R 777 /Storage/Entertainment/mediatheque

Use /Storage/Entertainment/mediatheque/tv as parent directory for new shows.

Plex Media Server (1.0.12)

System > Plugins > openmediavault-plexmediaserver 1.0.12 > check + Install

Settings:

  • Database Volume: Storage/Entertainment
  • Enable

Couch Potato

System > Plugins > openmediavault-couchpotato 1.0.3 > check + Install

Repo / Branch / Enable

> mkdir -p /Storage/Entertainment/CouchPotato
> chmod -R 777 /Storage/Entertainment/CouchPotato

We aim at deploying an OpenLDAP server to manage authentication mechanism. As our base system is already OMV, we'll install VirtualBox and create an OpenLDAP virtual appliance.

VirtualBox (1.3)

System > OMV-Extras.org > Virtualbox (activate repository > Save > Apply)
System > Plugin > openmediavault-virtualbox 1.3 (check + Install)

This will install virtualbox-4.3 (4.3.28-100309~Debian~wheezy_amd64)

Services > VirtualBox

Directory: VM-Storage [on Storage/OMV, VirtualBox/VMs]

Access the PhpVirtualBox at http://192.168.1.34/virtualbox/

VMs

We need a place to store the .iso files we'll use for various VMs:

> mkdir -p /Storage/OMV/VirtualBox/ISOs
> chmod -R 777 /Storage/OMV/VirtualBox/ISOs

Debian Template.

We'll base this on the wiki page describing the base Debian template setup, but using a Debian 7.9 (wheezy) install for compatibility with the OMV base kernel. The following will only cover what differs from the reference Debian template setup.

The Debian Wheezy installation page currently refers the following link to its "netinst.iso" image that we'll use for our template VM.

So we ssh to our OMV system and:

> cd /Storage/OMV/VirtualBox/ISOs
> wget http://cdimage.debian.org/cdimage/archive/7.9.0/amd64/iso-cd/debian-7.9.0-amd64-netinst.iso

Now to the http://192.168.1.34/virtualbox/:

  • File > Preferences > Network > NAT Networks
  • Add NAT Network (1st right icon)
  • Select NatNetwork1 > Edit (3rd right icon)
  • Check: Enable
    • Name: N54L-VB-NAT
    • CIDR: 10.10.2.0/24
    • Support DHCP
  • Host-only Networks
  • Add host-only network (1st right icon)
  • Select vboxnet0 > Edit (3rd right icon)
    • Adapter
      • IPv4 Address: 172.30.30.1
      • IPv4 Network Mask: 255.255.255.0
    • DHCP Server
      • Disabled

New VM

  • Name: Debian-7.9-Wheezy
  • Type: Linux
  • Version: Debian (64 bit)
  • 512MB
  • Create virtual HD:
    • VDI
    • Dynamic
    • 8GB
    • Location: /Storage/OMV/VirtualBox/VMs/Debian-7.9-Wheezy

CONFIGURE NETWORKS (2 adapters NAT + vboxnet0)
ATTACH DEBIAN NETINST ISO
PROCEED TO DEBIAN INSTALLATION…

In case one needs to modify phpvirualbox configs, edit: /usr/share/phpvirtualbox/config.php
AT LEAST set $username and $password

Set VB static IP (vboxnet0)

To allow access from our OMV host to our VMs, we'll set a static IP for our template; THIS WILL HAVE TO BE UPDATED FOR EACH CLONE.

> 

Register our OMV rsa key

Once the template is running, from the OMV system (the ~/.ssh/id_rsa.pub file should already exist):

> ssh-copy-id root@new.vm.ip