OMV on SD or disk on HC2 ?

  • I am using OMV5 on Odroid HC2 with 2 TB disk, I also installed Nextcloud.

    My simply question: is it better to maintain the system on SD card as now or create a partition of ten of GB on the disk and move with the utility the system on it ?

    I have no problem of performance, my only goal is the services reliability and continuity.

    In this way it is easy to clone the system on another card, but is the system on SD with the flashmemory plugin reliable enough over time.

    How did others who have a configuration similar to mine choose?

    Thanks.

  • ginsa

    Added the Label OMV 5.x
  • If you use a good SD card and the flashmemory plugin, it will rund for very long... However, if you have set up everything properly, just make a copy of your SD and store it anywhere. So it is easy for your to just remove and reinsert the new SD.


    If you HDD will die, your data as well as your system will die too. So you definitely need to reinstall completely.

  • Use a sd card for the root filesystem. But only for the basic operating system.


    Create a separate share or shares on the HDD for docker images and docker app data.


    This way the SD card will see very little writes, protected by the flash memory plugin, and can be expected to last many years.


    The docker images and docker app data are likely to see a lot of writes, and also expand over time. Not suitable to store on the SD card!


    Keep the used partitions on the SD card small. No need to expand them or to use all of the card. That way you get early warning about problems and the SD card wear leveling can help extend the life of the SD card. Also clones are small and fast to make.


    You may need to figure out how to backup the docker configuration and the docker app data. Personally I ignore it. I just make sure that I have good backups of the actual media files, stored on another share. I can easily spin up a new docker image when needed and there is nothing important in my docker app data. YMMV.

    Be smart - be lazy. Clone your rootfs.
    OMV 5: 9 x Odroid HC2 + 1 x Odroid HC1 + 1 x Raspberry Pi 4

    Edited once, last by Adoby ().

  • Thank you for your advices.

    ......

    If you HDD will die, your data as well as your system will die too. So you definitely need to reinstall completely.

    Unfortunately it happened... so I decided to keep the system on SD card that I can periodically clone.

    ...........

    Create a separate share or shares on the HDD for docker images and docker app data.

    This way the SD card will see very little writes, protected by the flash memory plugin, and can be expected to last many years.

    The docker images and docker app data are likely to see a lot of writes, and also expand over time. Not suitable to store on the SD card!

    .......

    I think you refer to use of the command "docker run parameters /directory/on/hard/disk appname". I did it so.

    Because with the command "docker pull appname" I don't know if I can define where the image have to be installed in a location different from /var/lib/docker on the SD card.

  • It is not only possible to change the default docker base path, away from the SD card, I would even say it is imperative that you do.


    I managed to do it, so you should be able to as well. I don't quite remember what I did, but I don't think it was difficult. I believe there was a setting somewhere, just specify what path to use instead of /var/lib/docker. In portainer?


    I don't have access to any OMV5 box where I am, so I can't give more details just now.

    Be smart - be lazy. Clone your rootfs.
    OMV 5: 9 x Odroid HC2 + 1 x Odroid HC1 + 1 x Raspberry Pi 4

  • Found on the net...


    Stop Docker service

    Edit the file /etc/docker/daemon.json changing the string "data-root": "/var/lib/docker" to "data-root": "/path/to/your/new/docker"

    Copy the Docker library: rsync -aP /var/lib/docker/ /path/to/your/new/docker

    Rename the old directory /var/lib/docker

    Restart Docker service

    If everything works, remove the old directory /var/lib/docker, otherwise restore all changes made


    It seems easy and safe, I'll try.

  • That wasn't a good recipe. Now Docker and then Nextcloud and Portainer don't work anymore ... ;(

    It seemed too simple. Luckily I have a copy of the system on cloned SD card and I can restart immediately. 8o

    Waiting for tips...

  • That wasn't a good recipe. Now Docker and then Nextcloud and Portainer don't work anymore ... ;(

    It seemed too simple. Luckily I have a copy of the system on cloned SD card and I can restart immediately. 8o

    Waiting for tips...

    Old and new locations for docker base path should have same filesystem. If this is not the case, you need to create the containers again.


    Anyway my advice is to use docker-compose for creating/managing containers. This way you can easily build up containers and if their data is already somewhere else from the microsd, it will not be lost.

  • I just used the OMV5 GUI. Before I installed any dockers.


    OMV-Extras - Docker


    And change Docker Storage.


    Couldn't be much easier. If you do it in time...

    Be smart - be lazy. Clone your rootfs.
    OMV 5: 9 x Odroid HC2 + 1 x Odroid HC1 + 1 x Raspberry Pi 4

  • Check to be sure there is no docker subdirectory under /var/lib. Or at least that it isn't used.


    I don't think changing Docker Storage has any effect on already installed dockers. I don't think it moves anything. I assume it has to be changed before you do anything at all with docker, to work as intended.

    Be smart - be lazy. Clone your rootfs.
    OMV 5: 9 x Odroid HC2 + 1 x Odroid HC1 + 1 x Raspberry Pi 4

  • Check to be sure there is no docker subdirectory under /var/lib. Or at least that it isn't used.


    I don't think changing Docker Storage has any effect on already installed dockers. I don't think it moves anything. I assume it has to be changed before you do anything at all with docker, to work as intended.

    I copied SD directory /var/lib/docker to a new directory on the disk with rsync.

    I renamed the old library as /var/lib/docker.old, so it disappeared from the active system.

    I changed Docker Storage on GUI and rebooted OMV.

    Portainer didn't start, but Nextcloud regularly worked.

    I saw that changing Docker Storage it changes accordingly the content of /etc/docker/daemon.json

    I think now Docker no longer uses anything on the SD.

  • I don't think changing Docker Storage has any effect on already installed dockers. I don't think it moves anything. I assume it has to be changed before you do anything at all with docker, to work as intended.

    It works in general, but once Portainer fails to start, the other time Nextcloud doesn't start, sometimes both correctly work ... the system is no longer reliable as before.

    Conclusion: it is better to avoid these changes on the fly and to put Docker on the right place before to install the containers .... :thumbdown:;)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!