[Android Q&A, Help & Troubleshooting] rysson_:
Hi All,

I have LineageOS 14.1-20180302 on my rooted Samsung Galaxy S5 (SM-G900F, klte).

Linux localhost 3.4.113-lineageos-gb020661 #1 SMP PREEMPT Fri Mar 2 13:43:58 CET 2018 armv7l

I use adopted SD card. Some time ago I had a problem after update (and next, after each reboot) – SD card was not available.

Link /sdcard returns error. I went by many symbolic links and there was empty /mnt/user/0. I just typed after each reboot:

ln -s /mnt/expand/22b48691-7d4a-41ee-8643-b78f7197bfb2/media/0 /mnt/user/0/primary

And it looked that worked.

Last time I found some error message on flashing. TWRP complains that can mount /system. Update process want up to 70..90% and hanged.

Wipe /system was not enough, I changed FS type to ext4 again, it creates new partition I guess. I flesh everything (ROM, OpenGapps, and su addon).

Now I have no SD card visible. Android shows „SD Card not inserted”. Many apps just crash. There is no /storage/emulated.

Surprise, /mnt/expand/UUID is mounted and it is working. I have access to all files in shell (adb). The same in TWRP.

I've tried to create symbolic links:

mkdir /storage/emulated
/storage/emulated/0 -> /mnt/expand/[I]UUID[/I]/media/0

It doesn't help. Android (apps) doesn't see it.

Only Total Commander show "Unknown SD" and can display SD data.

In another system (SM-9100) I see /storage/emulated is mounted via fuse. I've read fuse is used to access the sdcard while the OS is using the sdcard as well and for manages permissions.

I don't know hot to force my G900F Android to mount /storage/emulated via fuse.

Some more details...

sm list-disks, sm list-disks adoptable show nothing

sm list-volumes all shows only private mounted null

# cat /proc/partitions
...
179 64 60751872 mmcblk1
179 65 16384 mmcblk1p1
179 66 60734447 mmcblk1p2
253 0 60734447 dm-0

# mount | grep expand
/dev/block/dm-0 on /mnt/expand/[I]UUID[/I] type f2fs (rw,seclabel,nosuid,nodev,noatime,background_gc=on,user_xattr,acl,inline_data,flush_merge,extent_cache,mode=adaptive,active_logs=6)

Some logs:

03-30 21:44:51.168 302 306 D vold : private:179_66 passed filesystem check
03-30 21:44:51.060 302 306 V vold : /dev/block/dm-0: UUID="UUID" TYPE="f2fs"
03-30 21:44:51.403 302 306 V vold : Starting restorecon of /mnt/expand/UUID
03-30 21:50:27.941 302 306 V vold : Finished restorecon of /mnt/expand/UUID
03-30 21:50:29.434 302 307 D vold : e4crypt_prepare_user_storage for volume UUID, user 0, serial 0, flags 3
03-30 21:50:29.441 302 307 D vold : Preparing: /mnt/expand/UUID/user_de/0
03-30 21:50:29.441 302 307 D vold : Preparing: /mnt/expand/UUID/media/0
03-30 21:50:29.441 302 307 D vold : Preparing: /mnt/expand/UUID/user/0
03-31 10:46:21.454 302 7262 D vold : Starting trim of /mnt/expand/UUID
03-31 10:46:28.011 302 7262 I vold : Trimmed 0 bytes on /mnt/expand/UUID in 6556ms

03-31 20:43:53.209 781 1016 I chatty : uid=1000(system) MountService expire 2 lines
03-31 20:43:53.281 781 1016 I chatty : uid=1000(system) MountService expire 2 lines
03-31 20:44:53.883 781 1016 I chatty : uid=1000(system) MountService expire 2 lines
03-31 20:52:15.993 781 1016 I chatty : uid=1000(system) MountService expire 1 line
03-31 20:52:20.990 781 1016 D MountService: Thinking about init, mSystemReady=true, mDaemonConnected=true
03-31 20:52:20.990 781 1016 D MountService: Setting up emulation state, initlocked=false
03-31 20:52:21.003 781 1016 D MountService: Thinking about reset, mSystemReady=true, mDaemonConnected=true
03-31 20:53:21.040 781 1016 W MountService: Failed to reset vold
03-31 20:53:21.040 781 1016 W MountService: com.android.server.NativeDaemonTimeoutException: command '45 volume reset' failed with 'null'
03-31 20:53:21.040 781 1016 W MountService: at com.android.server.NativeDaemonConnector.executeForList(NativeDaemonConnector.java:490)
03-31 20:53:21.040 781 1016 W MountService: at com.android.server.NativeDaemonConnector.execute(NativeDaemonConnector.java:401)
03-31 20:53:21.040 781 1016 W MountService: at com.android.server.NativeDaemonConnector.execute(NativeDaemonConnector.java:396)
03-31 20:53:21.040 781 1016 W MountService: at com.android.server.MountService.resetIfReadyAndConnected(MountService.java:898)
03-31 20:53:21.040 781 1016 W MountService: at com.android.server.MountService.handleDaemonConnected(MountService.java:981)
03-31 20:53:21.040 781 1016 W MountService: at com.android.server.MountService.-wrap7(MountService.java)
03-31 20:53:21.040 781 1016 W MountService: at com.android.server.MountService$MountServiceHandler.handleMessage(MountService.java:616)
03-31 20:53:21.040 781 1016 W MountService: at android.os.Handler.dispatchMessage(Handler.java:102)
03-31 20:53:21.040 781 1016 W MountService: at android.os.Looper.loop(Looper.java:154)
03-31 20:53:21.040 781 1016 W MountService: at android.os.HandlerThread.run(HandlerThread.java:61)
03-31 20:53:21.052 781 1016 W MountService: No primary storage mounted!
03-31 20:53:21.055 781 1016 I chatty : uid=1000(system) MountService expire 3 lines
03-31 20:53:21.234 781 1016 W MountService: No primary storage mounted!
03-31 21:00:16.167 781 818 W MountService: No primary storage defined yet; hacking together a stub
03-31 21:00:16.168 781 3615 W MountService: No primary storage defined yet; hacking together a stub
03-31 21:00:16.395 781 2841 W MountService: No primary storage defined yet; hacking together a stub

Anybody knows how to fix it? I want to my adopted SD cards back in Android. And I want to understand how it works in the best case.

Now even TitaniumBackup doesn't see /sdcard and I can't make a backup before I make full factory reset.

Regards,

rysson