这可能与 MongoDB 有关,但我不太确定。
当尝试在已安装的磁盘上运行 MongoDB 时,我发现其用户 ( mongodb
) 对它配置为 ( /media/dutzi/hdd/mongodb
) 的文件夹没有权限。
然后我尝试运行:
sudo -H -u mongodb bash -c 'touch /media/dutzi/hdd/mongodb/asd'
并得到:
touch: cannot touch '/media/dutzi/hdd/mongodb/asd': Permission denied
当尝试使用不同的用户(root 用户或我自己的用户)时,我能够触摸该文件。
我尝试(递归地)允许所有可能的权限,目前它看起来像这样:
❯ ll /media/dutzi/hdd/
total 20K
drwxrwxrwx 2 root root 16K Nov 7 17:25 lost+found/
drwsrwsrwx 4 mongodb mongodb 4.0K Nov 7 17:38 mongodb/
dutzi in dutzipc in ~
❯ ll /media/dutzi/hdd/mongodb/
total 204K
-rwxrwxrwx 1 mongodb mongodb 47 Nov 7 17:29 WiredTiger*
-rwxrwxrwx 1 mongodb mongodb 21 Nov 7 17:29 WiredTiger.lock*
-rwxrwxrwx 1 mongodb mongodb 1.3K Nov 7 17:29 WiredTiger.turtle*
-rwxrwxrwx 1 mongodb mongodb 44K Nov 7 17:29 WiredTiger.wt*
-rwxrwxrwx 1 mongodb mongodb 4.0K Nov 7 17:29 WiredTigerHS.wt*
-rwxrwxrwx 1 mongodb mongodb 20K Nov 7 17:29 _mdb_catalog.wt*
-rwxrwxrwx 1 mongodb mongodb 0 Nov 7 17:31 as2d*
-rwxrwxrwx 1 mongodb mongodb 0 Nov 7 17:38 asd*
-rwxrwxrwx 1 mongodb mongodb 20K Nov 7 17:29 collection-0--7241342955860792272.wt*
-rwxrwxrwx 1 mongodb mongodb 20K Nov 7 17:29 collection-2--7241342955860792272.wt*
-rwxrwxrwx 1 mongodb mongodb 4.0K Nov 7 17:29 collection-4--7241342955860792272.wt*
drwxrwxrwx 2 mongodb mongodb 4.0K Nov 7 17:29 diagnostic.data/
-rwxrwxrwx 1 mongodb mongodb 20K Nov 7 17:29 index-1--7241342955860792272.wt*
-rwxrwxrwx 1 mongodb mongodb 20K Nov 7 17:29 index-3--7241342955860792272.wt*
-rwxrwxrwx 1 mongodb mongodb 4.0K Nov 7 17:29 index-5--7241342955860792272.wt*
-rwxrwxrwx 1 mongodb mongodb 4.0K Nov 7 17:29 index-6--7241342955860792272.wt*
drwxrwxrwx 2 mongodb mongodb 4.0K Nov 7 17:29 journal/
-rwxrwxrwx 1 mongodb mongodb 0 Nov 7 17:29 mongod.lock*
-rwxrwxrwx 1 mongodb mongodb 20K Nov 7 17:29 sizeStorer.wt*
-rwxrwxrwx 1 mongodb mongodb 114 Nov 7 17:29 storage.bson*
dutzi in dutzipc in ~
❯ sudo -H -u mongodb bash -c 'touch /media/dutzi/hdd/mongodb/asdasd'
touch: cannot touch '/media/dutzi/hdd/mongodb/asdasd': Permission denied