Linuxにお詳しい方よろしくお願いいたします。
Linux上で1ファイルだけ削除できないファイルがあります。
・ls-lで権限を確認しましたがrとwは付与されています。
・root権限での削除もできませんでした。
こちらの記事が参考になりそうだったので、lsattrコマンドで属性を確認しても
lsattr: Inappropriate ioctl for device While reading flags on
とエラーが出ます。
rootユーザでもファイルが消せないことってありえるのでしょうか?
以下、実行結果です
hogeOS@PC:/$ su (rootユーザでログイン)
Password:
root@PC:/# cd /etc/postgresql/11/main (削除したいファイルがある場所に移動)
root@PC:/etc/postgresql/11/main# ls -l
total 52
---------- 1 postgres postgres 4687 May 17 13:28 _pg_hba.conf
drwxr-xr-x 1 postgres postgres 512 Apr 28 00:07 conf.d
-rw-r--r-- 1 postgres postgres 315 Apr 28 00:07 environment
-rw-r--r-- 1 postgres postgres 143 Apr 28 00:07 pg_ctl.conf
-rwxrwxrwx 0 hogeOS hogeOS 4687 May 17 13:28 pg_hba.conf**(削除したいファイル,O名G名が他と違う)**
-rw-r----- 1 postgres postgres 1636 Apr 28 00:07 pg_ident.conf
---------- 1 postgres postgres 24032 May 17 13:31 postgresql.conf
-rw-r--r-- 1 postgres postgres 317 Apr 28 00:07 start.conf
root@PC:/etc/postgresql/11/main# rm pg_hba.conf (削除失敗)
rm: cannot remove 'pg_hba.conf': Permission denied
root@PC:/etc/postgresql/11/main# lsattr (lsattrコマンド)
lsattr: Inappropriate ioctl for device While reading flags on ./_pg_hba.conf
lsattr: Inappropriate ioctl for device While reading flags on ./conf.d
lsattr: Inappropriate ioctl for device While reading flags on ./environment
lsattr: Inappropriate ioctl for device While reading flags on ./pg_ctl.conf
lsattr: Inappropriate ioctl for device While reading flags on ./pg_hba.conf (lsattrでも確認できない)
lsattr: Inappropriate ioctl for device While reading flags on ./pg_ident.conf
lsattr: Inappropriate ioctl for device While reading flags on ./postgresql.conf
lsattr: Inappropriate ioctl for device While reading flags on ./start.conf
回答1件
あなたの回答
tips
プレビュー