Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.
  • 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?

share|improve this question
    
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. –  ire_and_curses Dec 21 '12 at 16:57
1  
sudo service mongod start will run service as root, whoever you are when you launch that command. –  Mat Dec 21 '12 at 17:16
add comment

3 Answers

up vote 2 down vote accepted

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 ;)

share|improve this answer
    
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 –  LittleBobbyTables Dec 24 '12 at 18:45
add comment

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

share|improve this answer
add comment

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'.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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