linuxdeploy
linuxdeploy copied to clipboard
Android 11 can't read mounted /sdcard/ ,bad adress
Before i update Android 10 to 11,it is normal.
ls /sdcard/
ls: cannot open directory '/sdcard/': Bad address
Same problem after upgrading LineageOS 17.1(Android 10)->18.1(Android 11). Redmi Note 5 Pro(Whyred).
https://github.com/meefik/linuxdeploy/issues/1248#issue-855538300
Switched out to LineageOS 18.1 and ran into the same issue, but found a work around. Looks like they changed how the sdcard/partition is accessed in Android 11. Used to be able to access it via /sdcard or /storage/emulated/0, but now at least /mnt/runtime/full/emulated/0 drops to the sdcard partition without the Bad Address error. The only other catch is they also changed permissions on the sdcard and gave root and the everybody(9997) group read/write access instead of the sdcard_rw group. So, your primary user will need to be in that group(aid_everybody in the /etc/group) to be able to read/write it. Be warned though if my user is in that aid_everybody group linux deploy won't start for me. I have to reconfigure the profile and then start the profile, but that pulls my user back out of that group, so just need a script to put the user back in that group since Linux Deploy won't allow me to keep it as a privileged user/group in the profile settings(guessing that's a bug). Hope this helps.
So, your primary user will need to be in that group(aid_everybody in the /etc/group) to be able to read/write it.
Yes, it worked in LineageOS17.1/Android10, but it doesn't work in Android11 anymore. After upgrade I can access sdcard only if login as root.
mount your sdcard from chroot and not from linux deploy and add your user to group to get access read& write without root/sudo.
mine is /dev/block/by-name/userdata
for sdcard and mount the device sudo mount /dev/block/by-name/userdata /media
.
to get access read&write:
sudo usermod -aG aid_media_rw,aid_system $USER
<- $USER or specific user you want to get access read&write.
It works for me by following these steps in Linux Deploy v2.6.0:
- Setting mount point
- Source:
/data/media/0
- Target:
/media/sdcard
- Adding user to group
aid_media_rw
- privileged users:
android:aid_inet android:aid_sdcard_rw android:aid_graphics android:aid_media_rw
- Tap STOP, run configure and then tap START ps: OnePlus 8T running OxygenOS(Android 11) tested
FYI: Found this / ROOT - Android SD-Card RW Remounter ยท GitLab changes r-w perm to 775 tested on LineageOS 17 ANDROID 10 also available on F-Droid
Switched out to LineageOS 18.1 and ran into the same issue, but found a work around. Looks like they changed how the sdcard/partition is accessed in Android 11. Used to be able to access it via /sdcard or /storage/emulated/0, but now at least /mnt/runtime/full/emulated/0 drops to the sdcard partition without the Bad Address error. The only other catch is they also changed permissions on the sdcard and gave root and the everybody(9997) group read/write access instead of the sdcard_rw group. So, your primary user will need to be in that group(aid_everybody in the /etc/group) to be able to read/write it. Be warned though if my user is in that aid_everybody group linux deploy won't start for me. I have to reconfigure the profile and then start the profile, but that pulls my user back out of that group, so just need a script to put the user back in that group since Linux Deploy won't allow me to keep it as a privileged user/group in the profile settings(guessing that's a bug). Hope this helps.
Thanks! It's worked for me!
[21:14:54] bcdev@localhost /home/bcdev
> sudo su
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
root@localhost /h/bcdev# groups bcdev
aid_graphics aid_sdcard_rw aid_inet bcdev
root@localhost /h/bcdev# usermod -aG aid_everybody bcdev
root@localhost /h/bcdev# groups bcdev
aid_graphics aid_sdcard_rw aid_inet aid_everybody bcdev
root@localhost /h/bcdev# # and finally we need to restart =)
Lineage os 18 santoni =)
Manjaro rootfs was easier to install than arch ๐ค (Because I didn't find clear aarch64 rootfs of archlinux ๐ ) And I had some issues with gpg, but it's easy to fix ๐
Switched out to LineageOS 18.1 and ran into the same issue, but found a work around. Looks like they changed how the sdcard/partition is accessed in Android 11. Used to be able to access it via /sdcard or /storage/emulated/0, but now at least /mnt/runtime/full/emulated/0 drops to the sdcard partition without the Bad Address error. The only other catch is they also changed permissions on the sdcard and gave root and the everybody(9997) group read/write access instead of the sdcard_rw group. So, your primary user will need to be in that group(aid_everybody in the /etc/group) to be able to read/write it. Be warned though if my user is in that aid_everybody group linux deploy won't start for me. I have to reconfigure the profile and then start the profile, but that pulls my user back out of that group, so just need a script to put the user back in that group since Linux Deploy won't allow me to keep it as a privileged user/group in the profile settings(guessing that's a bug). Hope this helps.
MIUI 14 doesn't have this dir, but /data/media/0 is working
Switched out to LineageOS 18.1 and ran into the same issue, but found a work around. Looks like they changed how the sdcard/partition is accessed in Android 11. Used to be able to access it via /sdcard or /storage/emulated/0, but now at least /mnt/runtime/full/emulated/0 drops to the sdcard partition without the Bad Address error. The only other catch is they also changed permissions on the sdcard and gave root and the everybody(9997) group read/write access instead of the sdcard_rw group. So, your primary user will need to be in that group(aid_everybody in the /etc/group) to be able to read/write it. Be warned though if my user is in that aid_everybody group linux deploy won't start for me. I have to reconfigure the profile and then start the profile, but that pulls my user back out of that group, so just need a script to put the user back in that group since Linux Deploy won't allow me to keep it as a privileged user/group in the profile settings(guessing that's a bug). Hope this helps.
MIUI 14 doesn't have this dir, but /data/media/0 is working
Just look for similar dirs..
/data/media/0 is working, but it is creating permission problems. Android doesn't expect files in /data/media/0 have different owner