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.

2 Likes

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/
4 Likes

This commands fixed the problem, thanks!

3 Likes

Great! Solution works for me as well. Thank you!

Also I used SFOS terminal locally. Thus I had to change to devel-su instead of sudo (setting developer options in SFOS settings first)

devel-su 

chgrp -R appsupport-media_rw Documents/ Download/ Audiobooks/ DCIM/ Music/ Pictures/ Movies/ Podcasts/
find  Documents/ Download/ Audiobooks/ DCIM/ Music/ Pictures/ Movies/ Podcasts/ -type d -print0 | xargs -0r chmod g+x 
chmod g+rw -R Documents/ Download/ Audiobooks/ DCIM/ Music/ Pictures/ Movies/ Podcasts/

Cheers

3 Likes

Having the same problem, tried the same commands but seems that no folder is found

Any suggestion?is getting quite irritating…

Did you walk to Android storage first?

You have to change to the right directory first using cd android_storage.

Look at the prefix of the terminal…

cheers :smiley:

Done it, but still gallery can’t access photos and so on,

Wonder if there something more systemwide, cause i can’t set permissions for every android folder…

What if i do the same but for android_storage rather than individual folders?

Don’t know if this will work :confused:

I’d rather check permissions first ls -la in /android_storage. In my system it’s:

[defaultuser@Xperia10III android_storage]$ ls -la
total 68
drwxrwx---   16 501023   appsuppo      4096 Aug  3 07:25 .
drwxr-x---   18 defaultu defaultu      4096 Aug 16 16:10 ..
drwx------    4 510036   510036        4096 Jul 28 14:28 .aptoide
drwx------    4 510036   510036        4096 Aug  3 07:25 .here-maps
-rw-r--r--    1 root     root             7 Jul 26 23:27 .privilege_migration_done
drwx------    2 510036   510036        4096 Jul 26 23:28 Alarms
drwxrws--x    5 501023   appsuppo      4096 Jul 26 23:28 Android
drwxrwx---    2 510036   appsuppo      4096 Jul 26 23:28 Audiobooks
drwxrwx---    2 defaultu appsuppo      4096 Jul 27 20:48 DCIM
drwxrwx---    3 defaultu appsuppo      4096 Jul 28 18:48 Documents
drwxrwx---    3 defaultu appsuppo      4096 Aug 10 14:50 Download
drwxrwx---    3 510036   appsuppo      4096 Jul 26 23:28 Movies
drwxrwx---    3 510036   appsuppo      4096 Jul 26 23:28 Music
drwx------    2 510036   510036        4096 Jul 26 23:28 Notifications
drwxrwx---    3 defaultu appsuppo      4096 Aug  3 11:44 Pictures
drwxrwx---    2 510036   appsuppo      4096 Jul 26 23:28 Podcasts
drwx------    2 510036   510036        4096 Jul 26 23:28 Ringtones
[defaultuser@Xperia10III android_storage]$

Adjusting permission should be possible with devel-su…

Good luck!

Ok, these are mine, what about, changing permissions but for the android folder directly?

Edit: tried and didn’t change a thing, i hope someone more experienced will suggest me a better solution

Or that anyway jolla solves the situation

I also created a zendesk ticket about this as i feel jolla should take care of such a basic thing (manage memory on appsupport)

Puhh… It’s the end of my understanding.

Permissions look fine for me. Last thing I could think of is a reboot. SFOS seems to need them from time to time… :smiley:

But you can give it a try with android_storage folder…

tried just now with the android folder (it’s the edit i was talking about) but it didn’t help

i also removed appsupport in the brutal way suggested by jolla docs and got no results at all

changing permissions from folder to folder seems to work but should be done for all subfolders too and it’s damn tedious

eg. i didn’t have access to DCIM, now i have it but not for it’s camera subfolder

and i rebbot my phone everynight, so no it’s not the reboot

thank you for you help anyway :slight_smile: i hope i will be able to solve this very irritating issue…

Thank you for reporting. Culprit found.

6 Likes

Does this imply that there is a solution to it? If so, what do we need to do?

1 Like

To me it does imply it will be fixed in next update