0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

LXCで「rm -rf /*」したらshutdownもstopも出来なくなった

Posted at

作成日:2023年7月23日

この記事で「rm -rf /*」をやった後に、使い終わったLXCのコンテナを削除するため、proxmoxのweb GUIでshutdownやstopをクリックした所、以下のようなエラーが出て削除できなくなりました。
Error popup

(can't lock file '/run/lock/lxc/pve-config-118.lock' - got timeout (500) LXC

対処法1(失敗): pct unlock {container ID}

これは別で見つけた対処法ですが、同じようなエラーが出て無理でした。
image.png

対処法2(成功): remove lock file

上記のエラーで表示される lock file 自体を直接削除し、
その後でweb GUIからstop->removeが出来ました。

そもそも lock file とは?

Linuxのlockfileは複数のプロセスが1つのファイルを同時に書き換えてしまわないための、1つ以上のsemaphore fileのだそうです(lockfile(1) - Linux man page)。

なので、これが存在している限り、proxmoxはrmなどの処理ができないのかなという感じです。

が、如何せんLXCに関する情報が少なく具体的な処理フローまでは不明です。
今回はrootfs内が完全に消えたため、コンテナ自体がlockされっぱなしだったのかなと思います。

ちなみに

今回成功した対処法2はchatGPT-4に教えてもらいました。すごいですね。
chatGPTの回答

参考文献

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?