Can't fix Internal Memory permissions - Moto G 2015 Q&A, Help & Troubleshooting

Hi, recently I updated to Alberto97's unofficial version of LineageOS "lineage-14.1-20171105-UNOFFICIAL-osprey.zip" and the latest opengapps. After booting the rom, I noticed I can't access the internal memory at all. I've already tried osmosis' SD card file permissions fix, fixing the context of SELinux on TWRP, these commands:
chown -R media_rw:media_rw /data/media/
find /data/media/ -type d -exec chmod 775 {} ';'
find /data/media/ -type f -exec chmod 664 {} ';'
and nothing fixes it. Is there any other fix for it? I can access the SD card itself, just not the internal memory.

Related

Telstra T-Touch Tab aka Huawei S7 root

Hey guys, just got my hands on one of these suckers, it runs 2.1
Can anyone point me in the right direction to get root?
Im also looking for froyo, however dont expect it soon, manufacturer is working on it.
Sent from my S7 using XDA App
I second davidcampbell! We need froyo here
The root method is the same as the s7.
download z4root from market and root, after wards install busybox by titanium backup and you are set.
The app2sd mod works for this device since it is similar to the sony x10 on 2.1 but is risky because i lost wifi aftewards. So just explore until we get some real developers working on it hopefully cm6.1 port but after huawei realeases the recovery.img and source to mess around with though.
being able to overclock to 1ghz wouldnt hurt either.
S7 Bootloader?
Has anyone figured out how to get into the bootloader for this device?
Havent been able to through any apps \ commands. Just go to a black screen and thats it, and recovery sends you into factory settings for your device
I only know that pressing back key and call\send key when when powering on the device puts it into update mode.
alexisprz said:
The root method is the same as the s7.
download z4root from market and root, after wards install busybox by titanium backup and you are set.
The app2sd mod works for this device since it is similar to the sony x10 on 2.1 but is risky because i lost wifi aftewards. So just explore until we get some real developers working on it hopefully cm6.1 port but after huawei realeases the recovery.img and source to mess around with though.
being able to overclock to 1ghz wouldnt hurt either.
Click to expand...
Click to collapse
Zomg, nice, thank you alexisprz, it's rooting time
I really wish Android had a better term for rooting, it sounds like I'm either breaking it, or trying to cram my man bits into it some how.
Will this affect my ability to use the manufacturers update to froyo in the future?
UPDATE: z4root worked great, I installed busybox no problemo, very happy forum member here
sir i just bought one telstra touch tab can you plz help me to debrand it and unlock it i also have jtag too
pre needs, new rom and rooted with busybox on SD with linux ext2/3 Partition.
download z4root from market and root
copy 3 files to sd
run App-2-sd.sh
File 1 "App-2-sd.sh"
#!/bin/sh
# untitled.sh
#
#
# Created by Andew Blazely on 5/02/11.
# Copyright 2011 SOFTHOUSE. All rights reserved.
#
# un Hash data if you wish but it will slow the S7 down and cause lots of waiting problems
# pre needs, new rom and rooted with busybox on SD with linux ext2/3 Partition.
# mount the file systems
mount -o rw,remount -t yaffs2 /dev/block/mtdblock1 /system
busybox mkdir /system/sd
mount -t ext2 /dev/block/vold/179:2 /system/sd
# archive dirs (easier than copying)
cd /data/
busybox tar -cvf /system/sd/app.tar app
busybox tar -cvf /system/sd/app-private.tar app-private
# busybox tar -cvf /system/sd/data.tar data
busybox tar -cvf /system/sd/dalvik-cache.tar dalvik-cache
# unpack arcives in correct place
cd /system/sd
busybox tar -xvf app.tar
busybox tar -xvf app-private.tar
# busybox tar -xvf data.tar
busybox tar -xvf dalvik-cache.tar
# cleanup
busybox rm *.tar
# copy and set system files
busybox cp /sdcard/install-recovery.sh /system/etc
busybox cp /sdcard/init-sd.sh /system/etc
busybox chmod 755 /system/etc/install-recovery.sh
busybox chmod 755 /system/etc/init-sd.sh
# un Hash whatis needed if you intend NOT to remove SD
#cd /data/app
#busybox rm -rf *
#cd /data/app-private
#busybox rm -rf *
#cd /data/data/
#busybox rm -rf *
#cd /data/dalvik-cache
#busybox rm -rf *
# binding mount of new file structure
mount -o bind /system/sd/app /data/app
mount -o bind /system/sd/app-private /data/app-private
# mount -o bind /system/sd/data /data/data
mount -o bind /system/sd/dalvik-cache /data/dalvik-cache
reboot
File 2 "init-sd.sh"
#!/system/bin/sh
#
MYLOG=/sdcard/install-recovery.log
echo "$(date) Starting install-recovery.sh" > $MYLOG
echo "$(date) Waiting SD to become ready..." >> $MYLOG
sleep 10
# un Hash whatis needed if you intend NOT to remove SD
#echo "$(date) Erasing system files..." >> $MYLOG
#cd /data/app
#busybox rm -rf *
#cd /data/app-private
#busybox rm -rf *
#cd /data/data/
#busybox rm -rf *
#cd /data/dalvik-cache
#busybox rm -rf *
#echo "$(date) Erased system files..." >> $MYLOG
mount -t ext2 /dev/block/vold/179:2 /system/sd 1>>$MYLOG 2>>$MYLOG
mount -o bind /system/sd/app /data/app 1>>$MYLOG 2>>$MYLOG
mount -o bind /system/sd/app-private /data/app-private 1>>$MYLOG 2>>$MYLOG
# Hash this out if you haven't moved /data/data
#mount -o bind /system/sd/data /data/data 1>>$MYLOG 2>>$MYLOG
# Hash this out if you haven't move /data/dalvik-cache
mount -o bind /system/sd/dalvik-cache /data/dalvik-cache 1>>$MYLOG 2>>$MYLOG
mount >> $MYLOG
echo "$(date) Finishing install-recovery.sh" >> $MYLOG
File 3 "install-recovery.sh"
#!/system/bin/sh
#
/system/etc/init-sd.sh&
And BOB's your uncle.. this has worked many times for me give it a try

[SCRIPT / TOOL] zro's ultimate permission fixer script v1.0

Do I need to explain what a permission fixer script is supposed to do?
It fixes all the permissions (currently only for /system) and removes some knox bloatware folders along the way.
Root and busybox is required.
---
NOTE: This is the first step for a "rom installer script".
Please let me know if you find any errors or want any folders added to the additional permission fixes.
Or if you know any enhancements too off course.
There might be some redundancy within the script, but I wanted to better be safe
---.
So here it goes (download attached below):
Copy it to wherever you like and make it runnable (chmod 755) to execute.
I just copied it to my /system/xbin folder so I just have to type "fix_permissions.sh" when I want to fix em.
(could even get rid of the ".sh" to get the fix_permission command back kind of)
Code:
#!/system/bin/sh
echo
echo zro\'s ultimate permission fixer script v1.0
echo ============================================
echo
echo Step 1: Mounting /system writable
echo ---------------------------------
mount -o rw,remount /system
# >>> STOCK PERMISSIONS >>>
echo
echo Step 2: Fixing stock permissions
echo --------------------------------
# /system
echo fixing permissions for /system
busybox chown 0.0 /system
busybox chown 0.0 /system/*
busybox chown 0.2000 /system/bin
busybox chown 0.2000 /system/vendor
busybox chown 0.2000 /system/xbin
busybox chmod 755 /system/*
find /system -type f -maxdepth 1 -exec busybox chmod 644 {} \;
# /system/app
echo fixing permissions for /system/app
busybox chown 0.0 /system/app/*
busybox chmod 644 /system/app/*
# /system/cameradata
echo fixing permissions for /system/cameradata
busybox chown -R 0.0 /system/cameradata
find /system/cameradata \( -type d -exec busybox chmod 755 {} + \) -o \( -type f -exec busybox chmod 644 {} + \)
# /system/bin
echo fixing permissions for /system/bin
busybox chmod 755 /system/bin/*
busybox chown 0.2000 /system/bin/*
busybox chown -h 0.2000 /system/bin/*
busybox chown 0.0 /system/bin/log /system/bin/ping /system/bin/sysinit
busybox chmod 777 /system/bin/log
busybox chown 0.3003 /system/bin/netcfg
busybox chmod 2750 /system/bin/netcfg
busybox chmod 750 /system/bin/run-as
busybox chown 0.0 /system/bin/su
busybox chmod 6755 /system/bin/su
busybox chown 0.0 /system/bin/daemonsu
busybox chmod 6755 /system/bin/daemonsu
# /system/containers - Knox Bloatware (will be removed)
echo fixing permissions for /system/containers - Knox Bloatware - will be removed
rm -r /system/containers
# /system/csc
echo fixing permissions for /system/csc
busybox chown -R 0.0 /system/csc
find /system/csc \( -type d -exec busybox chmod 755 {} + \) -o \( -type f -exec busybox chmod 644 {} + \)
# /system/etc
echo fixing permissions for /system/etc
busybox chown -R 0.0 /system/etc
find /system/etc \( -type d -exec busybox chmod 755 {} + \) -o \( -type f -exec busybox chmod 644 {} + \)
busybox chown 0.2000 /system/etc/init.goldfish.sh
busybox chmod 550 /system/etc/init.goldfish.sh
busybox chmod 664 /system/etc/boot_fixup
busybox chown 1014.2000 /system/etc/dhcpcd/dhcpcd-run-hooks
busybox chmod 550 /system/etc/dhcpcd/dhcpcd-run-hooks
busybox chmod 755 /system/etc/init.d/*
busybox chmod 6755 /system/etc/install-recovery.sh
# /system/finder_cp
echo fixing permissions for /system/finder_cp
busybox chown 0.0 /system/finder_cp/*
busybox chmod 644 /system/finder_cp/*
# /system/fonts
echo fixing permissions for /system/fonts
busybox chown 0.0 /system/fonts/*
busybox chmod 644 /system/fonts/*
# /system/framework
echo fixing permissions for /system/framework
busybox chown 0.0 /system/framework/*
busybox chmod 644 /system/framework/*
# /system/lib
echo fixing permissions for /system/lib
busybox chown -R 0:0 /system/lib
find /system/lib \( -type d -exec busybox chmod 755 {} + \) -o \( -type f -exec busybox chmod 644 {} + \)
# /system/media
echo fixing permissions for /system/media
busybox chown -R 0:0 /system/media
find /system/media \( -type d -exec busybox chmod 755 {} + \) -o \( -type f -exec busybox chmod 644 {} + \)
# /system/preloadedkiosk - Bloatware (will be removed)
echo fixing permissions for /system/preloadedkiosk - Bloatware - will be removed
rm -r /system/preloadedkiosk
# /system/preloadedsso - Knox Bloatware (will be removed)
echo fixing permissions for /system/preloadedsso - Knox Bloatware - will be removed
rm -r /system/preloadedsso
# /system/sipdb
echo fixing permissions for /system/sipdb
busybox chown 0.0 /system/sipdb/*
busybox chmod 655 /system/sipdb/*
# /system/tts
echo fixing permissions for /system/tts
busybox chown -R 0:0 /system/tts
find /system/tts \( -type d -exec busybox chmod 755 {} + \) -o \( -type f -exec busybox chmod 644 {} + \)
# /system/usr
echo fixing permissions for /system/usr
busybox chown -R 0:0 /system/usr
find /system/usr \( -type d -exec busybox chmod 755 {} + \) -o \( -type f -exec busybox chmod 644 {} + \)
# /system/vendor
echo fixing permissions for /system/vendor
find /system/vendor \( -type d -exec busybox chown 0.2000 {} + \) -o \( -type f -exec busybox chown 0.0 {} + \)
find /system/vendor \( -type d -exec busybox chmod 755 {} + \) -o \( -type f -exec busybox chmod 644 {} + \)
# /system/voicebargeindata
echo fixing permissions for /system/voicebargeindata
busybox chown -R 0:0 /system/voicebargeindata
find /system/voicebargeindata \( -type d -exec busybox chmod 755 {} + \) -o \( -type f -exec busybox chmod 644 {} + \)
# /system/vold
echo fixing permissions for /system/vold
busybox chown 0.0 /system/vold/*
busybox chmod 644 /system/vold/*
# /system/wakeupdata
echo fixing permissions for /system/wakeupdata
busybox chown -R 0:0 /system/wakeupdata
find /system/wakeupdata \( -type d -exec busybox chmod 755 {} + \) -o \( -type f -exec busybox chmod 644 {} + \)
# /system/wallpaper
echo fixing permissions for /system/wallpaper
busybox chown 0.0 /system/wallpaper/*
busybox chmod 644 /system/wallpaper/*
# /system/xbin
echo fixing permissions for /system/xbin
busybox chmod 755 /system/xbin/*
busybox chown 0.2000 /system/xbin/*
busybox chown -h 0.2000 /system/xbin/*
busybox chown 0.0 /system/xbin/su
busybox chmod 6755 /system/xbin/su
busybox chown 0.0 /system/xbin/daemonsu
busybox chmod 6755 /system/xbin/daemonsu
# <<< STOCK PERMISSIONS END <<<
# ==============================
# >>> ADDITIONAL PERMISSIONS >>>
echo
echo Step 3: Fixing additional permissions
echo -------------------------------------
# /system/photoreader
echo fixing permissions for /system/photoreader
busybox chown -R 0.2000 /system/photoreader/*
find /system/photoreader/ \( -type d -exec busybox chmod 755 {} + \) -o \( -type f -exec busybox chmod 644 {} + \)
# <<< ADDITIONAL PERMISSIONS END <<<
RESERVED
zroice said:
RESERVED
Click to expand...
Click to collapse
Thanks for this, just what is was needing on my N3...
The thing is, I cannot boot the system... can you help me to run it on CWM recovery? Maybe converting it into a 'flashable script'?
this stuff is old - the kn0x0ut toolbox includes the current version of the fix permission script.
This should also work over adb on recovery. But you need some adb skills.
zroice said:
...
There might be some redundancy within the script, but I wanted to better be safe
...
Click to expand...
Click to collapse
I wonder if (for max safety) you might need to add selinux refresh stuff in some places?

Clean All Caches

I wanted to share a script for cleaning all caches without rebooting to recovery. If this is the wrong place please forgive me or if its already posted forgive me I have never seen it. Just thought it may be helpful to some.
1) Download a script manager or if you already have one next step
2) Copy code below
3) Open create section in script manager
4) Past copied code save script.
5) Run and enjoy
HTML:
#!/system/bin/sh
busybox find /data/dalvik-cache -type d -iname "*cache*" -exec busybox rm -f {}/* ';'
busybox find /data/data -type d -iname "*cache*" -exec busybox rm -f {}/* ';'
busybox find /cache -type d -iname "*cache*" -exec busybox rm -f {}/* ';'
busybox find /system/app -type d -iname "*cache*" -exec busybox rm -f {}/* ';'
busybox find /system/priv-app -type d -iname "*cache*" -exec busybox rm -f {}/* ';'
busybox find /data/data -type d -iname "*cache*" -exec busybox rm -f {}/* ';' -exec echo "Cleared all caches{}" ';'

Lollipop 5.1.1 won't use the bind mounted folders

Can anyone please explain what the <censorship> Lollipop is doing with the mount points? I made this simple test script to move the dalvik-cache folder into the "sd-ext", a secondary partition in the SD card in ext4 format:
Code:
#!/system/bin/sh
#
# Stop Android from booting
#
stop
#
#
SDEXT=/dev/block/mmcblk1p2
if [ ! -e /data/dalvik-cache ]; then
mkdir /data/dalvik-cache
chmod 771 /data/dalvik-cache
chown 0.0 /data/dalvik-cache
fi
mount -o rw,remount / && mkdir /sd-ext
mount -w -t ext4 $SDEXT /sd-ext && chmod 775 /sd-ext
mkdir /sd-ext/dalvik-cache
chmod 771 /sd-ext/dalvik-cache && chown 0.0 /sd-ext/dalvik-cache
busybox mount /sd-ext/dalvik-cache /data/dalvik-cache
mount -o ro,remount /
#
# Finished. restart Android
#
start
The problem here is that no matter if /data/dalvik-cache is mounted in /sd-ext/dalvik-cache (and it is) Android/zygote or whoever is in charge still manages to put the dalvik caches in the original /data/dalvik-cache folder. I added the stop/start commands to stop the zygote and its relatives from running. The script is started from /system/su.d as from SuperSU documentation. Which means at the moment the su daemon starts.
I mean this is a much simpler test version of a script I made for GB and worked through KK (with no need to ad the stop/start commands either). What's going on? What am I missing?
Miche1asso said:
Can anyone please explain what the <censorship> Lollipop is doing with the mount points? I made this simple test script to move the dalvik-cache folder into the "sd-ext", a secondary partition in the SD card in ext4 format:
Code:
#!/system/bin/sh
#
# Stop Android from booting
#
stop
#
#
SDEXT=/dev/block/mmcblk1p2
if [ ! -e /data/dalvik-cache ]; then
mkdir /data/dalvik-cache
chmod 771 /data/dalvik-cache
chown 0.0 /data/dalvik-cache
fi
mount -o rw,remount / && mkdir /sd-ext
mount -w -t ext4 $SDEXT /sd-ext && chmod 775 /sd-ext
mkdir /sd-ext/dalvik-cache
chmod 771 /sd-ext/dalvik-cache && chown 0.0 /sd-ext/dalvik-cache
busybox mount [color=red]--bind[/color] /sd-ext/dalvik-cache /data/dalvik-cache
mount -o ro,remount /
#
# Finished. restart Android
#
start
The problem here is that no matter if /data/dalvik-cache is mounted in /sd-ext/dalvik-cache (and it is) Android/zygote or whoever is in charge still manages to put the dalvik caches in the original /data/dalvik-cache folder. I added the stop/start commands to stop the zygote and its relatives from running. The script is started from /system/su.d as from SuperSU documentation. Which means at the moment the su daemon starts.
I mean this is a much simpler test version of a script I made for GB and worked through KK (with no need to ad the stop/start commands either). What's going on? What am I missing?
Click to expand...
Click to collapse
--bind missing?
Have you tried instead modifying boot.img to run it directly? --- add in a busybox and replace the dalvik creation with a redirect to a .sh...
HypoTurtle said:
--bind missing?
Have you tried instead modifying boot.img to run it directly? --- add in a busybox and replace the dalvik creation with a redirect to a .sh...
Click to expand...
Click to collapse
Well, I used "busymox mount" because it automatically detects that being two directories they get mounted as a bind. Or so i supposed. Still i doubled checked, now. Same thing.
Not sure what you mean about redirecting to a .sh. Anyway, I also tried (the old) mounts2sd for testing. Same thing. it's like if something in Android gets hold of /data and its subdirectory and mounting over it doesn't matter. This with zygote dead. It's driving me mad.
Well, I believe it is related to selinux and the mount namespaces. I disabled the option in SuperSU to have individual name spaces and something different did happen: the whole ART crashed, rebooting the phone (not just Android, I think even the kernel restarts).
As they usually say.. let's forget about it. Link2SD doesn't help much either, since it must keep the system dalvik caches (more than 500GB) in the internal memory.

internal storage not writable after format

Dear all
I have make reformat internal storage in TWRP recovery then restore full TWRP backup. After phone boot I can"t create any file or folder in phone storge!!
Any help???
What file manager are you using? Do you have supersu installed? Did you reboot wiping cache and dalvik only?
I have fix the permission by Adb command in TWRP by this command
use for fixing access
su
restorecon -FR /data/media/0
Swarai said:
What file manager are you using? Do you have supersu installed? Did you reboot wiping cache and dalvik only?
Click to expand...
Click to collapse
I'm using ES file explorer
Yes already rooting Super Su installed.
Yes wiping cach, dalvik
a_2004_81 said:
I have fix the permission by Adb command in TWRP by this command
use for fixing access
su
restorecon -FR /data/media/0
Click to expand...
Click to collapse
Working perfectly yesterday, today same problem not fixed by TWRP Terminal command!!!!
Fixed with terminal command in TWRP by comand:
chown -R media_rw:media_rw /data/media/
find /data/media/ -type d -exec chmod 775 {} ';'
find /data/media/ -type f -exec chmod 664 {} ';'
a_2004_81 said:
Fixed with terminal command in TWRP by comand:
chown -R media_rw:media_rw /data/media/
find /data/media/ -type d -exec chmod 775 {} ';'
find /data/media/ -type f -exec chmod 664 {} ';'
Click to expand...
Click to collapse
I had the same issue on Nexus 5 and with these commands storage is now writable. Thank you!!!
I have the same problem someone who helps me.
I made it a factory restore and now writes in the internal memory can only write to SD
external
a_2004_81 said:
I have fix the permission by Adb command in TWRP by this command
use for fixing access
su
restorecon -FR /data/media/0
Click to expand...
Click to collapse
thank you

Categories

Resources