環境
Debian 13 (Testing)
Debian Live をビルドしている最中に Ctrl+C で止めたら、削除できないファイルができた。
# rm -rf chroot
rm: cannot remove 'chroot/dev/pts/0': Operation not permitted
rm: cannot remove 'chroot/dev/pts/ptmx': Operation not permitted
はてな?
# chattr -i -a *
してみたけど変わらず。
# ls -alh
total 4.0K
drwxr-xr-x 2 root root 0 Jul 2 21:35 .
drwxr-xr-x 3 root root 4.0K Jul 2 22:14 ..
crw--w--w- 1 root tty 136, 0 Jul 2 21:43 0
c-w--w--w- 1 root root 5, 2 Jul 2 21:35 ptmx
行頭の c ってなんだっけ。
/dev/tty とかで使っているデバイスファイルらしい。chroot のためにリアルのデバイスとつながっている最中かな?
マウント状況を調べてみると、それらしいものが見つかりました。
devpts-live on /root/livework/chroot/dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000,x-gvfs-hide)
umount しようとしたけれど
# umount devpts-live
umount: /root/livework/chroot/dev/pts: target is busy.
うーん、めんどくさくなったので母艦を再起動。そうするとマウント解除して削除できるようになりました。