Android_storage permissions

i have recently reinstalled sailfish 4.5 on xperia xa2, then upgraded to 4.6.13 immediately.

then i noticed android_storage section in gallery doesn’t show previews. and when i was entering it, everything was showing ‘empty’.
however, android storage worked, just it wasn’t visible for sailfish user apps.

then i started to mess up with permissions of android_storage: defaultuser:media_rw, media_rw:media:rw, defaultuser:defaultuser… now it is worse, some apps cannot write, reporting that probably there is no free space, but that’s me messed up with permissions.

what are the correct permissions (chown and chmod) for android_storage and its subdirectories?

thank you.

1 Like

someone also told me eventually, that on their xa10plus android_storage is chowned as media_rw:media_rw, and its content mostly 10036:10036, except for Android directory: media_rw:media_rw. and on xa2 it worked, in the sense that i restored what was before, now android apps work, but still android_storage feels disabled in the gallery.

I reflashed my Xperia 10 iii yesterdsy abd strangely cannot access the files under android_storage, which never was a problem in my previous installs.
apparently the read (and other) rights are set incorrectly


does anyone else have this problem? What are correct permission and owners?

Same for me, flashed fresh Sauna 4.6 onto my Xperia10iii, now can’t access android_storage without root because of permissions.

Update: This is how it looks for me:

[defaultuser@Xperia10III ~]$ devel-su ls -l
Password:
total 40
drwxrwxr-x    2 defaultu defaultu      4096 Jun 13 11:43 Desktop
drwxrwxr-x    2 defaultu defaultu      4096 Jun 13 11:43 Documents
drwxrwxr-x    2 defaultu defaultu      4096 Jun 13 11:43 Downloads
drwxrwxr-x    2 defaultu defaultu      4096 Jun 13 11:43 Music
drwxrwxr-x    5 defaultu defaultu      4096 Jul 11 11:09 Pictures
drwx------    2 defaultu privileg      4096 Jun 13 11:43 Playlists
drwxr-xr-x    2 defaultu defaultu      4096 Jun 13 11:43 Public
drwxr-xr-x    2 defaultu defaultu      4096 Jun 13 11:43 Templates
drwxrwxr-x    4 defaultu defaultu      4096 Jul 11 00:23 Videos
drwxrwx---   14 501023   appsuppo      4096 Jul 11 00:26 android_storage
[defaultuser@Xperia10III ~]$ devel-su ls -l android_storage/
Password:
total 48
drwx------    2 510036   510036        4096 Jul 11 00:26 Alarms
drwxrws--x    5 501023   appsuppo      4096 Jul 11 00:26 Android
drwx------    2 510036   510036        4096 Jul 11 00:26 Audiobooks
drwx------    2 510036   510036        4096 Jul 11 00:26 DCIM
drwx------    2 510036   510036        4096 Jul 11 00:26 Documents
drwx------    2 510036   510036        4096 Jul 11 10:57 Download
drwx------    3 510036   510036        4096 Jul 11 00:26 Movies
drwx------    3 510036   510036        4096 Jul 11 00:26 Music
drwx------    2 510036   510036        4096 Jul 11 00:26 Notifications
drwx------    4 510036   510036        4096 Jul 11 06:20 Pictures
drwx------    2 510036   510036        4096 Jul 11 00:26 Podcasts
drwx------    2 510036   510036        4096 Jul 11 00:26 Ringtones
[defaultuser@Xperia10III ~]$ grep '510036\|501023' /etc/passwd
[defaultuser@Xperia10III ~]$ grep '510036\|501023' /etc/group
appsupport-media_rw:x:501023:appsupport-root
[defaultuser@Xperia10III ~]$

Update: When adding defaultuser to the appsupport-media_rw group and rebooting, I can enter the android_storage folder, but can’t go deeper because of permissions:

devel-su usermod -aG appsupport-media_rw $USER

Here are the permissions on my phone where I’m not experiencing any problems (either access Android storage from the command line as defaultuser or using the Gallery app):

[defaultuser@kolbe ~]$ ls -lhd android_storag*
drwxrwx---   14 501023   appsuppo    4.0K Feb  2  2023 android_storage
[defaultuser@kolbe ~]$ ls -lh android_storage
total 96K    
drwxrwxr-x    2 501023   appsuppo    4.0K Jun 18  2022 Alarms
drwxrws--x    5 501023   appsuppo    4.0K Feb  2  2023 Android
drwxrwx---    2 510048   510048      4.0K Feb  2  2023 Audiobooks
drwxrwxr-x    3 501023   appsuppo    4.0K Mar 18 12:55 DCIM
drwxrwx---    2 510048   510048      4.0K Feb  2  2023 Documents
drwxrwxr-x    2 501023   appsuppo    4.0K Jun 18  2022 Download
drwxrwxr-x    3 501023   appsuppo    4.0K Feb  2  2023 Movies
drwxrwxr-x    3 501023   appsuppo    4.0K Feb  2  2023 Music
drwxrwxr-x    2 501023   appsuppo    4.0K Jun 18  2022 Notifications
drwxrwxr-x    5 501023   appsuppo    4.0K Jul 11 21:57 Pictures
drwxrwxr-x    2 501023   appsuppo    4.0K Jun 18  2022 Podcasts
drwxrwxr-x    2 501023   appsuppo    4.0K Jun 18  2022 Ringtones

If I change the permissions of my Pictures folder to the same as yours, I then experience what sounds like similar issues. Then when I change them back, everything works again:

[defaultuser@kolbe ~]$ devel-su chmod 700 ~/android_storage/Pictures
# Images in Android storage can't be accessed from the Gallery app
[defaultuser@kolbe ~]$ devel-su chmod 775 ~/android_storage/Pictures
# Gallery app shows Android storage fine

My permissions are for Sailfish OS 4.6 but following an upgrade, not a fresh install.

1 Like

Thanks but that alone won’t fix it, because for me the group is still that weird nonexisting 510036. Maybe I should change that to the appsupport-media_rw? Because apparently one can’t be added to a nonexistant group.

With the following It seems I can now work normally:

  • see Android images in the SFOS gallery (after tracker db reset in SFOS utilities)
  • access the common folders such as Android Downloads from SFOS file manager
[defaultuser@Xperia10III android_storage]$ sudo chgrp -R appsupport-media_rw Download/ Audiobooks/ DCIM/ Music/ Pictures/ Movies/ Podcasts/
[defaultuser@Xperia10III android_storage]$ sudo find  Download/ Audiobooks/ DCIM/ Music/ Pictures/ Movies/ Podcasts/ -type d -print0 | xargs -0r sudo chmod g+x
[defaultuser@Xperia10III android_storage]$ sudo chmod g+rw -R  Download/ Audiobooks/ DCIM/ Music/ Pictures/ Movies/ Podcasts/
1 Like

This commands fixed the problem, thanks!

1 Like