8

Is there maximum numbers for file system mounts that Linux can handle? Is there differences between distros?

1

3 Answers 3

5

Linux can handle 1000s of mounts, in fact I have seen 12000 simultaneous automounts happen on SL7.3 (based on centos). However, things get very slow for users as applications try to process these mounts and umounts. SL7.4 can start kicking users out of xdm.

1
  • 1
    Vaguely alarming numbers from one server I have access to: mount | wc -l 119852
    – ddulaney
    Jan 25, 2022 at 0:01
5

There is a cap since Linux v4.9, the default value of the cap is 100,000.

https://github.com/torvalds/linux/commit/d29216842a85

I believe one of the problems if you accidentally create thousands and thousands of mounts, is that they can take a very long time to unmount.

The CVE mentions that once you have two many mounts, certain operations cane "cause a deadlock for the whole system." Memory consumption was also mentioned as a concern.

1

Most distros should be the same, because they all run fundamentally the same kernel. I'm not aware of a specific limit to the number of mounts, but I've seen several hundred at once, which I thought was bordering on the insane (but that's automounting for you).

7
  • 1
    Ok. What about tens of thousands of mounts? Don't ask me why but let's just assume that I need to mount 10000 volumes, is this technically possible?
    – Jim67
    Jan 14, 2010 at 9:36
  • 4
    I'm sorry, but "I need to mount 10,000 partitions" sounds like it's screaming for a different solution to whatever problem you think you're solving with all those mounts. Either that, or it's homework in disguise.
    – womble
    Jan 14, 2010 at 9:55
  • Should work, but for future administrator's sake, find another way of doing it. Jan 14, 2010 at 11:55
  • 2
    Careful with statements like "you should NEVER do...". ;) We handle hundreds of large files (>20GB) containing frames which contain packets. We need to be able to extract data at frame level and at packet level according to predetermined criteria. Using e.g. the fuse filesystem to take the raw frame stream and show a virtual folder with different kinds of files within it seems like a great way to radically reduce disk space use, improve read and write speed and reduce resource load. If that means that we would have to have hundreds of mount points 1 per .bin file), I'd say "fine". Mar 6, 2013 at 13:34
  • 1
    I'd like to create lots of chroots, each of which will contain several other directories bind-mounted inside... I don't expect it to hit 10,000 mounts, but theoretically there might be up to 1000 from what I can see. So it really would be interesting to know what the limit is. Is it a system-wide limit, or does it maybe depend on the parent filesystem, or is it basically only limited by available memory?
    – oliver
    May 26, 2014 at 14:30

You must log in to answer this question.