Skip to content

[cas] Secondary user emulated FUSE volume stuck UNMOUNTABLE - "Failed to start FUSE", persists across reboot and user rebuild #549

Description

@keepaway-mi

Device Codename

cas

LineageOS Version

lineage-23.2

Build Date

20260901

Kernel Version

4.19.325-cip131-st15-perf-g71b13e62f057

Baseband Version

2.5.c1-50.1a-14515.23-0521_0210_d46c7e8c13

System Modifications

MindTheGapps

Expected Behavior

The emulated external-storage FUSE volume of a secondary user should mount and stay mounted
(emulated;<u> in sm list-volumes = mounted), so that apps running in the secondary user
can access their external-storage directories.

Current Behavior

At some point during normal use (no obvious trigger; the device had been used normally for days,
and apps in the secondary user worked fine initially), the secondary user's emulated FUSE volume
flips to UNMOUNTABLE and never recovers. sm list-volumes shows:

emulated;0  mounted
emulated;10 unmountable

Every app in the secondary user that touches external storage then crashes on launch with
NullPointerException (e.g. getExternalFilesDir() returning null). This looks similar to the
app-dirs-creation issue, but the root cause is different.

The failure is persistent and not repairable:

  • Reboot → the fresh secondary user's volume is unmountable from its very first start.
  • Deleting the secondary user and creating a brand-new one → the fresh user's volume is
    unmountable as well (proves the corrupted state is not per-user data).
  • Killing com.android.providers.media.module for that user + sm reset + user-switch cycles →
    FUSE start fails every time.
  • vdc volume mount "emulated;<u>" is refused ("Raw commands are no longer supported");
    sm unmount/mount retries fail identically.

Logcat signature (full log: see linked gist):

E StorageManagerService: Failed to start session: [SessionId: emulated;10.
    UpperPath: /storage/emulated. LowerPath: /data/media]
E StorageManagerService: Caused by: java.lang.IllegalStateException: Failed to start FUSE
I vold    : Mounting emulated fuse volume
E FuseDaemon: ERROR: failed to stat source /storage/emulated: Permission denied
I FuseDaemonThread: Exiting thread for emulated;10 ...
E FuseDaemon: Failed to query component interface for required system resources: 6
I StorageSessionController: Unmounting emulated;10

Root-cause chain (diagnosed live via adb root)

  1. /mnt/runtime/full/emulated — the global "full view" that should be a bind of /data/media
    is an empty directory on the affected device (verified while user 0's volume was healthy).
  2. vold therefore binds an empty view to /mnt/pass_through/<u>/emulated.
  3. A freshly forked com.android.providers.media.module process for the secondary user runs with
    MOUNT_EXTERNAL_PASS_THROUGH; in its mount namespace /storage/emulated is an empty tmpfs with
    mode 700 (drwx------ root root).
  4. FuseDaemon fails at stat("/storage/emulated") with EACCES → session start fails after ~5 s →
    vold tears down all the binds → chicken-and-egg on every retry.
  5. fscrypt CE unlock and /data/media/<u> contents are fine (verified; not an encryption or
    data-loss problem).

Manual repair experiments (advance past layers 1–4, blocked at layer 5)

# fixes the empty global full view (verified: 0/, 10/, obb/ visible afterwards)
mount --bind /data/media /mnt/runtime/full/emulated
# rebuild per-user pass_through bind (vold teardown removes it on every failed retry)
mkdir -p /mnt/pass_through/<u>/emulated
mount --bind /mnt/runtime/full/emulated /mnt/pass_through/<u>/emulated
am force-stop --user <u> com.android.providers.media.module
sm mount "emulated;<u>"

After this, failed to stat source: Permission denied disappears and the FuseDaemon thread
starts, but it still exits immediately with:

E FuseDaemon: Failed to query component interface for required system resources: 6

This appears to be inside the FuseDaemon↔MediaProvider integration path, with no external
interface reachable via adb. Case studies of similar "Failed to start FUSE" failures suggest
SELinux-policy-level fixes.

Steps to Reproduce

  1. Flash official lineage-23.2-20260901-nightly-cas-signed.zip + MindTheGapps.
  2. Create a secondary user, use the device normally for some days.
  3. At some point the secondary user's volume flips to UNMOUNTABLE (observed spontaneously during
    normal app use; also observed immediately after adb root sessions).
  4. Observe sm list-volumes and the launching apps crashing with NPE.
  5. Reboot and/or delete + recreate the secondary user → failure persists.

Possible Solution

Unknown from the outside; the final failure (Failed to query component interface for required system resources: 6) and the empty /mnt/runtime/full/emulated view both point at the
vold/StorageManagerService/FUSE daemon multi-user session setup path.

Full logcat

Full logcat: https://github.com/keepaway-mi/lineageos-cas-bug-logs/blob/main/fuse-unmountable-logcat.txt (captured immediately after re-triggering the failure via user switch and sm mount retry)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions