[問題] 容器建置失敗並且無法移除

看板Linux作者 (哈爾斯吞)時間2年前 (2022/09/05 21:13), 2年前編輯推噓0(0013)
留言13則, 3人參與, 2年前最新討論串1/1
大家好,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://www.ptt.cc/bbs/Linux/M.1662383610.A.41A.html

09/05 23:47, 2年前 , 1F
用sudo
09/05 23:47, 1F

09/06 00:29, 2年前 , 2F
找了好久在國外論壇上也有相同狀況
09/06 00:29, 2F

09/06 00:30, 2年前 , 3F
最後解法是用chmod -R +rw修改整個資料夾權限
09/06 00:30, 3F

09/06 00:31, 2年前 , 4F
就可以用rm -rf將容器刪除了
09/06 00:31, 4F

09/06 00:32, 2年前 , 5F
奇怪的是明明一開是我帳號創建的資料夾,為什麼卻沒權限
09/06 00:32, 5F

09/06 00:34, 2年前 , 6F

09/06 00:35, 2年前 , 7F
給以後遇到類似問題的人參考
09/06 00:35, 7F

09/06 08:00, 2年前 , 8F
容器內部是root阿 這是正常現象
09/06 08:00, 8F

09/06 12:32, 2年前 , 9F
但用singularity進入容器好像id不會變
09/06 12:32, 9F

09/06 13:19, 2年前 , 10F
我不確定你這工具的原理是什麼
09/06 13:19, 10F

09/06 13:20, 2年前 , 11F
一般image裡面uid是寫死的 跟你使用的user uid無關
09/06 13:20, 11F
原來如此,下次注意看看

09/06 15:10, 2年前 , 12F
照singularity網站說明,用exec --writable 應該可以
09/06 15:10, 12F

09/06 15:11, 2年前 , 13F
修改內容,執行rm -rf應該通用?
09/06 15:11, 13F
了解,謝謝你的提供 ※ 編輯: Harston (49.216.33.15 臺灣), 09/07/2022 12:51:05
文章代碼(AID): #1Z5VNwGQ (Linux)
文章代碼(AID): #1Z5VNwGQ (Linux)