0

These are permissions

total 8
7351455 drwxr-xr-x  2 mongodb mongodb 4096 авг 21 10:36 .
7340101 drwxr-xr-x 69 root    root    4096 сеп  4 11:40 ..

for my /var/lib/mongodb

I am having problem with mongodb service,I found that I must run

sudo chown -R mongodb:mongodb /var/lib/mongodb

df -T shows

df -T
Filesystem     Type     1K-blocks     Used Available Use% Mounted on
udev           devtmpfs   8145248        0   8145248   0% /dev
tmpfs          tmpfs      1634684     1904   1632780   1% /run
/dev/sda5      ext4     244567356 79042556 153031796  35% /

I think it is ext4.

Why?

  • 1
    What command did you run to obtain the output shown at the top of your question (e.g. ls -al)? What was the current working directory when you ran it? – fra-san Sep 15 '20 at 11:07
  • I used ls -lia. It was /var/lib. – Richard Rublev Sep 15 '20 at 11:10
  • @fra-san Please,take a look at my edit. – Richard Rublev Sep 15 '20 at 11:15
  • 1
  • So, ls -lia /var/lib/mongodb lists two . entries, is this correct? This looks like a file system issue. What file system is /var/lib/mongodb on? 2) chown -R mongodb:mongodb /tmp/mongodb-27017.sock will change the owner and group of /tmp/mongodb-27017.sock to mongodb, as in the listing you are showing. What makes you say that it didn't work?
  • – fra-san Sep 15 '20 at 11:20
  • @fra-san How to check /var/lib/mongodb filesystem? – Richard Rublev Sep 15 '20 at 11:25
  • ext4! Does this cause the issue? – Richard Rublev Sep 15 '20 at 11:45
  • @fra-san what do you mean? There's nothing strange here as far as I can tell, just one set of permissions for /var/lib/mongodb (shown as .) and another for /var/lib (shown as ..). And I now see that change was added after your comment. Richard, do you still have a question? – terdon Sep 15 '20 at 12:05
  • I thought you had a file system issue because you were apparently listing two . entries in the same directory. Looking at your edited question I can't see any issue. Having a . and a .. entries in any directory is normal. You should probably rephrase your question: are you seeing error messages (either on programs or in log files)? What is not working as expected? – fra-san Sep 15 '20 at 12:07
  • @fra-san Works fine.I understand now. – Richard Rublev Sep 16 '20 at 07:39