X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EB53F3858404
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1701425850;
	bh=xdvhW5Ke5s4KlqD8hwzv7iI7hMPbo4/Wty+GRoCU9+k=;
	h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
	 From;
	b=Hs2odwtcHmFVbRYlGcIPp+oOd6MUHI1DDVMXmQ5l1G40d56JSbKcKl1MwFw7xHRKu
	 T73sfgzqag4P2zkPRcT/At31RU03TeuFwwTqJQRRlSfnHcYhBfgJ2tw5qzYIvIGhk1
	 zIGayX85Z2gHWfngt6UlPIQgwDOoUACcY+yZLyto=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DFF933858C20
Date: Fri, 1 Dec 2023 11:17:12 +0100
To: cygwin@cygwin.com
Subject: Re: Cygwin mount limited to 64 mounts, even for UNC paths?
Message-ID: <ZWmyqGWfZEIfm7OH@calimero.vinschen.de>
Mail-Followup-To: cygwin@cygwin.com
References: <CANH4o6N98YJMB3YKevQSDgshn4DqL0rkK7LW3L_yuULm1ravOA@mail.gmail.com>
 <1463776016.20231201045528@yandex.ru>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1463776016.20231201045528@yandex.ru>
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.30
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Corinna Vinschen via Cygwin <cygwin@cygwin.com>
Reply-To: cygwin@cygwin.com
Cc: Corinna Vinschen <corinna-cygwin@cygwin.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cygwin-bounces+archive-cygwin=delorie.com@cygwin.com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie.com@cygwin.com>

On Dec  1 04:55, Andrey Repin via Cygwin wrote:
> Greetings, Martin Wege!
> 
> > Cygwin mount(1) is (per docs) limited to 64 mounts. Why was that
> > limitation chosen, and does it  apply even if I create bind mounts to
> > UNC paths (not DOS letters)? DOS letters might be restricted by the
> > ASCII A-Z, but UNC paths are unlimited.
> 
> More interesting question is: why do you need so many _Cygwin_ mounts?
> There's a lot of other options, from NTFS junctions to using UNC paths
> directly (Cygwin tools aren't picky in this regard).

Indeed.

As for the number 64, it's arbitrary.  It has been raised from the
former 30 entries back in 2011.

Mount points are stored in the Cygwin's shared mem region for the user
account.  These shared regions are supposed to fit into a 64K mem
allocation block, and ideally still have a bit of room to spare for
future extension.  Right now the cygwin-user-shared block is 36K in
size, so there's some room left.

However, the longer the mount table, and the more it's filled, the
slower path evaluation gets.  And yes, bind mounts fill it, too.

Instead of adding lots of mount points to /etc/fstab, only add the
ones you *really* need to be globally available, and add only
the ones a user *really* needs to /etc/fstab.d/$USER.

Everything not really necessary are best handled by just using UNC paths
directly, or mounting to drive letter and using the /cygdrive prefix (or
change it to your liking, like /mnt).

You can also just create symlinks.  For instance:

  $ pwd
  /home/user
  $ ln -s //server/share/foo/bar bar
  $ cd bar
  $ pwd
  //server/share/foo/bar
  $

No mounts required.


Corinna

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
