Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

OpenVZ file system (simfs) has a limit of files per folder. We reached that limit and we are in trouble...

Which is the best approach to this problem?

Thank's in advance!

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Put your files in sub folders.

share|improve this answer
    
I finally managed to store the files using subfolders by using md5 over the route and splitting on groups of two (like /a2/rt/gf/5y/sdfadsfasdfa3423.png) –  masylum Nov 4 '10 at 10:21

How many files per directory do you have when you reach the limit?

I would first check that there are no fail counts in /proc/bc/resources. Maybe one of the following are set too low in the config file:

NUMFILE="9312:9312"
DISKINODES="2000000:2200000"

Getting a real fs inside a container with bind mounts

If you are really hitting the max number of files per directory and and you can't move your files to sub directories, then you can pretty easily get a real filesystem (ext3, xfs, ...) inside the container.

http://wiki.openvz.org/Bind_mounts

Delegating a block device

You can also delegate a whole block device to a container and mount a real filesystem from that block device during boot by placing an entry into /etc/fstab inside the container. See the vzctl(8) --devices b argument. Also check /proc/filesystems inside your container to see what filesystems are available.

share|improve this answer
    
I had 31998 files, so I guess the limit was 32k... I finally managed to store the files using subfolders by using md5 over the route and splitting on groups of two (like /a2/rt/gf/5y/sdfadsfasdfa3423.png) –  masylum Nov 4 '10 at 10:20

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.