ホームディレクトリでファイル・ディレクトリが作成出来ない

* 本ページはプロモーションが含まれています

あるLinux(Debian)へログインした後、ファイルやディレクトリが作成出来ない症状に出くわしました。

$ mkdir test
mkdir: ディレクトリ `test' を作成できません: 許可がありません
$ touch test
touch: 'test' に touch できません: 許可がありません

いろいろ試してみた

  • ログインは普通にできる
  • idコマンドでUIDやGIDを確認
  • ホームディレクトリ及び中身の属性を確認
  • シェルを変更してみる

いずれも問題なくエラーログを見てみたところ、下記のようなエラー

Mar 28 10:12:14 ibm tracker-miner-f[3060490]: Unable to get XDG user directory path for special directory &VIDEOS. Ignoring this location.
Mar 28 10:12:14 ibm tracker-miner-f[3060490]: Couldn't create new Files miner: 'Failed to load SPARQL backend: tracker data directory does not exist and could not be created: 許可がありません'

tracker-minerって何?
何やらGNOMEのツールのようですが、CLIの環境なので利用していないのに??

とにかく対処法を探してみた

$ tracker reset --hard
CAUTION: This process may irreversibly delete data.
Although most content indexed by Tracker can be safely reindexed, it can’t be assured that this is the case for all data. Be aware that you may be incurring in a data loss situation, proceed at your own risk.

Are you sure you want to proceed? [y|N]: y
Found 0 PIDs…
_g_io_module_get_default: Found default implementation dconf (DConfSettingsBackend) for ‘gsettings-backend’
Setting database locations
Checking database directories exist
Checking database version
Checking whether database files exist
Removing all database/storage files
  Removing database:'/home/washo/.cache/tracker/meta.db'
  Removing db-locale file:'/home/washo/.cache/tracker/db-locale.txt'
Segmentation fault

これだけでは直らず、下記も試す

sudo apt remove --purge tracker tracker-extract tracker-miner-fs
rm -r ~/.cache/tracker
sudo apt install tracker tracker-extract tracker-miner-fs

これで再起動したら、元通り直りました。

あっ、もしかすると、対処する前に、先に再起動を試すべきだったのかもしれません :P

追記:
上記作業後でも再発しましたので、CUI環境なのでtrackerおよびGNOME関連を削除した(GNOME等のX-Windows使っている方は気をつけてください)


See also