Is the /data directory a root directory or was it created during the lab? And if it is a built-in directory, does it require user access? Thank you.
“/data” is not a standard directory in Linux or Unix, it was created manually by someone.
Also, the term “root directory” refers to the topmost directory in the directory tree. For most purposes on Linux this is only “/” and nothing else. More info here.
Which course or lab are you working on? Whether the user running MongoDB needs access to the directory depends on the lab or exercise you’re doing.
Either your user or the user who runs the
mongod process should own
/data. You can make this change with
sudo chown -R `whoami` /data