<p>No, you sadly can't remove a volume that is in use by a container which is stated under 'Extended Description' here: <a href="https://docs.docker.com/engine/reference/commandline/volume_rm/" rel="nofollow noreferrer">https://docs.docker.com/engine/reference/commandline/volume_rm/</a></p>

<p>However, I'd suggest using docker for its strength and restarting the docker container after updating the directory externally.</p>

CC BY-SA 4.0
2019-03-27T21:34:47.830Z
2019-03-27T21:34:47.830Z
Aliminator
<p>I have a container which is based on tomcat image and I have mounted 'webapps' folder to hosted machine directory '/app/webapps'. Now for some updations I want to remove this webapps folder from inside the container but when I execute command: <code>rm -rf webapps</code> below error is produced:</p>

<blockquote>
  <p>rm: cannot remove 'webapps': Device or resource busy</p>
</blockquote>

<p>So I want to know is it possible to remove mounted directory by executing a Linux command from inside the container or not?</p>

<docker>
Is it allowed to remove mounted directory from inside Docker container?
Jaffy
# Is it allowed to remove mounted directory from inside Docker container?

(Asked by: username_0 on 2019-03-27)

I have a container which is based on tomcat image and I have mounted 'webapps' folder to hosted machine directory '/app/webapps'. Now for some updations I want to remove this webapps folder from inside the container but when I execute command: `rm -rf webapps` below error is produced:

> rm: cannot remove 'webapps': Device or resource busy

So I want to know is it possible to remove mounted directory by executing a Linux command from inside the container or not?

**Tags:** docker


---

## 1 answers

### Answer by username_1 on 2019-03-27. Score: 4

No, you sadly can't remove a volume that is in use by a container which is stated under 'Extended Description' here: <https://docs.docker.com/engine/reference/commandline/volume_rm/>

However, I'd suggest using docker for its strength and restarting the docker container after updating the directory externally.


---

