# VFS Mount to SMB gets rate-limited due to initial stat checks

**URL:** <https://forum.rclone.org/t/vfs-mount-to-smb-gets-rate-limited-due-to-initial-stat-checks/52479>\
**Category:** Feature\
**Created:** [September 9, 2025, 3:01pm UTC](https://forum.rclone.org/t/vfs-mount-to-smb-gets-rate-limited-due-to-initial-stat-checks/52479 "2025-09-09T15:01:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sudiptob2](https://forum.rclone.org/user_avatar/forum.rclone.org/sudiptob2/32/20432_2.png) [@sudiptob2](https://forum.rclone.org/u/sudiptob2)\
**Post date:** [September 9, 2025, 3:01pm UTC](https://forum.rclone.org/t/vfs-mount-to-smb-gets-rate-limited-due-to-initial-stat-checks/52479/1 "2025-09-09T15:01:24Z")

</div>

When using the **combine** backend with SMB in rclone, the initial VFS mount performs a `stat` check to determine whether each mount point is **a directory or a file.**

If there are **hundreds or thousands of mount points** in a combined backend setup, rclone performs a `stat` check for each mount point during VFS initialization. Each check triggers a `NewFs()` call, which opens a separate connection to the server. This creates a burst of connections, causing the mount process to get rate-limited

[Relevant code section:](https://github.com/rclone/rclone/blob/fd1665ae939bf45be102323967c8bcfc60a71635/backend/smb/smb.go#L217-L235)

```go
	share, dir := f.split("")
	if share == "" || dir == "" {
		return f, nil
	}
	cn, err := f.getConnection(ctx, share)
	if err != nil {
		return nil, err
	}
	stat, err := cn.smbShare.Stat(f.toSambaPath(dir))
	f.putConnection(&cn, err)
	if err != nil {
		// ignore stat error here
		return f, nil
	}
	if !stat.IsDir() {
		f.root, err = path.Dir(root), fs.ErrorIsFile
	}
	fs.Debugf(f, "Using root directory %q", f.root)
	return f, err

```

#### Steps to Reproduce

1. Configure SMB and combine backends in `rclone config`: Assume we have 1000s of mount points.

```bash
[smb.server.example]
type = smb
host = <ip-address>
user = <username>
pass = <password>

[smb.server.example-combine]
type = combine
upstreams = share-1=smb.server.example:volumeA/data/share-1 \
            share-2=smb.server.example:volumeA/data/share-2 \
            share-3=smb.server.example:volumeA/data/share-3 \
            share-4=smb.server.example:volumeA/data/share-4 \
            share-5=smb.server.example:volumeA/data/share-5

```

1. Mount the combined backend:

```bash
rclone mount smb.server.example-combine: /mnt/ \
  --vfs-cache-mode writes \
  --links \
  --log-level DEBUG

```

#### Potential Solution:

One potential solution I can think of is to bring the directory check under some advanced flag. If the user is certain that all their mount points are directories, they could opt out of the check and avoid hitting rate limits.

Please let me know if there is a better way to solve this problem. Happy to contribute.

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [September 9, 2025, 9:14pm UTC](https://forum.rclone.org/t/vfs-mount-to-smb-gets-rate-limited-due-to-initial-stat-checks/52479/2 "2025-09-09T21:14:00Z")

</div>

The way we've made this efficiency improvement in other backends (eg S3) is if the remote path is "" or ends with a / it must be a directory.

This would avoid the initial check.

Fancy giving that a go?

---

<div class="post-metadata">

**Author:** ![sudiptob2](https://forum.rclone.org/user_avatar/forum.rclone.org/sudiptob2/32/20432_2.png) [@sudiptob2](https://forum.rclone.org/u/sudiptob2)\
**Post date:** [September 12, 2025, 2:15pm UTC](https://forum.rclone.org/t/vfs-mount-to-smb-gets-rate-limited-due-to-initial-stat-checks/52479/3 "2025-09-12T14:15:16Z")

</div>

Thank you so much for sharing this neat approach! This method resolves the initial **stat check issues** on **Linux**. However, on **Windows** , the [About()](https://github.com/rclone/rclone/blob/35fe609722ebece0e694dfa8bf4e0212c033bd26/backend/smb/smb.go#L480) method is also called during initialization, to fetch **usage stats** , which still triggers a connection burst at startup.

I experimented with disabling the `About()` method, and it seems to work for our use case. Do you have any suggestions on a better way to avoid this `About()` call at startup? Happy to contribute.

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [September 12, 2025, 10:03pm UTC](https://forum.rclone.org/t/vfs-mount-to-smb-gets-rate-limited-due-to-initial-stat-checks/52479/4 "2025-09-12T22:03:14Z")

</div>

You can use `--disable About` on the command line. That should work.

---

<div class="post-metadata">

**Author:** ![system](https://forum.rclone.org/uploads/default/original/2X/3/39ad3235f6ffec76ccd0c81616bd55697b4c300d.png) [@system](https://forum.rclone.org/u/system)\
**Post date:** [November 11, 2025, 10:03pm UTC](https://forum.rclone.org/t/vfs-mount-to-smb-gets-rate-limited-due-to-initial-stat-checks/52479/5 "2025-11-11T22:03:37Z")

</div>

Closed on November 11, 2025, 10:03pm UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
