作者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/m.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