If the directory is being shared, delete the share.
Move docker /var/lib/docker folder on external drive
-
- OMV 4.x
- mcgyver83
-
-
If the directory is being shared, delete the share.
By default, he shouldn't be able to share /var/lib/docker
-
service docker status
If the directory is being shared, delete the share.
shared? no. problem only with /var/lib/docker/btrfs - can not be deleted.
it's not shared.
-
-
Yep it's stopped.
I have no explanation for this one.
-
It look like moving docker folder even with a link break the system @votdev knew of course what was the problem
Cannot create shared folder on new or existing drive
Anyway on a new install if I use my old docker installed on a different drive I cannot create a share folder but if I stop the docker service and use the original regular docker folder in var lib (even without docker created) I can create the share folder.but I think yesterday I try on my old system to copy the docker folder back to var lib but the result was the same was not able create a share folder make me wonder if some thing wrong with my docker! I am going to investigate a little bit more!
-
OK. Let's continue.
1. service docker stop
2.rsync -avr --progress/var/lib/docker/sharedfolders/hdd_temp/rsync -avr --progress /var/lib/docker /srv/dev-disk-by-label-HDD/hdd_temp/
3. /var/lib/docker renamed to /var/lib/docker.old
4.ln -s /sharedfolders/hdd_temp/docker /var/libln -s /srv/dev-disk-by-label-HDD/hdd_temp/docker /var/libservice docker start gives error.
what is wrong?If i delete /var/lib/docker symlink and return /var/lib/docker.old to /var/lib/docker then start is successful
-
-
You do not want to use a shared folder for that purpose. Use the actual fully qualified path name instead.
-
-
Any suggestions?
tkaiser help me please. i know you have experience to move docker to ssd/hdd on odroid hc2 -
-
Look in (edit) /etc/docker/daemon.json Write down what's in there or make a copy of the file if you will be changing it.
Try changing the "data-root" path to be here if that's where you want it:
/srv/dev-disk-by-label-HDD/hdd_temp/docker
If you haven't done so yet you will have to stop the docker service and copy all the contents of /var/lib/docker to /srv/dev-disk-by-label-HDD/hdd_temp/docker
Restart docker service or reboot when done.
-
deleted
-
I don't know... still nothing helps, Docker does not start from symlinked directory..
Editing daemon.json with a link to new directory does not help.
Should I just to start over from clean docker and setup packages with new directory?May be some package blocking process? i will try to check it after deleting one-by-one.
-
-
Are you absolutely sure that the docker service was stopped before you made any changes?
-
OK i have some investigations. If i delete btrfs folder (with 'subvolumes' folder inside) then docker starts easy, just without containers. After copy btrfs whole folder docker not starts.
All other folders also copied and docker starts without problems. But not with my saved btrfs. What is wrong with that folder and how correctly move it to new folder? Is a "rsync -avr --progress" moves it wrong way?also, i've found a can use
{
"data-root": "/srv/dev-disk-by-label-HDD/hdd_temp/docker",
"storage-driver": "overlay2"
}in daemon.js
Works good even without symlink. But it's too late, i'am using default damned btrfs and my saved subvolumes on it. So how to move it properly to new place? -
I'am give up. Changed fs to overlay2 and started all containers with new folder on hdd. Taked not so much time to start over instead of searching a way to win linux.
-
-
I'am give up. Changed fs to overlay2 and started all containers with new folder on hdd. Taked not so much time to start over instead of searching a way to win linux.
Not sure if it is relevant did you looked at the other thread mentioned above Cannot create shared folder on new or existing drive
-
I would like to change my base path for docker too. So to now, what's the working procedure?
1. Disable docker service
2. Copy var/lib/docker into a shared folder created ad hoc on my HD (where i store also other data)
3. Create link between old and new base path
4. Delete old base path
?
-
I would like to change my base path for docker too. So to now, what's the working procedure?
whats the path of your HD? Mean is it a netshare or an local hd on the docker machine? if second one is it mounted already?
as example for an internal HD on the docker host:
1. stop docker
2. move content of /var/lib/docker to the new location
3.
Coderm -rf /var/lib/docker #deletes old docker folder ln -s /yourhdpath/docker /var/lib/docker #symlink new folder to old location
if linking not work, maybe give this a shot:
4. start docker.
well, i didnt tested that but theoretically it should work. Please make a backup before!!
-
-
whats the path of your HD? Mean is it a netshare or an local hd on the docker machine? if second one is it mounted already?
as example for an internal HD on the docker host:
1. stop docker
2. move content of /var/lib/docker to the new location
3.
Coderm -rf /var/lib/docker #deletes old docker folder ln -s /yourhdpath/docker /var/lib/docker #symlink new folder to old location
if linking not work, maybe give this a shot:
4. start docker.
well, i didnt tested that but theoretically it should work. Please make a backup before!!
Thanks for your reply!
It's an HD i've connected to my ODROID HC2 and i have samba shares on it. I store config folders in AppData shared folder on the disk and now i have created another shared folder called DockerBasePath. So yes it's already mounted.
Copied with "cp -R /var/lib/docker /srv/dev-disk-by-label-HC2/DockerBasePath". But i see with "du -sh" that the size of the original docker dir is 7.1G, instead the "new" one is 10G. How is possible?
Two things:
1. from windows i can't access the docker dir i just copied, maybe because it's only for root? How could i fix permissions on it? Strange because i enabled inherited permissions on the DockerBasePath shared folder.2. so to now i have on my share: /srv/dev-disk-by-label-HC2/DockerBasePath/docker. Is this ok or i should put the content of docker directly under DockerBasePath?
-
Jetzt mitmachen!
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!