[Q] rm / chown -> "Operation not permitted" on my rooted device - Android Q&A, Help & Troubleshooting

HI,
I can't delete "/system/etc/install-recovery.sh" on my rooted device.
Code:
[email protected]:/ $ su
su
[email protected]:/ # mount -o remount,rw /system
mount -o remount,rw /system
[email protected]:/ # cd /system/etc
cd /system/etc
[email protected]:/system/etc # rm install-recovery.sh
rm install-recovery.sh
rm failed for install-recovery.sh, Operation not permitted
255|[email protected]:/system/etc # chown shell install-recovery.sh
chown shell install-recovery.sh
Unable to chown install-recovery.sh: Operation not permitted
10|[email protected]:/system/etc #
Anyone knows why ?
(My device is Redmi 1 by the way)
Thanks.
Slash

Related

[Q] adb remount?

can't remount...trying to push .apk
sh-3.2# ./adb devices
List of devices attached
TA07302MDF device
sh-3.2# ./adb remount
remount failed: Operation not permitted
sh-3.2# ./adb shell
$ su
#
you can see i have root
droid x2 liberty 3 rom moto one click root
fixed it for anyone else having trouble
sh-3.2# ./adb devices
List of devices attached
TA07302MDF device
sh-3.2# ./adb remount
remount failed: Operation not permitted
sh-3.2# ./adb shell
$ su
# mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
# chmod 777 /system/framework
# exit
$ exit
sh-3.2# ./adb push framework-res.apk system/framework/
1055 KB/s (4096287 bytes in 3.788s)
sh-3.2#
thetdy said:
fixed it for anyone else having trouble
sh-3.2# ./adb devices
List of devices attached
TA07302MDF device
sh-3.2# ./adb remount
remount failed: Operation not permitted
sh-3.2# ./adb shell
$ su
# mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
# chmod 777 /system/framework
# exit
$ exit
sh-3.2# ./adb push framework-res.apk system/framework/
1055 KB/s (4096287 bytes in 3.788s)
sh-3.2#
Click to expand...
Click to collapse
accually you could just us this
# mount -o remount,rw /dev/block/mtdblock3 /system
should work just fine without the -t yaffs2 i know it works on the samsungs

Problem restore script

Hi, have problem with restore script. This script is for init.d. First boot with restore app and app data. Have problem with restore app data. If run script for restore app data then restore only from one tar.gz file, no from all. Where problem? Thanks
App restore:
#!/system/bin/sh
su
mount -o remount,rw /system
mount -o remount,rw /data
for filename in /system/app2/*.apk;
do
busybox install $filename /data/app;
done
busybox rm -rf /system/app2
busybox rm -rf /system/etc/init.d/90app​
App data restore:
#!/sbin/busybox sh
sleep 45
su
mount -o remount,rw /system
mount -o remount,rw /data
for filenamezip in /system/appdata/*.zip;
do
busybox chown -R root /data/data/${filenamezip%.zip}/*
busybox chmod -R 777 /data/data/${filenamezip%.zip}/*
busybox rm -rf /data/data/${filenamezip%.zip}
done
for izip in /system/appdata/*.zip;
do
busybox unzip -o $izip -d /;
done
for filenametar in /system/appdata/*.tar.gz;
do
busybox chown -R root /data/data/${filenametar%.tar.gz}/*
busybox chmod -R 777 /data/data/${filenametar%.tar.gz}/*
sleep 1
busybox rm -rf /data/data/${filenametar%.tar.gz}
done
for itar in /system/appdata/*.tar.gz;
do
busybox tar -xzf $itar -C /;
done
sleep 5
busybox rm -rf /system/appdata
busybox rm -rf /system/etc/init.d/95appdata
reboot​
For manual backup:
su
mount -o remount,rw /system
mount -o remount,rw /data
BACKUPDIR=/system/appdata
DATADIR=/data/data
echo
# create BACKUPDIR if necessary and modify ownership/permissions
if [ -d $BACKUPDIR ]; then
rm -rf $BACKUPDIR
mkdir $BACKUPDIR
else
mkdir $BACKUPDIR
fi
chown root $BACKUPDIR
chmod 777 $BACKUPDIR
# make
for name in $DATADIR/*; do
tar -cpvzf $BACKUPDIR/${name#/data/data/}.tar.gz $name
done;
# modify ownership/permissions of all archives
chown root $BACKUPDIR/*
chmod 777 $BACKUPDIR/*
echo​
Sorry my bad english
Any solution please?
Hi. Please help my with this problem.

how to replace system file help needed

fix.bat
Code:
::writable(mount writable)
adb shell < scripts/writeable.sh
::apps remower
adb shell < scripts/mdmkaldir.sh
::dnsconf change
::starting problem here file cant owerwrite.
adb push 20-dns.conf system/etc/dhcpcd/dhcpcd-hooks
::system readonly
adb shell < scripts/readonly.sh
::needed apks
::how i can isntall system app filemanager only
adb install apps/com.rhmsoft.fm-1.apk
adb install apps/com.buak.Link2SD.apk
adb install apps/uk.co.mytechie.setDNS.apk
::(root change)
adb install apps/eu.chainfire.supersu-minAPI7.apk
PAUSE
adb reboot
mdmkaldir.sh
Code:
su
cd system/app
rm EBAMarket.apk
rm EBA_SSO.apk
rm TR_Soft_Keyboard_default.apk
rm FatihMDM_ibnisina.apk
rm MpTest.apk
rm MpTest.odex
rm MpTestGps.apk
rm MpTestGps.odex
exit
exit
writable.sh
Code:
su
mount -o remount,rw /system
exit
exit
please help for this script
adb push 20-dns.conf system/etc/dhcpcd/dhcpcd-hooks
this line not work please help.
gencom said:
fix.bat
Code:
::writable(mount writable)
adb shell < scripts/writeable.sh
::apps remower
adb shell < scripts/mdmkaldir.sh
::dnsconf change
::starting problem here file cant owerwrite.
adb push 20-dns.conf system/etc/dhcpcd/dhcpcd-hooks
::system readonly
adb shell < scripts/readonly.sh
::needed apks
::how i can isntall system app filemanager only
adb install apps/com.rhmsoft.fm-1.apk
adb install apps/com.buak.Link2SD.apk
adb install apps/uk.co.mytechie.setDNS.apk
::(root change)
adb install apps/eu.chainfire.supersu-minAPI7.apk
PAUSE
adb reboot
mdmkaldir.sh
Code:
su
cd system/app
rm EBAMarket.apk
rm EBA_SSO.apk
rm TR_Soft_Keyboard_default.apk
rm FatihMDM_ibnisina.apk
rm MpTest.apk
rm MpTest.odex
rm MpTestGps.apk
rm MpTestGps.odex
exit
exit
writable.sh
Code:
su
mount -o remount,rw /system
exit
exit
please help for this script
adb push 20-dns.conf system/etc/dhcpcd/dhcpcd-hooks
this line not work please help.
Click to expand...
Click to collapse
Why do you need scripts when there are apps that can replace system files easily if rooted?
Dom3616 said:
Why do you need scripts when there are apps that can replace system files easily if rooted?
Click to expand...
Click to collapse
yes rooted all ok only
adb push 20-dns.conf system/etc/dhcpcd/dhcpcd-hooks
this line not work
gencom said:
yes rooted all ok only
adb push 20-dns.conf system/etc/dhcpcd/dhcpcd-hooks
this line not work
Click to expand...
Click to collapse
Just use ES Explorer (it's free) and copy/paste the file.
Dom3616 said:
Just use ES Explorer (it's free) and copy/paste the file.
Click to expand...
Click to collapse
i tryed already rooted device rooted filemanagers not work edit or owerwirite not work.
console log here
Code:
C:\Users\akiyoshi\Desktop\MT\etab4\ADB_Fastboot>adb shell 0<scripts/writeable.sh
su
mount -o remount,rw /system
exit
exit
[email protected]:/ $ su
1|[email protected]:/ $ mount -o remount,rw /system
mount: Operation not permitted
255|[email protected]:/ $ exit
C:\Users\akiyoshi\Desktop\MT\etab4\ADB_Fastboot>adb shell 0<scripts/mdmkaldir.sh
su
cd system/app
rm EBAMarket.apk
rm EBA_SSO.apk
rm TR_Soft_Keyboard_default.apk
rm FatihMDM_ibnisina.apk
rm MpTest.apk
rm MpTest.odex
rm MpTestGps.apk
rm MpTestGps.odex
exit
exit
[email protected]:/ $ su
[email protected]:/ # cd system/app
[email protected]:/system/app # rm EBAMarket.apk
rm failed for EBAMarket.apk, No such file or directory
255|[email protected]:/system/app # rm EBA_SSO.apk
rm failed for EBA_SSO.apk, No such file or directory
255|[email protected]:/system/app # rm TR_Soft_Keyboard_default.apk
rm failed for TR_Soft_Keyboard_default.apk, No such file or directory
255|[email protected]:/system/app # rm FatihMDM_ibnisina.apk
rm failed for FatihMDM_ibnisina.apk, No such file or directory
255|[email protected]:/system/app # rm MpTest.apk
rm failed for MpTest.apk, No such file or directory
255|[email protected]:/system/app # rm MpTest.odex
rm failed for MpTest.odex, No such file or directory
255|[email protected]:/system/app # rm MpTestGps.apk
rm failed for MpTestGps.apk, No such file or directory
255|[email protected]:/system/app # rm MpTestGps.odex
rm failed for MpTestGps.odex, No such file or directory
255|[email protected]:/system/app # exit
255|[email protected]:/ $ exit
[B][COLOR="Red"]C:\Users\akiyoshi\Desktop\MT\etab4\ADB_Fastboot>adb push 20-dns.conf system/etc/dhcpcd/dhcpcd-hooks
failed to copy '20-dns.conf' to 'system/etc/dhcpcd/dhcpcd-hooks/20-dns.conf': Read-only file system[/COLOR][/B]
C:\Users\akiyoshi\Desktop\MT\etab4\ADB_Fastboot>adb shell 0<scripts/readonly.sh
su
mount -o remount,ro /system
exit
exit
[email protected]:/ $ su
[email protected]:/ # mount -o remount,ro /system
[email protected]:/ # exit
[email protected]:/ $ exit
C:\Users\akiyoshi\Desktop\MT\etab4\ADB_Fastboot>adb install apps/com.rhmsoft.fm-1.apk
3920 KB/s (4357102 bytes in 1.085s)
pkg: /data/local/tmp/com.rhmsoft.fm-1.apk
Failure [INSTALL_FAILED_ALREADY_EXISTS]
C:\Users\akiyoshi\Desktop\MT\etab4\ADB_Fastboot>adb install apps/com.buak.Link2SD.apk
3572 KB/s (4218237 bytes in 1.152s)
pkg: /data/local/tmp/com.buak.Link2SD.apk
Failure [INSTALL_FAILED_ALREADY_EXISTS]
C:\Users\akiyoshi\Desktop\MT\etab4\ADB_Fastboot>adb install apps/uk.co.mytechie.setDNS.apk
2696 KB/s (877302 bytes in 0.317s)
pkg: /data/local/tmp/uk.co.mytechie.setDNS.apk
Failure [INSTALL_FAILED_ALREADY_EXISTS]
C:\Users\akiyoshi\Desktop\MT\etab4\ADB_Fastboot>adb install apps/eu.chainfire.supersu-minAPI7.apk
3812 KB/s (5905465 bytes in 1.512s)
pkg: /data/local/tmp/eu.chainfire.supersu-minAPI7.apk
Failure [INSTALL_FAILED_ALREADY_EXISTS]
C:\Users\akiyoshi\Desktop\MT\etab4\ADB_Fastboot>adb reboot
C:\Users\akiyoshi\Desktop\MT\etab4\ADB_Fastboot>PAUSE
Press any key to continue . . .
maybe required mount /etc as writable. etc not linked system??
need help replace system file in etc folder .

Problem with secure settings

Hi all,
im using a rooted samsung galaxy note 3 with lollipop
i have installed tasker to automate a few things ...
in addition i have installed the app "secure settings" to open the lookscreen
because of the message from secure settings in "System+ Module", that "Root access was not detected. The System+ module requires root access to function, i try the following:
Found on https://www.reddit.com/comments/3uf5bn ....
---------------------------------
adb shell
su
mount -o remount,rw /system
touch /sbin/su /system/bin/su /system/xbin/su
mount -o remount,ro /system
exit
reboot
---------------------------
im using Android Debug Bridge version 1.0.41
Version 28.0.3-5475833 <-- i think that's the latest version
C:\adb>adb shell
[email protected]:/ $ su
[email protected]:/ # mount -o remount,rw /system
[email protected]:/ # touch /sbin/su /system/bin/su /system/xbin/su
touch: usage: touch [-alm] [-t YYYYMMDD[.hhmmss]] <file>
1|[email protected]:/ # exit
1|[email protected]:/ $ exit
C:\adb>adb shell
[email protected]:/ $ su
[email protected]:/ # mount -o remount,rw /system
[email protected]:/ # touch /sbin/su /system/bin/su /system/xbin/su <-- don't work
touch: usage: touch [-alm] [-t YYYYMMDD[.hhmmss]] <file>
1|[email protected]:/ # exit
1|[email protected]:/ $ exit
C:\adb>adb shell
[email protected]:/ $ su
[email protected]:/ # touch /sbin/su <-- tried single step
255|[email protected]:/ # < -- is that the problem?
----------------------------
please help me ....
thanks Mikel

hacking a old discontinued android tv box(airtel internet tv, codename: ganesa)

A old thread about the same topic: https://forum.xda-developers.com/android/software-hacking/rooting-set-box-lge-sh960s-airtel-t3826462
So I have temp root using dirty-cow and have tried to edit default.prop to get adb by usb. didnt work, all are mounted read-only. tried remounting, fail, turning off SELinux, fail. heres the shell:
Code:
$ adb shell
[email protected]:/ $ /data/local/tmp/dcow /data/local/tmp/run-as /system/bin/run-a>
dcow /data/local/tmp/run-as /system/bin/run-as
warning: new file size (9804) and destination file size (17920) differ
[*] size 17920
[*] mmap 0xb6d64000
[*] currently 0xb6d64000=464c457f
[*] using /proc/self/mem method
[*] madvise = 0xb6d64000 17920
[*] madvise = 0 17449
[*] /proc/self/mem 10931200 610
[*] exploited 0 0xb6d64000=464c457f
[email protected]:/ $ /system/bin/run-as
uid /system/bin/run-as 2000
uid 0
0 u:r:runas:s0
context 0 u:r:shell:s0
[email protected]:/ # Hehehe
/system/bin/sh: Hehehe: not found
127|[email protected]:/ # which touch
/system/bin/touch
[email protected]:/ # touch Hi.txt
touch: 'Hi.txt': Read-only file system
1|[email protected]:/ # mount -o rw,remount /system
mount: Permission denied
255|[email protected]:/ # ls -ladZ sys
sys/ system/
255|[email protected]:/ # ls -ladZ system
drwxr-xr-x root root u:object_r:system_file:s0 system
[email protected]:/ # setenforce 0
setenforce: Couldn't set enforcing status to '0': Permission denied
1|[email protected]:/ # sestatus
/system/bin/sh: sestatus: not found
127|[email protected]:/ # cat
^C
130|[email protected]:/ #
130|[email protected]:/ #
130|[email protected]:/ #
130|[email protected]:/ #
130|[email protected]:/ #
130|[email protected]:/ # cat /etc/selinux/config
/system/bin/sh: cat: /etc/selinux/config: No such file or directory
1|[email protected]:/ # cd etc
[email protected]:/etc # ls
18p
NOTICE.html.gz
audio_effects.conf
audio_policy.conf
bluetooth
clatd.conf
dhcpcd
event-log-tags
fallback_fonts.xml
fonts.xml
gps.conf
hosts
media_codecs.xml
media_codecs_google_audio.xml
media_codecs_google_tv.xml
media_codecs_google_video.xml
media_codecs_performance.xml
media_profiles.xml
mkshrc
permissions
ppp
preloaded-classes
recovery-resource.dat
security
sysconfig
system_fonts.xml
wifi
[email protected]:/etc # touch lol
touch: 'lol': Read-only file system
1|[email protected]:/etc # mount -o rw,remount /
mount: Permission denied
255|[email protected]:/etc # su mount -o rw,remount /
/system/bin/sh: su: not found
127|[email protected]:/etc # sudo mount -o rw,remount /
/system/bin/sh: sudo: not found
127|[email protected]:/etc #
127|[email protected]:/etc #
so can I know why I am denied even tho I am root? Also can some-one guide me to write a blob extraction script? There is no fastboot.
as its a Android Marshmallow (6.0) device try to dump boot.img and flash modified magisk_patched.img on locked bootloader. Magisk has an option to by-pass dm-verity. this is confirmed method on some Mediatek devices, if you are lucky this will work
Code:
ls -d $(find /dev/block -name by-name)/*
cat /dev/block/.../by-name/boot > /sdcard/boot.img
if that works, adb pull the img, patch with Magisk Manager, make sure you have enabled both checkboxes for preserve encryption + keep AVB/dm-verity, push it back to device and try to flash
Code:
cat /sdcard/magisk_patched.img > /dev/block/.../by-name/boot
however, if the img is flashed and dm-verity is preventing from boot this is a permanently brick
FaIl
aIecxs said:
as its a Android Marshmallow (6.0) device try to dump boot.img and flash modified magisk_patched.img on locked bootloader. Magisk has an option to by-pass dm-verity. this is confirmed method on some Mediatek devices, if you are lucky this will work
Code:
ls -d $(find /dev/block -name by-name)/*
cat /dev/block/.../by-name/boot > /sdcard/boot.img
if that works, adb pull the img, patch with Magisk Manager, make sure you have enabled both checkboxes for preserve encryption + keep AVB/dm-verity, push it back to device and try to flash
Code:
cat /sdcard/magisk_patched.img > /dev/block/.../by-name/boot
however, if the img is flashed and dm-verity is preventing from boot this is a permanently brick
Click to expand...
Click to collapse
I dont have full root i guess: find: /dev/block: Permission denied
check /proc/partitions for two similar partitions with 10 or 16 MB one of these should be boot. try to dump the partition (for example on my device it's mmcblk0p7)
Code:
cat /proc/partitions
cat /dev/block/mmcblk0p7 > /sdcard/mmcblk0p7.img
if that fails try to disable selinux
Code:
echo 0 > /sys/fs/selinux/enforce
or
echo 0 > /data/local/tmp/enforce
mount -o bind /data/local/tmp/enforce /sys/fs/selinux/enforce
chmod 0644 /sys/fs/selinux/enforce
chown 0.0 /sys/fs/selinux/enforce
chcon u:object_r:selinuxfs:s0 /sys/fs/selinux/enforce
Can someone help with steps to root the device and backup current ROM
seniornoob58432 said:
A old thread about the same topic: https://forum.xda-developers.com/android/software-hacking/rooting-set-box-lge-sh960s-airtel-t3826462
So I have temp root using dirty-cow and have tried to edit default.prop to get adb by usb. didnt work, all are mounted read-only. tried remounting, fail, turning off SELinux, fail. heres the shell:
Code:
$ adb shell
[email protected]:/ $ /data/local/tmp/dcow /data/local/tmp/run-as /system/bin/run-a>
dcow /data/local/tmp/run-as /system/bin/run-as
warning: new file size (9804) and destination file size (17920) differ
[*] size 17920
[*] mmap 0xb6d64000
[*] currently 0xb6d64000=464c457f
[*] using /proc/self/mem method
[*] madvise = 0xb6d64000 17920
[*] madvise = 0 17449
[*] /proc/self/mem 10931200 610
[*] exploited 0 0xb6d64000=464c457f
[email protected]:/ $ /system/bin/run-as
uid /system/bin/run-as 2000
uid 0
0 u:r:runas:s0
context 0 u:r:shell:s0
[email protected]:/ # Hehehe
/system/bin/sh: Hehehe: not found
127|[email protected]:/ # which touch
/system/bin/touch
[email protected]:/ # touch Hi.txt
touch: 'Hi.txt': Read-only file system
1|[email protected]:/ # mount -o rw,remount /system
mount: Permission denied
255|[email protected]:/ # ls -ladZ sys
sys/ system/
255|[email protected]:/ # ls -ladZ system
drwxr-xr-x root root u:object_r:system_file:s0 system
[email protected]:/ # setenforce 0
setenforce: Couldn't set enforcing status to '0': Permission denied
1|[email protected]:/ # sestatus
/system/bin/sh: sestatus: not found
127|[email protected]:/ # cat
^C
130|[email protected]:/ #
130|[email protected]:/ #
130|[email protected]:/ #
130|[email protected]:/ #
130|[email protected]:/ #
130|[email protected]:/ # cat /etc/selinux/config
/system/bin/sh: cat: /etc/selinux/config: No such file or directory
1|[email protected]:/ # cd etc
[email protected]:/etc # ls
18p
NOTICE.html.gz
audio_effects.conf
audio_policy.conf
bluetooth
clatd.conf
dhcpcd
event-log-tags
fallback_fonts.xml
fonts.xml
gps.conf
hosts
media_codecs.xml
media_codecs_google_audio.xml
media_codecs_google_tv.xml
media_codecs_google_video.xml
media_codecs_performance.xml
media_profiles.xml
mkshrc
permissions
ppp
preloaded-classes
recovery-resource.dat
security
sysconfig
system_fonts.xml
wifi
[email protected]:/etc # touch lol
touch: 'lol': Read-only file system
1|[email protected]:/etc # mount -o rw,remount /
mount: Permission denied
255|[email protected]:/etc # su mount -o rw,remount /
/system/bin/sh: su: not found
127|[email protected]:/etc # sudo mount -o rw,remount /
/system/bin/sh: sudo: not found
127|[email protected]:/etc #
127|[email protected]:/etc #
so can I know why I am denied even tho I am root? Also can some-one guide me to write a blob extraction script? There is no fastboot.
Click to expand...
Click to collapse
Can you help me the steps you used to root via ditry cow?
aIecxs said:
check /proc/partitions for two similar partitions with 10 or 16 MB one of these should be boot. try to dump the partition (for example on my device it's mmcblk0p7)
Code:
cat /proc/partitions
cat /dev/block/mmcblk0p7 > /sdcard/mmcblk0p7.img
if that fails try to disable selinux
Code:
echo 0 > /sys/fs/selinux/enforce
or
echo 0 > /data/local/tmp/enforce
mount -o bind /data/local/tmp/enforce /sys/fs/selinux/enforce
chmod 0644 /sys/fs/selinux/enforce
chown 0.0 /sys/fs/selinux/enforce
chcon u:object_r:selinuxfs:s0 /sys/fs/selinux/enforce
Click to expand...
Click to collapse
How to disable selinux?

Categories

Resources