The block device attributes info on my sda.

sudo blkid
/dev/sda1: UUID="7E91-CA50" TYPE="vfat" PARTLABEL="win10" PARTUUID="b30fb21a-0b23-41fb-bed5-ad42ce287770"
/dev/sda2: UUID="6512f5f3-d574-49dd-a5ba-572795df8792" TYPE="ext4" PARTLABEL="debian" PARTUUID="eeca8d16-53cb-4b3e-9cb1-c335d34f8c22"
/dev/sda3: UUID="6434a352-35e0-46d9-b0a2-da724c91639f" TYPE="ext4" PARTLABEL="centos" PARTUUID="12f64023-b42e-48ce-a0d2-edb13625db9b"
/dev/sda4: UUID="0cba040e-d9da-4285-b70e-b2a9b5290a1c" TYPE="ext4" PARTLABEL="arch" PARTUUID="99e49e99-fdf2-4636-95b4-13dccde7dbca"
/dev/sda5: UUID="6a55c9fc-a1c6-4285-8763-093b9a715e4c" TYPE="swap" PARTLABEL="swap" PARTUUID="c4634793-b5e4-4c3a-abc8-a07dd0bd21fd"

I want to mount /mongodb on /dev/sda4 whose uuid is 0cba040e-d9da-4285-b70e-b2a9b5290a1c.
To add the following line on my /etc/fstab.

UUID=0cba040e-d9da-4285-b70e-b2a9b5290a1c  /mongodb        ext4    rw,auto     0 1

To ls /mongodb after reboot.

debian@wifi:~$ ls -alR   /mongodb
total 28
drwxr-xr-x  4 debian debian  4096 Aug 31 19:57 .
drwxr-xr-x 24 root   root    4096 Aug 31 09:27 ..
drwxr-xr-x  2 debian debian  4096 Aug 31 19:57 log
drwx------  2 root   root   16384 Aug 31 09:25 lost+found

total 8
drwxr-xr-x 2 debian debian 4096 Aug 31 19:57 .
drwxr-xr-x 4 debian debian 4096 Aug 31 19:57 ..
-rw-r--r-- 1 debian debian    0 Aug 31 19:57 mongodb.log
ls: cannot open directory /mongodb/lost+found: Permission denied

df -h /mongodb
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda4        46G   52M   44G   1% /mongodb
debian@wifi:~$ tree  /mongodb
├── log
│   └── mongodb.log
└── lost+found [error opening dir]

2 directories, 1 file
debian@wifi:~$ sudo service mongo  start
Failed to start mongo.service: Unit mongo.service failed to load: No such file or directory.
debian@wifi:~$ sudo service mongodb   start
debian@wifi:~$ sudo service mongodb   status
● mongodb.service - An object/document-oriented database
   Loaded: loaded (/lib/systemd/system/mongodb.service; enabled)
   Active: failed (Result: exit-code) since Thu 2017-08-31 19:59:46 EDT; 2s ago
     Docs: man:mongod(1)
  Process: 1873 ExecStart=/usr/bin/mongod --config /etc/mongodb.conf (code=exited, status=1/FAILURE)
 Main PID: 1873 (code=exited, status=1/FAILURE)

Aug 31 19:59:46 wifi mongod[1873]: all output going to: /mongodb/log/mongodb.log
Aug 31 19:59:46 wifi mongod[1873]: can't open [/mongodb/log/mongodb.log] for log file: errno:13 Permission denied
Aug 31 19:59:46 wifi mongod[1873]: Bad logpath value: "/mongodb/log/mongodb.log"; terminating.
Aug 31 19:59:46 wifi systemd[1]: mongodb.service: main process exited, code=exited, status=1/FAILURE
Aug 31 19:59:46 wifi systemd[1]: Unit mongodb.service entered failed state.

Why can't start mongodb?

  • Type df -h and update your question with the output. – ryekayo Aug 31 '17 at 15:45
  • based on your other labels, that appears to be an (entire?) "Arch" partition/installation, yet you're asking about a specific filesystem; maybe? Is /mongodb just a directory, or an entire filesystem? – Jeff Schaller Aug 31 '17 at 21:57
  • 2
    appears from this answer that you just need to change the ownership to the mongodb user. – Jeff Schaller Sep 1 '17 at 0:30

It seems is already mounted man; lost+found is the EXT4 directory for retreived file that fsck found when you launch it for FS problems

so, in a few words, you have already mounted your FS. Try to post a:

df -h /mongodb
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.