Posts by macnb

    You can use Clonezilla Live USB. Boot that USB and select your 600GB drive as source and 24GB SSD as target and it should clone your larger drive and produce a bootable SSD.


    You could partition the 600GB first but it's not necessary.
    Edit: Use Gparted first to resize the main partition down to, say, 20GB then use Clonezilla with option -r -icds


    I had this exact same issue on my HP N40L microserver after I upgraded the boot HDD to an SSD (240GB).
    I then partitioned the SDD (using gparted) and shrunk the boot partition to 20GB and created a data partition for the rest (minus a small Swap partition). So now I have 5 data HDD's plus one data partition on teh boot SSD.
    On boot I now have 36 "mdadm: no arrays found in config file or automatically" messages taking around 40 secs and eventually boots.
    The system is fine but those annoying messages delays the boot.
    Lot of googling resulted in no good reason as to WHY.


    In the end I "solved" (or got rid of those warnings) with the suggestion here.
    Edited /etc/mdadm/mdadm.conf and added:


    Code
    ARRAY <ignore> devices=/dev/sda
    ARRAY <ignore> devices=/dev/sdb
    ARRAY <ignore> devices=/dev/sdc
    ARRAY <ignore> devices=/dev/sdd
    ARRAY <ignore> devices=/dev/sde
    ARRAY <ignore> devices=/dev/sdf


    That is, one line of EACH drive.
    and the, ran update-initramfs -u command


    Now, after BIOS post, OMV boots in 30 secs.




    (BTW,Adding just one line for/dev/sda did nothing.)

    @macnb,


    Is this tune settings improve the speed for Windows clients as well ?

    I can't even remember how I did those measurements but it was not on Windows but Mac OS (El Capitan).
    I don't use Windows.
    Also that test would have been on OMX 2.x


    I'm now on OMV 4.x and did a quick test using Blackmagic Disk Test (yes it can test networked drives).
    Default SMB/CIFS gives me 67MB/s Read & 81MB/s Write speeds


    My AFP connection to the same sharedfolder gives me 69MB/s read & 89MB/s write speeds.


    All on a gigabit LAN cable.


    In that respect, SMB has improved since OMV 2.x (still not as good as AFP but's marginal now).

    Docker popup windows can be resized and dragged around. If you drag it up beyond visible space into browser header you cannot drag it back down because the drag bar is not visible. How do you fix this?

    Clear browser cache/data

    PART 3: Adding FileRun Docker Cloud Service to existing MariaDB Docker Container



    As follow up to the previous guide on how to install Nextcloud Service with MariaDB Docker database, in Part 3 we extend the
    use of the MariaDB Container created in Part 1 for use with another cloud server service - namely FileRun.
    FileRun is a competitor to Nextcloud and install in almost the same manner.


    What you will need (pre-requisites):


    - Access to OMV SSH Shell (using your favourite method - Terminal, Putty, Shellinabox, etc)
    - Docker custom network already running (one simple terminal command)
    - MariaDB Container already setup and running


    Summary of steps


    Step 1. Prepare Docker environment setup for FileRun Docker Container
    Step 2. Create FileRun MySQL User and Database in the existing MariaDB Container
    Step 3. Install FIleRun Docker
    Step 4. Setup FIleRun service


    STEP 1


    First create folders which the Filerun Container will access on your OMV file system.
    FIlerun Container requires TWO folders on the Host OS (e.g. in /sharedfolders) :
    one for the config files and second one to store your actual Cloud data.


    Login into terminal and enter the following command:


    mkdir /sharedfolders/docker/filerun
    mkdir /sharedfolders/docker/filerun/html
    mkdir /sharedfolders/docker/filerun/my-data
    exit


    The /sharedfolders/docker/filerun will map to /var/www/html within the Filerun container.
    The /sharedfolders/docker/filerun/my-data will map to /user-files within the Filerun container.


    Effectively, my-data folder will be your Cloud folder that will be presented in the Filerun web-gui.


    STEP 2


    Create Filerun MySQL User and Database within the existing MariaDB Container.


    Filerun Container expects that the MySQL database to be pre-prepared before it is run so we have to manually set it up.
    This is easy since we already have a running MariaDB Container (from Part 1).


    First Shell into the MariaDB Container


    docker exec -it mariadb bash


    Now enter the MariaDB Server (and enter the password when prompted):


    mysql -u root -p


    Next, create a User ID ('filerun') & password ('filerun') for the Filerun database ('filerun') and the database itself:


    create user 'filerun' identified by 'filerun';
    create database if not exists filerun;
    grant all privileges on filerun.* to 'filerun' identified by 'filerun';
    flush privileges;
    quit


    STEP 3


    With the Host folders setup and the Filerun database & User setup, we can now configure the Filerun Container and run it.


    On the OMV GUI, click the Docker icon in the Services menu.
    In the search box enter afian/filerun and once found, select it.
    In the pop-up box, click Start and once completed, click Close.


    Screenshot 2019-03-25 at 19.49.57.png
    At this stage we have downloaded a Docker Image for Filerun.


    Next, Instantiate the Filerun Container (to start the Service), select this docker image and click on Run Image button.
    The Container configuration screen will pop-up.


    Enter a name in the Container name box (I called mine filerun).
    Select 'Always' for the Restart Policy (restarts the Container on reboot).


    Screenshot 2019-03-24 at 23.01.40.png


    In the Networking section set the Networking mode to Bridge (should be default)


    In the Port Forwarding section, need to setup the Host IP addresses:


    Host IP = 0.0.0.0 (should be default already)
    Host Port = 8087 (this will route any access on OMV's IP address on port 8087 to Filerun's web server on port 80)
    Exposed Port = 80/tcp (Filerun's port 80)
    Click "+" to save the entry (do not forget to do this)


    Note: For the Host Port address, choose a number that is not already used by another service on your system.


    In the Environment variables section, we need to change some of the pre-defined variables:


    FR_DB_HOST = mariadb
    APACHE_RUN_USER = www-data
    APACHE_RUN_USER_ID = 33
    APACHE_RUN_GROUP = www-data
    APACHE_RUN_GROUP_ID = 33

    Screenshot 2019-03-24 at 23.06.40.png


    Remember to click tick for each edit.


    Under Volumes and Bind mounts section, enter the path of the Host Path of the folders created in Step 1:


    Host Path = /sharedfolders/docker/filerun
    Container Path = /var/www/html
    Click "+" button to add the path


    Host Path = /sharedfolders/docker/filerun/my-data
    Container Path = /user-files
    Click "+" button to add the path
    Screenshot 2019-03-24 at 23.22.54.png


    In the Extra arguments section, enter the name of the Docker Network that was created in [b]Part 1:


    --network my-docker-net
    Screenshot 2019-03-24 at 23.08.01.png


    This is the docker network name on which the MariaDB Container is also running.


    Finally, click Save to actually start the Filerun Container which will configure itself using the configuration data &
    environment variables you provided above. This will take a while so wait for several minutes so be patient.



    STEP 4


    In your browser enter http: //your-OMV-IP-ADDRESS:8087


    You will see the Filerun Home page with login prompt
    Screenshot 2019-03-24 at 23.34.55.png
    The default Username = superuser
    The default Password = superuser


    Login and you will be asked to change the password.


    As it stands, the Filerun service is secure on your on internal network but not for the public internet.
    For that you need to add and encryption service and a reverse proxy. See Letsencrypt Docker.


    NOTE: After the Filerun Container starts, it will change the ownership of the Host Folder. E.g.:


    Code
    root@OMV-Revo:~# ls -l /sharedfolders/docker/filerun
    total 12
    drwxrwsr-x 18 www-data www-data 4096 Mar 23 23:33 html
    drwxr-sr-x 7 www-data www-data 4096 Mar 24 17:45 my-data
    root@OMV-Revo:~#

    problem still same

    Your log shows that mariadb had error writing to /config (which is it's internal folder) that is mapped to your host folder on OMV.


    If you have created a User on OMV (e.g. maxspeed), then in terminal, login as that user then create the nextcloud folder.
    If you started the terminal as Root, then within the root terminal login as your user id, e.g.:


    login maxspeed
    mkdir /sharedfolders/docker
    mkdir /sharedfolders/docker/nextcloud
    mkdir /sharedfolders/docker/nextcloud/my-data
    mkdir /sharedfolders/docker/nextclouddb
    exit


    /sharedfolders/docker/nextcloud/my-data folder will map to /data folder in the Nextcloud container.
    /sharedfolders/docker/nextcloud will map to /config folder in the Nextcloud container.
    /sharedfolders/docker/nextclouddb will map to /config folder in the MariaDB container.


    You use the above paths in the MariaDB Run Image and Nextcloud Run Image pop-up configuration boxes.



    See this guide I wrote here. Even though it discusses migrating mysql to MariaDB docker, it also shows how to setup Nextcloud.
    Just ignore Step1 and step 2 in that guide.

    PART 2


    As follow up to the previous guide on how to migrate MySQL server to MariaDB Docker, in Part 2 we extend the
    use of the MariaDB Container created in Part 1 for use with another service - namely Nextcloud - your personal Cloud server.


    What you will need (pre-requisites):


    - Access to OMV SSH Shell (using your favourite method - Terminal, Putty, Shellinabox, etc).
    - MariaDB Container already setup and running


    Summary of steps


    Step 1. Prepare Docker environment setup for Nextcloud Container
    Step 2. Create Nextcloud MySQL User and Database in the existing MariaDB Container
    Step 3. Install Nextcloud Docker
    Step 4. Setup Nextcloud service



    STEP 1


    First create folders which the Nextcloud Container will access on your OMV file system.
    Nextcloud Container requires TWO folders on the Host OS (e.g. in /sharedfolders) :
    one for the config files and second one to store your actual Cloud data.


    Go to terminal and enter the following command:


    Code
    mkdir /sharedfolders/docker/nextcloud
    mkdir /sharedfolders/docker/nextcloud/my-data


    The /sharedfolders/docker/nextcloud will map to /config within the Nextcloud container.
    The /sharedfolders/docker/nextcloud/my-data will map to /data within the Nextcloud container.


    Effectively, my-data folder will be your Cloud folder that will be presented in the Nextcloud web-gui.



    STEP 2


    Create Nextcloud MySQL User and Database within the existing MariaDB Container.


    Nextcloud Container expects that the MySQL database to be pre-prepared before it is run so we have to manually set it up.
    This is easy since we already have a running MariaDB Container (from Part 1).


    First Shell into the MariaDB Container

    Code
    docker exec -it mariadb bash

    Now enter the MariaDB Server (and enter the password when prompted):


    Code
    mysql -u root -p

    Next, create a User ID ('nextcloud') & password ('nextc-pwd') for the Nextcloud database ('nextcloud') and the database itself:


    Code
    create user 'nextcloud' identified by 'nextc-pwd';
    create database if not exists nextcloud;
    grant all privileges on nextcloud.* to 'nextcloud' identified by 'nextc-pwd';
    flush privileges;
    quit


    Make a note of the database info since these will be needed later when setting up Nextcloud GUI later:


    Nextcloud database User ID = nextcloud
    Nextcloud database User ID Password = nextc-pwd
    Nextcloud database name = nextcloud


    Exit the MariaDB Container shell by entering exit.



    STEP 3


    With the Host folders setup and the Nextcloud database & User setup, we can now configure the Nextcloud Container and run it.


    On the OMV GUI, click the Docker icon in the Services menu.
    In the search box enter linuxserver/nextcloud and once found, select it.
    In the pop-up box, click Start and once completed, click Close.


    Screenshot 2019-03-23 at 10.21.23.png


    At this stage we have downloaded a Docker Image for Nextcloud.


    Next, Instantiate the Nextcloud Container (to start the Service), select this docker image and click on Run Image button.


    The Container configuration screen will pop-up.


    Enter a name in the Container name box (I called mine nextcloud).
    Select 'Always' for the Restart Policy (restarts the Container on reboot).


    Screenshot 2019-03-23 at 12.18.14.png


    In the Networking section set the Networking mode to Bridge (should be default)


    In the Port Forwarding section, need to setup TWO Host IP addresses:


    Host IP = 0.0.0.0 (should be default already)
    Host Port = 8080 (this will route any access on OMV's IP address on port 8080 to Nextcloud's web server on port 80)
    Exposed Port = 80/tcp (Nextcloud's port 80)
    Click "+" to save the entry (do not forget to do this)


    Host IP = 0.0.0.0 (should be default already)
    Host Port = 444 (this will route any access on OMV's IP address on port 444 to Nextcloud's web server on port 443)
    Exposed Port = 443/tcp (Nextcloud's port 443)
    Click "+" to save the entry (do not forget to do this)


    In the Environment variables section, there's nothing to add but adding PUID & PGID is recommended as it will allow your OMV User ID to access the Nextcloud Host folder remotely (via SMB, AFP, etc). Also add the TimeZone


    PUID = 1000 (this is the User uid)
    PGID = 100 (this is the Group gid)
    TZ = Europe/London (or whatever your continent/city)


    Under Volumes and Bind mounts section, enter the path of the Host Path of the folders created in Step 3.1:


    Host Path = /sharedfolders/docker/nextcloud
    Container Path = /config
    Click "+" button to add the path


    Host Path = /sharedfolders/docker/nextcloud/my-data
    Container Path = /data
    Click "+" button to add the path

    In the Extra arguments section, enter the name of the Docker Network that was created in Part 1:

    --network my-docker-net


    This is the docker network name on which the MariaDB Container is also running.


    Screenshot 2019-03-24 at 17.13.59.png


    Finally, click Save to actually start the Nextcloud Container which will configure itself using the configuration data &
    environment variables you provided above. This will take a while so wait for several minutes so be patient.



    STEP 4


    In your browser enter https: //your-OMV-IP-ADDRESS:444


    You will receive a warning since SSL certificates are not setup but it's OK to proceed to the Nextcloud site.
    (On Chrome browser, click Advance and allow it to proceed to the site). E.g.:
    Screenshot 2019-03-23 at 12.48.39.png
    Once the Nextcloud Home page appears, it will ask you create an Admin account (name & password), enter the
    Nextcloud database name, database User ID, database password and the hostname of database server.


    Screenshot 2019-03-23 at 12.53.17.png


    For the Admin account name & password, enter whatever you wish but REMEMBER the Admin password !
    For database configuration, enter the following information (from STEP 2):


    Database User = nextcloud
    Database password = nextc-pwd
    Database name = nextcloud
    localhost = mariadb


    BTW, for the localhost we can use mariadb because the Nextcloud Container is on the SAME network (my-docker-net) as the MariaDB Container.
    There’s no need worry about or hardcode IP Addresses since Docker’s network DNS takes care Name-to-IP translation.


    Next, click the Finish Setup button.


    It will take a while to complete this setup and you will be presented with the login screen where you enter the Admin user name and password.


    Note: You may see an NGIX error page instead of the login screen.
    In this case, wait a few minutes and refresh the browser screen and should then see the Login Screen.


    Login and manage your documents.


    To put your Nextcloud server onto the public internet, you will need a static IP address from your Service Provider and then Install an Encryption service such as Letsencrypt. Of course there's a Docker Image for that too.


    See excellent video's by @TechnoDadLife which show you how to do that.


    Extras:


    Useful MySQL commands:

    Code
    show databases;
    SELECT User FROM mysql.user;
    select User, Host from mysql.user;
    desc mysql.user;
    SHOW GRANTS FOR 'root'@'%';use mysql;
    SELECT host, user, password FROM user WHERE user = 'root';
    SELECT host, user, password FROM user WHERE host = '%';
    Show variables where variable_name like "bind%";
    drop user a_user_id;
    drop database my_database;


    Docker commands:

    Code
    docker exec -it container_name bash
    docker restart container_name
    docker network ls
    docker inspect network your_network_name

    STEP 4



    This step assumes you have already installed the OMV Docker Plugin.
    Now we are ready to install MariaDB Docker.


    On the OMV GUI, click the Docker icon in the Services menu.


    In the search box enter linuxserver/mariadb Docker Image and once found, select it.


    In the pop-up box, click Start to download the Docker Image and once completed, click Close.
    Screenshot 2019-03-23 at 14.51.14.png


    At this stage we have downloaded a Docker Image for MariaDB.


    Now to Instantiate a Container (to start the Service), select this docker image and click on Run Image button.
    The Container configuration screen will pop-up.


    Enter a name in the Container name box (I called mine mariadb).
    Make a note of this name as you will need it in the future for other Containers to connect to MariaDB.


    Select 'Always' for the Restart Policy (restarts the Container on reboot).
    In the Networking section set the Networking mode to Bridge (should be default)



    Screenshot 2019-03-23 at 16.02.18.png



    In the Port Forwarding section, set:
    Host IP = 0.0.0.0 (should be default already)
    Host Port = 3306 (this will route any access on OMV's IP address on port 3306 to MariaDB's port 3306)
    Exposed Port = 3306/tcp (MariaDB's port 3306)
    Click "+" for each entry (do not forget to do this)


    In the Environment variables section, add the following variables (remember to you click "+" button for each)


    MYSQL_ROOT_PASSWORD = mypassword (or whatever you wish)
    PUID = 1000 (this is the User uid)
    PGID = 100 (this is the Group gid)
    TZ = Europe/London (or whatever your continent/city)


    Under Volumes and Bind mounts section, enter the path of the Host Path of the folders created in Step 3.1:


    Host Path = /sharedfolders/docker/mariadb
    Container Path = /config
    remember to click "+" button to add the entry.


    In the Extra arguments section, enter the name of the Docker Network that you created in Step 3.2:

    --network my-docker-net

    Screenshot 2019-03-23 at 15.22.32.png



    Finally, click Save to actually start the MariaDB Container which will configure itself using the configuration
    data & environment variables you provided above.


    Note: you need to have created your User ID previously and can retrieve it from terminal e.g.:


    Code
    root@OMV:~# id macnb
    uid=1000(macnb) gid=100(users) groups=100(users)
    root@OMV:~#


    STEP 5



    The MariaDB Container should have configured itself and running as a Daemon within the Container.


    Let's check it via the terminal by shelling into the MariaDB Container itself.


    This is done via a Docker command:

    Code
    docker exec -it mariadb bash

    where mariadb is the name of the MariaDB Container configured in Step 4.


    You will be presented with a new shell prompt from the MariaDB Container itself.


    Now enter the following command (and mypassword for the password when prompted):

    Code
    mysql -u root -p

    You will see the following:


    Enter quit to exit mysql interactive session.


    You will now be back at the MariaDB Container's Shell prompt.


    If you had backed up your exiting Kodi (and other databases) in Step 1 then, import those
    databases back into MariaDB using following command (enter your root password when prompted):

    Code
    gunzip < alldb.sql.gz | mysql -u root -p

    This may take a while depending on the size of your databases.
    All your databases (including Users' ID's and their passwords) will have been imported.


    Note the following step is ONLY necessary If you do not have a Kodi database and this is the first time you are setting up Kodi database on MySQL
    then run the following commands (to create a Kodi User):

    Code
    mysql -u root -p

    At the MariaDB prompt enter the following commands:


    Code
    CREATE USER 'kodi' IDENTIFIED BY 'kodi';
    GRANT ALL ON *.* TO 'kodi';
    flush privileges;
    quit


    Then see this link to configure your Kodi media player to use MariaDB MySQL server.


    Enter exit to exit MariaDB Container bash shell.



    STEP 6


    There are several ways to test your new MariaDB Container.


    1. The obvious is to start your Kodi media player that had it's library on MySQL.
    It should connect to the OMV server as before and continue to access the Kodi Library metadata.


    2. Use MySQL database manager Applications such as Sequel Pro (for Mac OS)
    or MySQLWorkbench (by Oracle) for Windows, Various Linux distros and Mac OS.


    MySQLWorkbench is very powerful and thus a little more complex to use.


    That concludes Part 1.


    In Part 2, we'll add Nextcloud Container to use the same instance of MariaDB Container.

    Migrating MariaDB MySQL Server Plugin to MariaDB Docker Container


    In the new version of OMV 5.x, the MariaDB Plugin will most likely not exist and if you are currently using this Plugin,
    you will have to take a different approach to installing MySQL server and migrating your databases.


    One option is to manually install it like any other Debian package directly onto the OS.
    Other option is use a new (relatively to OMV) technology of Docker Container to run MySQL service.


    To learn more about what is Docker, there are many resources on the net.


    Docker needs to be installed on the Host operating system (Linux, Windows, Mac OS, etc).
    For OMV, there is Docker Plugin that provides a GUI to install and manage Docker Images & Containers for App/Services .


    The objective of this tutorial is to show you how to migrate a working MySQL OMV Plugin to a MariaDB Docker Container - a MySQL Server.


    As a follow up in Part 2, I will add Nextcloud Docker service that uses the same MariaDB Container.


    In this example, I will show how I migrated my Kodi databases running under MySQL Plugin to a Docker Container.


    PART 1


    What you will need (pre-requisites):
    - Access to OMV SSH Shell (using your favourite method - Terminal, Putty, Shellinabox, etc).
    - Docker Plugin already installed
    - A folder called /sharedfolders/docker
    - An OMV User ID already set up
    - Working Kodi system with MySQL based Library hosted on your OMV Server


    Summary of steps
    Step 1. Backup the exiting Kodi databases
    Step 2. Uninstall MySQL Plugin
    Step 3. Prepare Docker environment setup for MariaDB
    Step 4. Install MariaDB Docker
    Step 5. Import the Kodi databases into the new MySQL server
    Step 6. Test the configuration


    STEP 1
    Kodi has many versions of databases that it creates for your Media depending on the version of Kodi you are running.
    If you are like me, and have grown with Kodi (from Version 14 to the current version 18) and kept your media metadata on
    the MySQL server, then you will have several databases on your server for each different versions of Kodi.


    Additionally, you may have used the same MySQL server for other Applications too.


    So the first step is to back up all your databases so that we can import them back into the new MySQL MariaDB Docker Container.


    If you have not setup Kodi databases or any other databases, then there's nothing for you backup and can skip this step.
    Otherwise, start a shell on OMV (via Terminal on your desktop, Putty, or Shellinabox, etc).
    Enter the following command to backup your MySQL databases:

    Code
    mysqldump -u root -p --single-transaction --quick --all-databases | gzip > alldb.sql.gz

    If you had setup a root password, you will be prompted enter it.
    All your Databases, their User ID's & passwords will be saved to the compressed file alldb.sql.gz.
    Copy that file somewhere (e.g. in one of your /sharedfolders)
    BTW, it's a good practise to do this regularly.


    STEP 2
    Uninstall MySQL Plugin. Since this service will be listening on TCP Port 3306, it needs to be either stopped or uninstalled.
    Follow these steps to uninstall the MySQL Plugin.


    Screenshot 2019-03-20 at 20.06.57.png


    On the OMV GUI, navigate to the Plugins screen and find the MySQL Plugin for OpenMediaVault.
    Click the Checkbox and then click Uninstall button:


    Just to be sure that MySQL was removed, go to the terminal and run the following commands

    Bash
    sudo apt-get remove --purge mysql-server mysql-client mysql-common -y
    sudo apt-get autoremove -y
    sudo apt-get autoclean
    rm -rf /etc/mysql
    sudo find / -iname 'mysql*' -exec rm -rf {} \;

    This may take a while as it searches your system for anything with 'mysql*' so you may want to skip this command 5 above.
    Just for good measure, reboot the OMV server though it is strictly not necessary.


    STEP 3
    Prepare Docker environment setup.


    Before we install MariaDB Docker, first we need to setup a couple of environmental elements for
    MariaDB Docker (and for future Containers that would connect to it):


    1. Host (OMV OS) folders that the MariaDB Container will access
    2. A User-defined Docker Network Bridge for connecting Containers together.


    STEP 3.1
    Docker Containers have their own file system and they are not accessible to the Host OS.
    However, Containers allows parts of their file systems to be mapped to the Host OS folders.


    First create folders which the MariaDB Container will access on your OMV file system.
    MariaDB Container requires one folders on the Host OS (e.g. in /sharedfolders) for the MariaDB config files and for the actual databases.


    The latest MariaDB Docker Image creates database folder within the Config files for you so there's no need for us to create it.


    Go to terminal and enter the following command:

    Bash
    mkdir /sharedfolders/docker/mariadb

    I use the folder /sharedfolders/docker as a base for storing all Docker Container related data.
    If this does not exist on your system, create it. I called it docker but you can call it whatever you wish (e.g. AppData).
    This Docker folder helps in managing all the various current and future Container data in one place.


    Make a note of the path to the MariaDB folder since this will be needed in STEP 4 where we map this Host OS path to the Container folder paths like so:


    /sharedfolders/docker/mariadb -> /config


    This mapping is a portal into the Container's filesystem.


    STEP 3.2
    Next create a user-defined Docker Network bridge to which the MariaDB Container will be attached.
    The reason for setting up this network will be become apparent in Part 2.


    But basically, attaching MariaDB Container to this user-defined network will allow other Apps/Services (connected to
    this network) to use the same MariaDB Container.
    You can then refer this Container by its name instead of the IP address as Docker's DNS will resolve the name-to-address.


    Any Container you create on this network can immediately connect to other Containers on the same network.
    This network isolates Containers from other networks (including external) .
    However, you can expose and publish certain Container TCP ports on the network, allowing portions of your bridge access to an
    outside network (as we will see in the next step).


    Go to the terminal and enter the following command:

    Code
    docker network create my-docker-net

    Docker will create a user-defined called 'my-docker-net' and we will need this name in the next step.
    I named the network 'my-docker-net' but you can name it whatever you wish.


    STEP 4 in the next post.

    Problem solved.


    I finally fixed it. It was a permission issue and so simple (and obvious now).


    Some how, the ownership of /sharedfolder got changed to macnb:users (which has UID's 1000:100).
    I put it back to admin:users (which has UID's 998:100) and immediately fixed the problem Emby server was having.


    Must have been something to do with me setting up Nextcloud and/or Filerun docker images giving them access to a folder within /sharedfolder (it may have changed the ownership).


    BTW, Filerun docker is particularly bad as it changes the HOST Volume folder ownership explicitly. It is allowed to do it by the mere fact that docker runs the image with elevated authorised permission (i.e.root). Filerun logs shows:

    Code
    + chown -R www-data:users /var/www/html
    + chown www-data:users /user-files

    During my experimentations, I may have accidentally mapped the Host folder /sharedfolders to container folder /user-file.
    Oouch !


    But...that does not explain how the ownership got changed to macnb:users.
    Beware folks.

    Not quite. Docker dedupes. So, a second container only uses extra space for bytes that are different from the image. Since the database itself is not stored on the image, very little will change from the initial image.

    Sorry I did not see your post before I replied to @TechnoDadLife. I'm having a lot of problems using these forums (i'll report it somewhere soon).


    So what you are saying is that Virtual Size of the Image (the amount of data used for the read-only image data) used by the Container is constant and multiple Containers may share some or all the read-only image data ?

    Hi Macnb,
    You are assuming a lot here. I install MariaDB for each video, because not everyone has mariadb installed or knows how to use it. Of course, you can reuse the container. Just name each new instance a new name.
    Watch any video and remember it is geared towards someone who knows nothing.


    My most complicated video, installing Nextcloud is my most watched video. Most people who install OMV, the first thing they want to do is install Nextcloud even though I tell them to try other things first.


    So how can you help? Can you write a guide about setting up Kodi with MariaDB. I think some people might find that helpful.

    I appreciate that your videos are aimed at folks who may not know all the details (I do not). They are great and I have learnt from them too.


    You wrote "Just name each new instance a new name." which was my point of duplicating Containers.
    Each instance is 350MB (in case of Mariadb). That's OK in large commercial farms with plenty of resources.
    Anyone new to docker would get the impression that one has to have a separate database service for each new web/app service they wish to add.
    Of course that's the easier to describe and setup.


    When you do another video that needs a database for the new service, would it be worth pointing out that you can actually use an exiting mariadb container for the new service ?


    Re helping out, I'll try to write something up regarding using one database container for two apps (Kodi + Nextcloud). May be I'll send it to you first to check it :)


    YOu have not setup your System volume to Container volume mapping correctly.
    You need to create TWO folders on your /sharedfolders (one for the MariaDB config files and ANOTHER for the actual databases).
    Then you map them to the Container folders like so:


    /sharedfolders/mariadb -> /config
    /sharedfolders/mariadb/databases -> /config/databases


    This is mine:
    Screenshot 2019-03-19 at 13.00.23.png

    Recently installed Ember Server (as a Debian package from their web-site).
    All has been fine until today.


    None of the devices (Emby Apps) can play any videos on the servers.


    Checking the Emby Server logs shows that Permission was denied when the Emby server tries to access the file on the sharedfolder.
    I checked the folder/files ACL on OMV and they are set correctly (for emby user and group).


    I reported the issue at Emby forums here and Luke at Emby suggested seeking OMV help so here I am.


    Essential when the Emby App (on the TV) requests the server to play the movie, the server complains with "Permission denied" on the file in question:



    I checked the ACL using 'getfacl' command it shows:



    All the media are in /sharedfolders and Ember library was setup to point to them. All was fine and working great until today.
    Not sure what I changed to get to this situation. Now nothing plays.


    Any way to debug this further ?

    mariadb in a container is no different than the plugin and can still be a system-wide database. Docker isn't virtualization. So it will work for Nextcloud AND Kodi or whatever you want. You could even have a different mysql/mariadb docker for each database.

    In order to have the flexibility needed, the GUI has to be somewhat complex. Watch a few videos about it and it will become easier.

    I won't be porting it. So, I don't know how it is going to make it to OMV 5.x in that case.


    OK. Bit the bullet and learnt a bit more about Docker.
    Though they are not technically a VM, they (Containers) produce a "contained virtual" OS environment to run a specific service or App under a Host OS.


    So, I uninstalled the myql Plugin and installed the MariaDB Docker in network mode (using --network my-docker-net as Extra Args) and made it work for the existing Kodi clients (after importing their DB's).


    Many of the video's by @TechnoDadLife showing MariaDB being used "inefficiently" (in my opinion). For example, one copy of MariaDB bound with Nextcloud running on the same server with another copy of MariaDB bound with Lychee. That means that are two instances of mariadb containers instead of one container managing two databases within it. That's 700MB of containers instead of 350MB for one.

    I solved the problem (by uninstalling & re-installing MySQL).


    I first backed up all the databases using:

    Code
    mysqldump -u root -p --events --single-transaction --quick --all-databases | gzip > alldb.sql.gz

    Then, I uninstalled the OMV MySQL plugin.
    Then, just to be sure that MySQL was removed, I manually ran the following:

    Code
    sudo apt-get remove --purge mysql-server mysql-client mysql-common -y
    sudo apt-get autoremove -y
    sudo apt-get autoclean
    rm -rf /etc/mysql
    sudo find / -iname 'mysql*' -exec rm -rf {} \;

    Then, I rebooted OMV and installed the OMV MySQL plugin.
    Then, imported the exiting databases back into MySQL using:

    Code
    gunzip < alldb.sql.gz | mysql -u root -p

    Then, created Kodi user by entering entering following sql commands:

    Restarted OMV and now MySQL service is always running on restart.
    The mysql status shows:


    All good now.


    BTW, I did at look at Installing Docker + MariaDB container but for my usage, that does not make sense as I needed a system-wide database and not a "virtual database container" for linking with another "virtual App" like Nextcloud.
    Also Docker GUI on OMV is not yet intuitive enough for prime-time.
    So I sincerely hope MySQL plugin is NOT removed from OMV 5.x.

    Probably because mysql is upgraded to mariadb in OMV 4.x (Debian's choice). So, the config file is not correct. I would try omv-mkconf mysql and reboot again. You should also start planning to use docker for mysql because the plugin won't exist in OMV 5.x - Why should you use or not use dockers

    Thx for the quick reply.
    But I did a clean install of OMV 4.x and clean install of the plugins and it's using MariaDb.

    Recently upgraded from 2.x to 4.x (fresh install).
    Installed the all the various plugins including mysql.
    recreated my databases.
    All working great.


    When the server is powered and restarted the following day, the Dashboard shows the mysql service is NOT running (see attached) :


    Screenshot 2019-02-06 at 13.43.21.png


    It is enabled as shown on the mysql page :
    Screenshot 2019-02-06 at 13.53.15.png


    If I run "systemctl status mysql" it shows a problem:


    When I disable the service (and apply changes), I get:
    Screenshot 2019-02-06 at 14.07.11.png


    Then, I re-enable the service (again I get the same "An error occured" popup) and run the status command:




    And everything seems to work.
    It seems the mysql server was already running but the OMV dashboard GUI was mis-reporting as not-running.
    Any idea what's wrong and how to solve it ?