Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"atomic storage reset" fails if /var/lib/docker is mounted #254

Open
mbarnes opened this issue Aug 30, 2017 · 6 comments
Open

"atomic storage reset" fails if /var/lib/docker is mounted #254

mbarnes opened this issue Aug 30, 2017 · 6 comments

Comments

@mbarnes
Copy link
Contributor

mbarnes commented Aug 30, 2017

Following the RHEL documentation for setting up the overlay2 graph driver, which recommends:

CONTAINER_ROOT_LV_MOUNT_PATH=/var/lib/docker

atomic storage reset subsequently fails with

rm: cannot remove ‘/var/lib/docker’: Device or resource busy

because the LV is still mounted there.

@rhatdan
Copy link
Member

rhatdan commented Aug 30, 2017

You should do

systemctl stop docker
atomic storage reset
atomic storage modify --storage=overlay2
systemctl start docker

@mbarnes
Copy link
Contributor Author

mbarnes commented Aug 30, 2017

I should have emphasized this is when running atomic storage reset again after all that.

Observed this while working on a devicemapper-to-overlay2 playbook (based on yours) and trying to reset the state back to devicemapper (see openshift/openshift-ansible#5216).

@rhatdan
Copy link
Member

rhatdan commented Aug 30, 2017

@rhvgoyal Ideas?

@mbarnes
Copy link
Contributor Author

mbarnes commented Aug 30, 2017

What about just:

diff --git a/Atomic/storage.py b/Atomic/storage.py
index 77c1cbb..6e02256 100644
--- a/Atomic/storage.py
+++ b/Atomic/storage.py
@@ -160,6 +160,7 @@ class Storage(Atomic):
         util.call(["umount", root + "/devicemapper"], stderr=DEVNULL)
         util.call(["umount", root + "/overlay"], stderr=DEVNULL)
         util.call(["umount", root + "/overlay2"], stderr=DEVNULL)
+        util.call(["umount", root], stderr=DEVNULL)
         shutil.rmtree(root)
         os.mkdir(root)
         try:

And let it silently fail if there's nothing mounted there?

@rhatdan
Copy link
Member

rhatdan commented Aug 30, 2017

If that works, open a pull request with atomic.

@mbarnes
Copy link
Contributor Author

mbarnes commented Aug 30, 2017

Gah, just realized I filed this issue against the wrong project. Sorry about that. 😖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants