欢迎光临
我们一直在努力

docker rm时提示device or resource busy问题解决

docker-compose down

报错:
Error response from daemon: driver "overlay" failed to remove root filesystem for <some-id>: 
remove /data1/docker/overlay/<some-id>/merged: device or resource busy
grep <some-id> /proc/*/mountinfo
  • 一般通过查找可以找到PID。
  • 根据这个PID发现是一个/usr/libexec/colord的程序在使用。
  • 查了一下程序的信息,发现确实是将之前删除不了的目录写在了mountinfo中。
  • 找到进程就好办了。直接将这个进程kill掉。
  • 重新执行docker-compose down,提示删除成功。

1、现象复现,提示device or resource busy

docker rm -f recom-engine-service
Error response from daemon: driver “overlay2” failed to remove root filesystem for 68222175a2ec896c9a084c5fb87966588cf2ba644e6f8b6f326373fea022d153: remove /data0/docker/overlay2/ce44e5ab1eb91fe52acb87c8e37c140d4240be01d2d4afd12b22442cb86f761b/merged: device or resource busy

2、查找占用目录的进程

grep ce44e5ab1eb91fe52acb87c8e37c140d4240be01d2d4afd12b22442cb86f761b /proc/*/mounts
/proc/189695/mounts:overlay /data0/docker/overlay2/ce44e5ab1eb91fe52acb87c8e37c140d4240be01d2d4afd12b22442cb86f761b/merged overlay rw,relatime,lowerdir=/data0/docker/overlay2/l/F4BQHNVPHGRKWXFRUIHXUMAHZ2:/data0/docker/overlay2/l/POBMGHFBIQXNBM5RUMGRM4S3FH:/data0/docker/overlay2/l/SK2CEBQ4SR2X6UTQDAO6C75RPM:/data0/docker/overlay2/l/QGUGY27GDXCFSPKOSBCOTVAX57:/data0/docker/overlay2/l/GHT67GREWEXGEHUMKXAGEZKONI:/data0/docker/overlay2/l/TKNFNNTVIITCWH7B2TR326OX6N:/data0/docker/overlay2/l/QQ4MIFW35TPBOIVJBKFM5QHUXM:/data0/docker/overlay2/l/APX5ZKNHIOGTAI24C5PBSALHE3:/data0/docker/overlay2/l/BDD7JOCD5YT4OWOEFMNU6URS7A:/data0/docker/overlay2/l/3ZKBAWZ3IW6QSKI4AVSBOPHHSH:/data0/docker/overlay2/l/EYIQC7BRCXET4RFFZCPQH6VN4J:/data0/docker/overlay2/l/HWIZIHJLNPPGJBSZUUV4KJYQD2:/data0/docker/overlay2/l/EAUEDS4QJ5MZOJBYLKLBPPF7MF:/data0/docker/overlay2/l/FYIXAIYRXQEYRMEARBKTXVCI5D:/data0/docker/overlay2/l/YA7M4B2FAVCSD3PRA7XIBWPUHW:/data0/docker/overlay2/l/Q4YBVOMU2RRT5HDA7HBIIDHM2F:/data0/docker/overlay2/l/5UWTJ3WEV7RLCNYG7KWW3G6N4Y:/data0/docker/overlay2/l/5VKRO2YX4XOOAA5DUZJEYB2DUN:/data0/docker/overlay2/l/D7RO2VF73BMT6SHOINS6ZUJF7I:/data0/docker/overlay2/l/ZEAGD6JWMEXCFEBWASW3NOVJKF:/data0/docker/overlay2/l/XCQBF6HB3NCZSGWAKEBBPTQWZE:/data0/docker/overlay2/l/HQR2BEU6HMCWJ7O5C4QYKZE2C2:/data0/docker/overlay2/l/3J5ZAYVPGR6HRCJFJQHNCYLBAX:/data0/docker/overlay2/l/Q3LUROBZNZ7ZIIO5ETKPCUWFPZ,upperdir=/data0/docker/overlay2/ce44e5ab1eb91fe52acb87c8e37c140d4240be01d2d4afd12b22442cb86f761b/diff,workdir=/data0/docker/overlay2/ce44e5ab1eb91fe52acb87c8e37c140d4240be01d2d4afd12b22442cb86f761b/work 0 0
/proc/189697/mounts:overlay /data0/docker/overlay2/ce44e5ab1eb91fe52acb87c8e37c140d4240be01d2d4afd12b22442cb86f761b/merged overlay rw,relatime,lowerdir=/data0/docker/overlay2/l/F4BQHNVPHGRKWXFRUIHXUMAHZ2:/data0/docker/overlay2/l/POBMGHFBIQXNBM5RUMGRM4S3FH:/data0/docker/overlay2/l/SK2CEBQ4SR2X6UTQDAO6C75RPM:/data0/docker/overlay2/l/QGUGY27GDXCFSPKOSBCOTVAX57:/data0/docker/overlay2/l/GHT67GREWEXGEHUMKXAGEZKONI:/data0/docker/overlay2/l/TKNFNNTVIITCWH7B2TR326OX6N:/data0/docker/overlay2/l/QQ4MIFW35TPBOIVJBKFM5QHUXM:/data0/docker/overlay2/l/APX5ZKNHIOGTAI24C5PBSALHE3:/data0/docker/overlay2/l/BDD7JOCD5YT4OWOEFMNU6URS7A:/data0/docker/overlay2/l/3ZKBAWZ3IW6QSKI4AVSBOPHHSH:/data0/docker/overlay2/l/EYIQC7BRCXET4RFFZCPQH6VN4J:/data0/docker/overlay2/l/HWIZIHJLNPPGJBSZUUV4KJYQD2:/data0/docker/overlay2/l/EAUEDS4QJ5MZOJBYLKLBPPF7MF:/data0/docker/overlay2/l/FYIXAIYRXQEYRMEARBKTXVCI5D:/data0/docker/overlay2/l/YA7M4B2FAVCSD3PRA7XIBWPUHW:/data0/docker/overlay2/l/Q4YBVOMU2RRT5HDA7HBIIDHM2F:/data0/docker/overlay2/l/5UWTJ3WEV7RLCNYG7KWW3G6N4Y:/data0/docker/overlay2/l/5VKRO2YX4XOOAA5DUZJEYB2DUN:/data0/docker/overlay2/l/D7RO2VF73BMT6SHOINS6ZUJF7I:/data0/docker/overlay2/l/ZEAGD6JWMEXCFEBWASW3NOVJKF:/data0/docker/overlay2/l/XCQBF6HB3NCZSGWAKEBBPTQWZE:/data0/docker/overlay2/l/HQR2BEU6HMCWJ7O5C4QYKZE2C2:/data0/docker/overlay2/l/3J5ZAYVPGR6HRCJFJQHNCYLBAX:/data0/docker/overlay2/l/Q3LUROBZNZ7ZIIO5ETKPCUWFPZ,upperdir=/data0/docker/overlay2/ce44e5ab1eb91fe52acb87c8e37c140d4240be01d2d4afd12b22442cb86f761b/diff,workdir=/data0/docker/overlay2/ce44e5ab1eb91fe52acb87c8e37c140d4240be01d2d4afd12b22442cb86f761b/work 0 0

3、杀掉进程

kill -9 189695

4、继续操作删除,成功

docker rm -f recom-engine-service
recom-engine-service

 

赞(5) 打赏
转载请注明来源:IT技术资讯 » docker rm时提示device or resource busy问题解决

评论 抢沙发

评论前必须登录!

 

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏