3
  • Im doing some big data integrations in MongoDB at the moment.
  • MongoDB's files are stored at /data/db
  • Scientific Linux has automatically setup root to have a small amount of disk space and me, bob to have a huge amount.

.

 [bob@bob etc]$ df -h
 Filesystem            Size  Used Avail Use% Mounted on
 /dev/mapper/vg_bob-lv_root
                        50G  5.5G   44G  12% /
 tmpfs                 7.7G  284K  7.7G   1% /dev/shm
 /dev/sda1             485M   43M  418M  10% /boot
 /dev/mapper/vg_bob-lv_home
                       1.8T  277M  1.7T   1% /home
 [bob@bob etc]$
  • For some reason, MongoDB is limited to root's disk quota - even though I've added bob to the sudoers and run sudo service mongod start as bob.
  • How can I let this spill over?

Essentially I would like to simply remove all disk quotas and let all users use however much they want.

What is the simplest way to do this?

2
  • The problem is your root partition is too small to hold your DB. If I were you, I'd just put the DB somewhere different, like in your home area: changing mogodb data storing directory. Dec 21, 2012 at 16:57
  • 1
    sudo service mongod start will run service as root, whoever you are when you launch that command.
    – Mat
    Dec 21, 2012 at 17:16

3 Answers 3

2

I don't use mongo but I would presume there is a way to configure its data directory, in which case your best bet might be to create a directory for it in /home and then use that instead of /data/db. You would want to do that as root, so the directory still has the correct owner. [see the last paragraph here for more about that...]

Another option is to use a symbolic (aka 'soft') link. First:

sudo mkdir -p /home/mongo/data/db

This creates the directory you are going to use within the 1.8 TB /home partition. Now check what the ownership and permissions are on /data/db and make sure they are duplicated for the new directory. Now move all the data from /data/db into that directory and delete the now empty inner db directory (but not /data itself). Next:

sudo ln -s /home/mongo/data/db /data/db

This creates a soft link from /data/db to /home/mongo/data/db; anything put into the former will actually go into the later, and likewise WRT to accessing the content (these two paths are linked and point to the same place, which is the one in /home). If you haven't used sym links like this before, they are a pretty handy general purpose *nix tool and very easy to understand. Google and read up on them.

Some software, generally outward facing servers, may have (optional) security restrictions to do with following symlinks. I did a quick web search to check about this WRT mongo and I don't think there is a problem, but in the process I did find this comment about the data directory, lol:

By default, mongod writes data to the /data/db/ directory. [...] You can specify, and create, an alternate path using the --dbpath option to mongod and the above command.

From: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-linux/ So there is another clue about your options ;)

1
  • Thanks for this! I took the even lazier route of deleting /data/db and simply running it as sudo mongod --dbpath /home/mongo & which works like a charm :D Dec 24, 2012 at 18:45
1

Run quota
If there are active quotas you can run quotaoff -a to disable all quota for current session. To permanetly disable quota edit /etc/fstab

0

You can also remove quota enforcement and maintence for a disk if you add the mount option for it in the /etc/fstab called 'noquota'.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .