If you install MongoDB using apt-get
, the executable files and libraries will be installed to your OS drive. By default, the packaged version of MongoDB stores its data in /var/lib/mongodb
which, unless you've put part or all of your /var
directory on your larger drive, will also be on your OS drive.
If you want to install absolutely all the MongoDB files on your other drive, you would need to download the unpackaged binary distribution from the MongoDB website and install manually. However, I would advise against this; the binaries won't take up much space and installing the package is easier.
Instead, you can install the package and then change the location used to store the data. See How to change the location that MongoDB uses to store its data? for how to do this.