After my NANDroid restore didn't work as expected, flashed a clean ROM + Magisk.
When booted to system, internal storage is not accessible (regular File Manager, MTP, adb shell, MiXplorer's Internal Storage).
But it is accessible via elevated rights (TWRP File Manager, MTP when in recovery mode, su in adb shell, Root option in MiXplorer).
Permission while in recovery and booted to system are respectively:
drwxrwxrwx 2 system system 4096 1970-01-01 18:21 sdcard
lrw-r--r-- 1 root root 21 2009-01-01 05:30 sdcard -> /storage/self/primary
--> Tried chmod -R 777 sdcard
with no luck. As it is a symlink, did chmod directly to /storage/self/primary
and /storage/emulated/0
but it doesn't have an effect.
--> Tried from scratch, wiping and formatting every partition and entire Internal Storage, tried older known working ROMs. Still the same.
Surely, it's a permissions issue. What am I missing?
chmod 777 /data/media/0
orchmod -R /data/media/0
chmod -R 777 sdcard
when in recovery (root) now resulted indrwxrwx--- 4 media_rw media_rw 4096 2022-06-06 14:44 sdcard