How many mount binds can Linux handle

For various reasons I was wondering how many mount binds linux can handle (Lucid 32bit).

I wrote a little script to test.

#!/bin/bash

for i in {1..65536}
do
mi="/test_mount/$i"
mib="/test_mount/"$i"_bind"
echo "mount $mi $mib"
mkdir $mi
mkdir $mib
mount --bind $mi $mib
done

It ran

[email protected]:/vagrant# mount|wc -l
65551

I am sure it can handle more, but I am bored with this endeavor now. 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *