作者Harston (哈尔斯吞)
看板Linux
标题[问题] 容器建置失败并且无法移除
时间Mon Sep 5 21:13:28 2022
大家好,linux新手请教。
前阵子上课学到了singularity使用容器方法
在taiwania1上打算建置一个装有化学模拟软体的映像档(无root权限)
但在安装编译器时似乎出了一点问题,重新登入之後打算直接使用 rm -rf 把整个资料夹
删
但却出现权限不足的问题,如同下面所示,想请问有没有办法能安全的将这错误的污点给
移
因为怕会不会是因为挂载到一些资料夹导致不能删除,怕乱删容器会导致帐号下的其他重
要
rm: cannot remove ‘centos_7/var/tmp’: Device or resource busy
rm: cannot remove ‘centos_7/etc/resolv.conf’: Device or resource busy
rm: cannot remove ‘centos_7/etc/group’: Device or resource busy
rm: cannot remove ‘centos_7/etc/passwd’: Device or resource busy
rm: cannot remove ‘centos_7/etc/hosts’: Device or resource busy
rm: cannot remove ‘centos_7/proc’: Device or resource busy
rm: cannot remove ‘centos_7/dev’: Device or resource busy
rm: cannot remove ‘centos_7/home’: Device or resource busy
rm: cannot remove ‘centos_7/tmp’: Device or resource busy
rm: cannot remove ‘centos_7/root/.tcshrc’: Permission denied
rm: cannot remove ‘centos_7/root/.bash_profile’: Permission denied
rm: cannot remove ‘centos_7/root/anaconda-ks.cfg’: Permission denied
rm: cannot remove ‘centos_7/root/.cshrc’: Permission denied
rm: cannot remove ‘centos_7/root/.bashrc’: Permission denied
rm: cannot remove ‘centos_7/root/.bash_logout’: Permission denied
rm: cannot remove ‘centos_7/sys’: Device or resource busy
rm: cannot remove ‘centos_7/usr/lib64/libnsssysinit.so’: Permission denied
rm: cannot remove ‘centos_7/usr/lib64/libmagic.so.1.0.0’: Permission denied
rm: cannot remove ‘centos_7/usr/lib64/libkrad.so.0.0’: Permission denied
rm: cannot remove ‘centos_7/usr/lib64/games’: Permission denied
rm: cannot remove ‘centos_7/usr/lib64/libpamc.so.0’: Permission denied
rm: cannot remove ‘centos_7/usr/lib64/libauparse.so.0’: Permission denied
rm: cannot remove ‘centos_7/usr/lib64/libkmod.so.2.2.10’: Permission denied
rm: cannot remove ‘centos_7/usr/lib64/libcurl.so.4’: Permission denied
rm: cannot remove ‘centos_7/usr/lib64/libnss_files.so.2’: Permission denied
rm: cannot remove ‘centos_7/usr/lib64/libnsl-2.17.so’: Permission denied
rm: cannot remove ‘centos_7/usr/lib64/libkrb5.so.3.3’: Permission denied
rm: cannot remove ‘centos_7/usr/lib64/libformw.so.5.9’: Permission denied
rm: cannot remove ‘centos_7/usr/lib64/libldap-2.4.so.2’: Permission denied
rm: cannot remove ‘centos_7/usr/lib64/gio’: Permission denied
rm: cannot remove ‘centos_7/usr/lib64/libkrb5support.so.0’: Permission denie
d
rm: cannot remove ‘centos_7/usr/lib64/security’: Permission denied
rm: cannot remove ‘centos_7/usr/lib64/libpcre.so.1.2.0’: Permission denied
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 1.169.39.1 (台湾)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Linux/M.1662383610.A.41A.html
1F:→ roccqqck: 用sudo09/05 23:47
2F:→ Harston: 找了好久在国外论坛上也有相同状况 09/06 00:29
3F:→ Harston: 最後解法是用chmod -R +rw修改整个资料夹权限 09/06 00:30
4F:→ Harston: 就可以用rm -rf将容器删除了 09/06 00:31
5F:→ Harston: 奇怪的是明明一开是我帐号创建的资料夹,为什麽却没权限09/06 00:32
7F:→ Harston: 给以後遇到类似问题的人参考 09/06 00:35
8F:→ roccqqck: 容器内部是root阿 这是正常现象 09/06 08:00
9F:→ Harston: 但用singularity进入容器好像id不会变 09/06 12:32
10F:→ roccqqck: 我不确定你这工具的原理是什麽 09/06 13:19
11F:→ roccqqck: 一般image里面uid是写死的 跟你使用的user uid无关 09/06 13:20
原来如此,下次注意看看
12F:→ lycantrope: 照singularity网站说明,用exec --writable 应该可以 09/06 15:10
13F:→ lycantrope: 修改内容,执行rm -rf应该通用? 09/06 15:11
了解,谢谢你的提供
※ 编辑: Harston (49.216.33.15 台湾), 09/07/2022 12:51:05