Hi,
I would like to change the owner of a directory on the sdcard
/sdcard/aDirectory
I have a terminal installed on my Android 10 (LineageOS 17)
com.android.terminal
sudo is not present so I use su and it works.
su
#Terminal was granted Superuser rights
cd /sdcard
chown 10:10 aDirectory
#I don't get any error message.
stat aDirectory
#Uid (0/root)
So the owner stay root no matter what I’m doing, any ideas ?
Nine times out of ten, running chown on Android is an astronomically bad idea. 10 times of 10, what you’re trying to do right now, is an astronomically bad idea.
What is it you are trying to do? Or rather, why?
What filesystem do you have on that SD-card? Likely FAT32, which does not support ownership.
But is it an SD card.
I mean, the directory name says so, but…
~ $ realpath /sdcard /storage/emulated/0 ~ $…it may also not be.
deleted by creator
Unless the SD card is using a Linux filesystem, you won’t be able to use Linux access permissions.
Most SD cards are preformatted to FAT or exFAT in order to maximise compatibility. If you don’t need to use the card on any non-linux devices you should be able to reformat it and gain the ability to chown/chmod (should go without saying, but back up any data on the card you want to keep before this)
Thanks all for your input !
So yes
/sdcardwas/storage/emulated/0and it’s a real sd-card.That was indeed formatted as
FAT, I reformatted intoEXT4(from a desktop Linux) put the SD-card back into the phone and started the phone.Ive tried (in the phone)
su chmod 777 /storage/emulated/0 #yes it's still mounted as emulated ! stat /storage/emulated/0 #... #Access: (0771) #....So I’m still blocked… any ideas ?
Thanks.





