Missing space on boot drive...

  • Here is what I did to move my docker files to my storage drive and have everything work without having to redo any docker settings. Everything worked just as it did before the move.


    1.) I created a shared folder on my storage drive named Docker. I purposely left the name the same as on the boot drive just in case anything related to my containrs required the specific path name of 'docker'. Maybe it didn't matter, but I wasn't taking any chances.


    2.) I then copied the contents of /var/lib/docker to /sharedfolders/Docker (change this path to match where you want to store the files) using the command cp -a /var/lib/docker/. /sharedfolders/Docker/ (again, change paths to match yours). Note: I think this is the command I used. I was doing so many google searches that I might have the wrong command line instructions here. I'm new enough to linux to possibly have this wrong. Hopefully someone can verify this is the correct command.


    3.) Edited the Docker path setting in the WebUI to point to my Docker folder on the storage drive.


    4.) Verified that everything worked as before and then rm'd the docker directory in the /var/lib folder on my boot drive to free up the missing space.


    Took all of 10 minutes once I learned how it was all done thanks to the guys here. This should allow everything to work without having to redo each container from scratch.

  • thank you @flyinjoe13 - obviously the key factor ist the "-a" - argument for the cp-command. Before, I just used "cp -r" but my mariadb and nextcloud docker didn't work (althouth they started). Now with "cp -a" everything seems to be fine ;)

  • so you suggest to move the docker-path to an external hdd anyway?

    I'm not suggesting anything when I'm not familiar with the issue (like Docker + OMV) :)


    All I can tell is that low-end flash memory like SD cards or USB pen drives dies pretty quickly with a lot of write accesses with high Write Amplification involved (as it's at least the case with RPi-Monitor).

    • Offizieller Beitrag

    As long as the docker images are few, small and not frequently updated, it should be fine to use the default docker base path /var/lib/docker. But docker images tend to be many, big and frequently updated. Then having them on the SD card may cause the SD card to fail sooner than later. Or fill the rootfs.

    • Offizieller Beitrag

    As long as the docker images are few, small and not frequently updated, it should be fine to use the default docker base path /var/lib/docker. But docker images tend to be many, big and frequently updated. Then having them on the SD card may cause the SD card to fail sooner than later. Or fill the rootfs.

    This is truth here... When I started messing with Docker, my intention was to only use 1... Now I'm up to 7 (8 if you count watchtower).. and I've probably tested at least 5-6 more before deciding I really didn't need/want them.

  • thank you @flyinjoe13 - obviously the key factor ist the "-a" - argument for the cp-command. Before, I just used "cp -r" but my mariadb and nextcloud docker didn't work (althouth they started). Now with "cp -a" everything seems to be fine ;)

    Your welcome. It was nice to help someone for a change because all i've done so far in my short time here is ask questions.


    Yes the -a is the key. I can't remember exactly what the directions said, but it was something about not only copying the files and folders but also the file attributes and symlinks.

Jetzt mitmachen!

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