MuntashirAkon/AppManager · error · IOException

Mount point ( ) is already in use.

Error message

Mount point (%s) is already in use.

What it means

VirtualFileSystem.mount (static, package-private) refuses to mount a filesystem when the requested mount point Uri is already registered in sUriVfsIdsMap and the options don't carry the remount flag. This prevents two filesystems from shadowing the same mount point; an IOException naming the Uri is thrown.

Solutions

  1. Unmount the existing filesystem at that mount point first (VirtualFileSystem.unmount(mountPoint)), then mount.
  2. Pass remount=true in MountOptions if the intent is to re-mount over the same point.
  3. Guard mounting code with a check of VirtualFileSystem.getFileSystem(mountPoint) != null to skip already-mounted points.
  4. Debounce/idempotence-protect user-triggered mount actions.

Example fix

// before
VirtualFileSystem.mount(mountPoint, options);
// after
if (VirtualFileSystem.getFileSystem(mountPoint) == null) {
    VirtualFileSystem.mount(mountPoint, options);
}
Defensive patterns

Strategy: validation

Validate before calling

if (VirtualFileSystem.getFileSystem(mountPoint) != null && !options.remount) {
    VirtualFileSystem.unmount(mountPoint); // or skip mounting
}

Try / catch

try {
    VirtualFileSystem.mount(mountPoint, options);
} catch (IOException e) {
    if (String.valueOf(e.getMessage()).contains("already in use")) {
        VirtualFileSystem.unmount(mountPoint);
        VirtualFileSystem.mount(mountPoint, options);
    } else throw e;
}

Prevention

When it happens

Trigger: Calling mount() twice with the same mount point without unmounting; mounting after a previous session's mount is still registered in the process; auto-mount code running again on a configuration change without remount=true.

Common situations: Re-running a mount routine on app restart while the old mount is still alive; two features both mounting at the same path; duplicate user action (double-tap on 'Mount').

Related errors


AI-assisted analysis of MuntashirAkon/AppManager@0152f468fc (2026-09-12). Data as JSON: /api/errors/f268614d80e9a8ec. Report an issue: GitHub.

Appendix: source

Thrown at app/src/main/java/io/github/muntashirakon/io/fs/VirtualFileSystem.java:155

    }

    @WorkerThread
    public static int mount(@NonNull Uri mountPoint,
                            @NonNull Path file,
                            @NonNull String type,
                            @NonNull MountOptions options)
            throws IOException {
        return mount(mountPoint, getNewInstance(file, type), options);
    }

    @WorkerThread
    private static int mount(@NonNull Uri mountPoint, @NonNull VirtualFileSystem fs, @NonNull MountOptions options)
            throws IOException {
        int vfsId;
        synchronized (sFileSystems) {
            synchronized (sUriVfsIdsMap) {
                if (!options.remount && sUriVfsIdsMap.get(mountPoint) != null) {
                    throw new IOException(String.format("Mount point (%s) is already in use.", mountPoint));
                }
            }
            do {
                vfsId = ThreadLocalRandom.current().nextInt(1, Integer.MAX_VALUE);
            } while (vfsId == 0 || sFileSystems.get(vfsId) != null);
            fs.mount(mountPoint, vfsId, options);
            sFileSystems.put(vfsId, fs);
        }
        synchronized (sUriVfsIdsMap) {
            sUriVfsIdsMap.put(mountPoint, vfsId);
        }
        synchronized (sParentUriVfsIdsMap) {
            Uri uri = Paths.removeLastPathSegment(mountPoint);
            List<Integer> vfsIds = sParentUriVfsIdsMap.get(uri);
            if (vfsIds == null) {
                vfsIds = new ArrayList<>(1);
                sParentUriVfsIdsMap.put(uri, vfsIds);
            }

View on GitHub (pinned to 0152f468fc)