docker - prepare for update to omv3 --> change storage driver to btrfs

  • Hello,


    I wanted to prepare my running system for upgrade to omv3.


    I have a running docker system with storage-driver aufs.
    Due to the non existing aufs driver in newer backport-kernels in jessie I want to switch my docker to btrfs.


    Therefor I prepared a btrfs formated partition and created a shared folder on it.


    Stopping and deleting or loosing all running container and images is no problem, i have a backup or can rebuild them by scripts.


    What is the best way to change to btrfs?


    • Stopping all running container
    • Change the shared folder in the Openmediavault WebInterface
    • Stop docker service
    • Change storagedriver in /etc/default/docker
    • Start docker service
    • Restore all images and container

    I already tried steps 1 and 2, but nothing happened to the shared folder setting. Also after a reboot docker runs with the old folder


    Is there something else i forgot?


    Kind regards
    Sven

    • Offizieller Beitrag


    Changing storage driver you will loose all images and containers. So you need to save/export them as tared files. Plenty of documentation around for that.



    For the storage driver I've always used btrfs, so i don't know about the swap. I don't use the shared folder function in the UI
    I use a symlink. So with the service stopped I delete the /var/lib/docker folder, then create the symlink


    Code
    root@nb:~ # stat /var/lib/docker
      File: ‘/var/lib/docker’ -> ‘/media/dd703d81-9006-411d-a256-587ac3260154/docker’
      Size: 50        	Blocks: 8          IO Block: 4096   symbolic link
    Device: 16h/22d	Inode: 1547850     Links: 1
    Access: (0777/lrwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
    Access: 2016-08-27 00:25:55.949731792 +1000
    Modify: 2016-08-27 00:25:55.949731792 +1000
    Change: 2016-08-27 00:25:55.949731792 +1000
     Birth: -
    root@nb:~ #


    Make sure dd703d81-9006-411d-a256-587ac3260154 is a btrfs disk, and docker folder is empty. Starting the docker-engine should give you now the new storage driver. Check with btrfs info

  • Hallo,


    Thank you for your help.


    But I give my steps another try, and stopping the docker service before changing the directory did the job.


    • Stopping all running container
    • Export all Container and Images ( if needed )
    • Stop docker service on the console
    • Change the shared folder in the Openmediavault WebInterface
    • Change storagedriver in /etc/default/docker (not needed, after reboot docker detects the BTRFS File System
    • Reboot
    • Restore all images and container

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!