How To Guide Mount System read/write - Motorola Moto G100 / Edge S

My native language is not English.
I am sorry, but I do not understand native English.
This operation is very dangerous.
Enables writing to "/".
All at your own risk.
Devices preinstalled with android 10 or later are
Even if you root the device, it will still be r/o and you will not be able to edit it at all.
By running this script, you can r/w the system itself.
We will use makeSystemRW and makesysrw_repair created by lebigmac.
You will need a linux system to run makesysrw_repair.
[SCRIPT][Android 10+] Universal Mount System read write R/W
I would like to thank lebigmac for creating this script.
1. After unlocking the boot loader and becoming root, disable all vbmeta.
Code:
fastboot -–disable-verity -–disable-verification flash vbmeta vbmeta.img
fastboot -–disable-verity -–disable-verification flash vbmeta_system vbmeta_system.img
2. Copy makeSystemRW to /data/local/tmp of edge s.
3. Run makeSystemRW.
Code:
adb shell
su
chmod +x /data/local/tmp/makesysrw_1.31/makesysrw.sh
setenforce 0
./data/local/tmp/makesysrw_1.31/makesysrw.sh size=20
An error will occur here and it will fail.
You need to use makesysrw_repair.
4. Run makesysrw_repair.
Copy makesysrw_repair, open a terminal at the location where you copied it, and run the code.
Code:
sudo bash makesysrw_repair.sh
We have confirmed that this command is executable on Ubuntu.
5. Finish.
You are now done.
You can mount it with r/w using the root explorer.
Make sure that you can create new files and folders.

Would like to do this but why hasn't anyone else posted on this thread regarding success or fails?

nexus7lte said:
Would like to do this but why hasn't anyone else posted on this thread regarding success or fails?
Click to expand...
Click to collapse
I guess no one tried it, or they did and never commented

Thank you for your interest in my SystemRW/SuperRW feat. MakeRW project.
Yes I got the project thread closed while I was enjoying the summer holidays. Everyone needs a well deserved break every once in a while. I'll have it reopened as soon as I'm ready to publish the new version of my script. Hopefully soon
It's looking like a fall release rather than a summer release though... Time flies...
The old version 1.32 works in A10, A11 and some folks even got it to work in A12 simply by disabling the sdkCheck() function
The new version should have A13 support straight out of the box if everything goes according to plan. Wish me luck! Thanks!
Cheers

i would like to try this just to get rid of the annoying Android 12 update message.
Evan after disabling google play services notifications and freezing the OTAs, I still cant stop
com.motorola.ccc.ota and I assume thats because its on a read only portion, right? ADB commands didnt work.

My error in adb or terminal is_
u
:/ # pm disable com.motorola.ccc.ota
Exception occurred while executing 'disable':
java.lang.SecurityException: Cannot disable a protected package: com.motorola.ccc.ota

Hi @nexus7lte
Did you get my SystemRW/SuperRW feat. MakeRW script to work on your Android 12 device?
Is it the Motorola Moto G100 ? How do you like it?
Yeah disabling those protected system packages can be tricky sometimes. I'm sure it's possible somehow.
On Xiaomi devices we also got this Xiaomi security app and I can't disable it even as root with full rw access but I'm sure a true expert could do it

lebigmac said:
Hi @nexus7lte
Did you get my SystemRW/SuperRW feat. MakeRW script to work on your Android 12 device?
Is it the Motorola Moto G100 ? How do you like it?
Yeah disabling those protected system packages can be tricky sometimes. I'm sure it's possible somehow.
On Xiaomi devices we also got this Xiaomi security app and I can't disable it even as root with full rw access but I'm sure a true expert could do it
Click to expand...
Click to collapse
Well... I tried your script on my new Realme GT Neo 3T android 12. It booted but seems like nothing changed. Mounting system still says "mount: '/system' not in /proc/mounts"

Vipxpert said:
Mounting system still says "mount: '/system' not in /proc/mounts"
Click to expand...
Click to collapse
Hi. That's a nice device you've got!
Are you sure you're calling the command as root?
Usually you get this error message if you try to remount something as shell user...
Or you're trying to remount the wrong path. Try mount -o remount,rw /
Without seeing any screenshots or at least your log it's very difficult to tell what's wrong on your device from here. Did you check if my script successfully removed the infamous shared_blocks read-only feature from your phone?
Bash:
adb shell
su
for a in /dev/block/dm-*; do tune2fs -l $a | grep -e "feat" -e "vol"; done

lebigmac said:
Hi. That's a nice device you've got!
Are you sure you're calling the command as root?
Usually you get this error message if you try to remount something as shell user...
Or you're trying to remount the wrong path. Try mount -o remount,rw /
Without seeing any screenshots or at least your log it's very difficult to tell what's wrong on your device from here. Did you check if my script successfully removed the infamous shared_blocks read-only feature from your phone?
Bash:
adb shell
su
for a in /dev/block/dm-*; do tune2fs -l $a | grep -e "feat" -e "vol"; done
Click to expand...
Click to collapse
Here I have flashed it through EX kernel manager since there's no TWRP for Neo 3T or even a forum yet. Do u need a full log somewhere though?

lebigmac said:
Hi. That's a nice device you've got!
Are you sure you're calling the command as root?
Usually you get this error message if you try to remount something as shell user...
Or you're trying to remount the wrong path. Try mount -o remount,rw /
Without seeing any screenshots or at least your log it's very difficult to tell what's wrong on your device from here. Did you check if my script successfully removed the infamous shared_blocks read-only feature from your phone?
Bash:
adb shell
su
for a in /dev/block/dm-*; do tune2fs -l $a | grep -e "feat" -e "vol"; done
Click to expand...
Click to collapse
Ah here I found

Also I tried copy-paste your code. It gives a bunch of nonsenses hmm...

Same this result for me even with your command
adb shell
su
for a in /dev/block/dm-*; do tune2fs -l $ etc
Or if i flashed rw fixed_super.bin
Device not able to boot anymore

Hi @Vipxpert thanks for your log and for the screenshots!
I don't understand why the script didn't detect your shared_blocks read-only feature...
Are you saying the script didn't do anything and you flashed the resulting super_fixed.bin to your super partition and phone still boots in read-only mode?
Oh yeah right I forgot that OnePlus devices usually have dozens of useless pseudo (cow) partitions in its partition table...
To find out if your device has got the infamous shared_blocks read-only feature please try this updated code. Good luck!
Bash:
adb shell
su
for a in /dev/block/dm-*; do tune2fs -l $a | grep -e "feat" -e "vol" -e "mounted on"; done
Or like this:
Bash:
adb shell
su
for a in `seq 0 5`; do tune2fs -l /dev/block/dm-$a | grep -e "feat" -e "vol" -e "mounted on"; done
@Mr Hassan bootloops are always very sad . Do you have any idea why it happened?
Try to boot into TWRP and pull any log files to find out reason for error and then reflash original stock super.img and phone should boot again Good luck!

lebigmac said:
Hi @Vipxpert thanks for your log and for the screenshots!
I don't understand why the script didn't detect your shared_blocks read-only feature...
Are you saying the script didn't do anything and you flashed the resulting super_fixed.bin to your super partition and phone still boots in read-only mode?
Oh yeah right I forgot that OnePlus devices usually have dozens of useless pseudo (cow) partitions in its partition table...
To find out if your device has got the infamous shared_blocks read-only feature please try this updated code. Good luck!
Bash:
adb shell
su
for a in /dev/block/dm-*; do tune2fs -l $a | grep -e "feat" -e "vol" -e "mounted on"; done
Or like this:
Bash:
adb shell
su
for a in `seq 0 5`; do tune2fs -l /dev/block/dm-$a | grep -e "feat" -e "vol" -e "mounted on"; done
@Mr Hassan bootloops are always very sad . Do you have any idea why it happened?
Try to boot into TWRP and pull any log files to find out reason for error and then reflash original stock super.img and phone should boot again Good luck!
Click to expand...
Click to collapse
I even try stock super but device wont boot until flash back stock
And hes oneplus have somekinda cow partitions etc
I see when i try flash its asked to delete all cow parts
Don't know what's this

Yeh I did flash it with "fastboot flash super super-fixed.bin" and that took no effect ://
Anyways here're the results of your 2 commands. They seem not to end up well

@lebigmac mention mention

Well it looks like your /product partition does indeed have the infamous shared_blocks read-only feature.
I know that's a stupid feature but this is actually good news. This means new upcoming version of my script should be able to do the job

lebigmac said:
Well it looks like your /product partition does indeed have the infamous shared_blocks read-only feature.
I know that's a stupid feature but this is actually good news. This means new upcoming version of my script should be able to do the job
Click to expand...
Click to collapse
Yess!! U're the hero thanks so much now I can debloat, fake Google daydream service, add AR supports, edit mixer_path.xml for volume and tons of stuffs. Oh I miss those time a lot ^^^

lebigmac said:
Well it looks like your /product partition does indeed have the infamous shared_blocks read-only feature.
I know that's a stupid feature but this is actually good news. This means new upcoming version of my script should be able to do the job
Click to expand...
Click to collapse
any any estimate of days or release date

Related

Ash as login shell

Hi All,
The Ash shell provides a few advantages over the Android default sh shell such as command history and cursor handling at the prompt. There are other benefits, but these are the first that come in most handy (to me).
The following tutorial will get you ash as the login shell with as yet no ill effects:
Note: that in my case, I'm using my android2sd construct and thus this modification is being done to my active overlay profile setup, thus to undo it I can simply boot into "safe\\normal" mode and undo the changes without possibly locking me out of the console should it have failed (which it didn't) But you can edit the Android /system/bin/sh file in this manner directly.
Ash as Login Shell:
OK, make the /system fs read-write:
mount -o remount,rw /system
Click to expand...
Click to collapse
Note: that the fs type is not needed, and in my case is not yaffs but ext3, Android will figure it out proper.
Next,
cp -a /system/bin/sh /system/bin/sh0
Click to expand...
Click to collapse
(this is for backup purposes and allows us to undo the change if so desired, or delete it if no longer needed).
Note: I'm using JF1.51 roms, so busybox ash is available as /system/xbin/bb/ash, so that is what I am using here; use ash however you are able to access it.
echo "#!/system/xbin/bb/ash">/system/bin/sh
echo "/system/xbin/bb/ash \[email protected]">>/system/bin/sh
Click to expand...
Click to collapse
Please note the use of (redirect\\overwrite)> and (redirect\\append)>>.
This will overwrite sh with a script to load the desired shell, executing any command-line arguments passed, and preserve the permissions of the original sh file. You can manually set the permissions the same as they are for our sh0 backup if the permissions (root.shell)(0755) don't seem to keep.
Finally reset the read-only state of /system:
mount -o remount,ro /system
Click to expand...
Click to collapse
Now if you shell-in\\telnet-in you should get the ash prompt which unlike the Android sh default prompt, includes the present working directory(pwd) ie: '/#' instead of just '#'.
Note: A reboot should not cause the loss of the modification, but if does, copy the new sh script to your /data/local/bin location or something and copy it back via boot script or something.
Shell Scripts:
If you're like me, you discovered that Android didn't need the interpreter declaration comment in scripts, and thus may not have used them...Well, you will need to update your scripts to include them by adding something similar to the following as the first line of your scripts:
#!/system/xbin/bb/ash
Click to expand...
Click to collapse
Again, please note that I am using JF1.51 roms and the location of the busybox ash shell is what I'm listing; put the full location to the shell you intend to use as this location.
Without the interpreter declaration, ash simply complains 'not found' at the first command, as ash doesn't know how to interpret the script, and doesn't seem to default to the login shell.
Hope someone finds this helpful!
sweet. This is going to be very useful
BAM. thats sexy. i just did this on CM3.6.7.1. works like a charm.
scratches head. i'm lost. what does this do and how does this make my g1 better?
temporizer said:
scratches head. i'm lost. what does this do and how does this make my g1 better?
Click to expand...
Click to collapse
im not sure about the other features, but the one i installed it for is to have your working directory in front of ur prompt. ex:
Code:
/# cd /sdcard
/sdcard # cd /system/sd
/system/sd #
etc...
EDIT: Also, if you use ConnectBot, you'll notice with the regular sh, if u scroll up with tracball, you get BS characters on the prompt. with THIS one, when you scroll up, you get last command entered. VERY handy for when you mistype one character on a long-ass command.
I love you
Couldn't you do this?
Code:
mv /system/bin/sh /system/bin/sh0
ln -s /system/xbin/bb/ash /system/bin/sh
great job, i'm going to get ash working on my G1 (CM-3.6.7.1)
Thanks.
kanstin said:
Couldn't you do this?
Code:
mv /system/bin/sh /system/bin/sh0
ln -s /system/xbin/bb/ash /system/bin/sh
Click to expand...
Click to collapse
I tried this and it worked even after a reboot...
Sweet, I love the scroll back with trackball in the terminal!!! Me thinks this should get absorbed into the next Cyan release.
kanstin said:
Couldn't you do this?
Code:
mv /system/bin/sh /system/bin/sh0
ln -s /system/xbin/bb/ash /system/bin/sh
Click to expand...
Click to collapse
Yes, I reckon you could. Though I had done a few experiments where the symlink failed, but I'm fairly sure it was do to the link: /system/xbin/bb/ash -->../busybox and /system/bin/../busybox not existing...so I did it via script. Many ways to skin a cat they say.
Thank you all... this is fricken awesome!!
temporizer said:
scratches head. i'm lost. what does this do and how does this make my g1 better?
Click to expand...
Click to collapse
It gives a more advanced shell for when you use the command line interface or telnet into your G1. If you don't use the command line a lot, it won't help you.
As for specific benefits to the advanced version, it was listed in the first post.
Hi,
imho this is rather a hack that exposes you to the risk at least on CM to loose your
shell during boot as xbin.sqf the compressed squashfs filesystem containing
busybox is mounted rather late in the boot process. A cleaner solution would be to
move busybox to system/bin and link it to sh. That way you ensure that sh will
always be accessible during boot and also later on, thus not interfering with
further developments. A alternative could be to compile a standalone version
of busybox containing only ash (for size reasons, as size in /system/bin is precious)
copy that to /system/bin and link sh to it.
Seems to work fine on Dude's. Not really sure how it should open, but I type "ash" at the prompt and I get the /$ and /# if superuser. I also get the command history by rolling the trackball, which is a very nice feature.
Can i install this without using my PC?
temporizer said:
Can i install this without using my PC?
Click to expand...
Click to collapse
Should work using terminal.
Tried it on JACHero 2.7.1
I tried the hard link one and I get a read only fs error on the first move command. What should I chmod to get past that?
mugafuga said:
I tried the hard link one and I get a read only fs error on the first move command. What should I chmod to get past that?
Click to expand...
Click to collapse
Do this first before the mv and the symlink.
mount -o remount,rw /system
farmatito said:
Hi,
imho this is rather a hack that exposes you to the risk at least on CM to loose your
shell during boot as xbin.sqf the compressed squashfs filesystem containing
busybox is mounted rather late in the boot process. A cleaner solution would be to
move busybox to system/bin and link it to sh. That way you ensure that sh will
always be accessible during boot and also later on, thus not interfering with
further developments. A alternative could be to compile a standalone version
of busybox containing only ash (for size reasons, as size in /system/bin is precious)
copy that to /system/bin and link sh to it.
Click to expand...
Click to collapse
Is this in any way accurate? I dedicate my g1 to cyan's roms and wouldn't want anything to hinder any of the goodness that is cyanogenMod. Advice?
Load ash when terminal is started?
temporizer said:
Is this in any way accurate? I dedicate my g1 to cyan's roms and wouldn't want anything to hinder any of the goodness that is cyanogenMod. Advice?
Click to expand...
Click to collapse
Safest method will be to change to ash shell once terminal app is started (same as typing "ash" to switch shell from sh to ash). I don't know how to do it in android (in linux you could add it to your login script).
So if someone knows how to execute a command when we login using the terminal app, then switching to ash shell would work without fear of breaking any other functionality.

[Nook HD+] Nook HD and HD+ rooting instructions (now permanent)

How to root Nook HD+ (and Nook HD too, I guess).
(Thanks for some useful ideas to sparkym3: http://forum.xda-developers.com/member.php?u=4411543 )
(tested only on 2.0.0 version (as comes out of the box), also works on 2.0.2
Get one of the attached files: root_win.zip if you are on windows, or root_unix.tgz if you are on Linux or Mac.
unpack the file to some dir and run "makeroot" on Windows or "sh makeroot.sh" on Mac/Linux
After a couple of reboots you should be able to do
adb shell and issue a "su" command in the shell and get the root prompt (#).
Thanks to someone0 for his prior investigations here.
Known bugs:
Superuser.apk does not really install because package manager could not be contacted.
Oh, and I think you'll find this interesting too:
Hai.
Kind of a two-fer, eh?
I noticed that people see their Nook HDs restoring to factory settings after 8 unsuccessful reboots next time you boot after rooting, so possibly there's some extra check somewhere.
Very sneaky on the B&N side, I'd say.
Hm, the 8 failed boot = wipe and restore has been true since the NC, and is valuable because it helps keep the device from getting bricked, also triggerable if the registration token doesn't match BN's reg token. I learned this early on by restoring a backup made before I'd erased and deregistered. I forget where the token lives, in /data/ somewhere.
I'll take a look at this on 2.0.2 this weekend - mine updated before I got ADB working so it restores to 2.0.2 now...
OK, so this approach does work with the 2.0.2 OS, and restarting the device does put it into a boot cycle. Very nasty.
Before I rebooted, I removed the post_boot_hook file and also got rid of the symlink; I'd say BN is doing some kind of inventory of what's in system and driving a reflash based on that.
My guess is it's not a very careful inventory, but it'll certainly be amenable to study now that we can get, at least temporarily, root.
Hm. Interesting -- my ability to mkdir /data/su is now gone after the restore. I wasn't able to do it the first time I tried, either - I suspect that there's something keeping some level of eye on that.
Oh, very uncool - in addition to resetting the system, they wipe personal data in the process. Losing the apps doesn't surprise me much. Losing the books I'd sideloaded surprises me.
roustabout said:
Hm, the 8 failed boot = wipe and restore has been true since the NC, and is valuable because it helps keep the device from getting bricked, also triggerable if the registration token doesn't match BN's reg token. I learned this early on by restoring a backup made before I'd erased and deregistered. I forget where the token lives, in /data/ somewhere.
I'll take a look at this on 2.0.2 this weekend - mine updated before I got ADB working so it restores to 2.0.2 now...
OK, so this approach does work with the 2.0.2 OS, and restarting the device does put it into a boot cycle. Very nasty.
Before I rebooted, I removed the post_boot_hook file and also got rid of the symlink; I'd say BN is doing some kind of inventory of what's in system and driving a reflash based on that.
My guess is it's not a very careful inventory, but it'll certainly be amenable to study now that we can get, at least temporarily, root.
Hm. Interesting -- my ability to mkdir /data/su is now gone after the restore. I wasn't able to do it the first time I tried, either - I suspect that there's something keeping some level of eye on that.
Oh, very uncool - in addition to resetting the system, they wipe personal data in the process. Losing the apps doesn't surprise me much. Losing the books I'd sideloaded surprises me.
Click to expand...
Click to collapse
Do the new HD & HD+ still allow you boot from the external sd card ?
roustabout said:
Hm, the 8 failed boot = wipe and restore has been true since the NC, and is valuable because it helps keep the device from getting bricked, also triggerable if the registration token doesn't match BN's reg token. I learned this early on by restoring a backup made before I'd erased and deregistered. I forget where the token lives, in /data/ somewhere.
I'll take a look at this on 2.0.2 this weekend - mine updated before I got ADB working so it restores to 2.0.2 now...
OK, so this approach does work with the 2.0.2 OS, and restarting the device does put it into a boot cycle. Very nasty.
Before I rebooted, I removed the post_boot_hook file and also got rid of the symlink; I'd say BN is doing some kind of inventory of what's in system and driving a reflash based on that.
My guess is it's not a very careful inventory, but it'll certainly be amenable to study now that we can get, at least temporarily, root.
Hm. Interesting -- my ability to mkdir /data/su is now gone after the restore. I wasn't able to do it the first time I tried, either - I suspect that there's something keeping some level of eye on that.
Oh, very uncool - in addition to resetting the system, they wipe personal data in the process. Losing the apps doesn't surprise me much. Losing the books I'd sideloaded surprises me.
Click to expand...
Click to collapse
if you put your books into /system/media, it will back them up to the cloud
Is it possible to push a new recovery with adb after rooting? The 8 failed boot repair is only possible with the stock recovery. But then again you may end up in an endless bootloop without it there to finish it's task. But maybe you can find and delete the trigger flag that starts the process.
leapinlar said:
Is it possible to push a new recovery with adb after rooting? The 8 failed boot repair is only possible with the stock recovery. But then again you may end up in an endless bootloop without it there to finish it's task. But maybe you can find and delete the trigger flag that starts the process.
Click to expand...
Click to collapse
stuff is best to be not mentioned. /sarcasm.....
recovery is signed, so it's not super easy to replace it with anything that would run.
The unsigned bootloader trick at the moment requires a boot from sdcard.
shouldn't step 8 & 9 be outside the code block?
verygreen:
I just want to thank you for your all your work on the Nook series. I've been using your "size-agnostic method ..." tools and process to run from the SD card on my Nook Color since you created the method, and now I'm excited to use your work on my new Nook HD+ (just received yesterday) !
just got mine and got an update notification. turned off wifi so it didnt complete.any word if it breaks root ir bootloader?
CWM is now possible too.
Something is interesting, eventhough mine originally got automatically updated to 2.0.2, but after the factory reset, it went back to 2.0.0. But for some weird reason I can't get root.
Maybe this will help, the build number is 2.0.0.1031.lithium01.ovation.rldp.s68403 with the manufactured date 10/22/2012
please compare mine to your.
I also rewrote your code into a batch file. You can double check it I guess.
Code:
@echo off
cls
@echo .
@echo wait for it
@echo .
adb devices
@echo .
@echo if you do not see you device listed above hit ctrl+c and exit the script
@echo then check adb on your PC and device then try again.
@echo .
@echo reroute /data/local/tmp
adb wait-for-devices shell rm -r /data/local/tmp
adb shell ln -s /data/ /data/local/tmp
@echo .
@echo Now rebooting
@echo .
adb reboot
@echo .
@echo waiting for reboot to finish and making directory /data/su
adb wait-for-devices shell mkdir /data/su
@echo uploading su
adb push su /data/su/
@echo uploading busybox
adb push busybox /data/su/
@echo uploading boot_complete_hoot
adb push boot_complete_hook.txt /data/boot_complete_hook.sh
adb shell chmod 755 /data/boot_complete_hook.sh /data/su/*
@echo .
@echo Now rebooting again
@echo .
adb reboot
@echo .
@echo waiting for reboot to finish and getting shell
adb wait-for-devices shell
someone0 said:
Something is interesting, eventhough mine originally got automatically updated to 2.0.2, but after the factory reset, it went back to 2.0.0. But for some weird reason I can't get root.
Maybe this will help, the build number is 2.0.0.1031.lithium01.ovation.rldp.s68403 with the manufactured date 10/22/2012
please compare mine to your.
I also rewrote your code into a batch file. You can double check it I guess.
Click to expand...
Click to collapse
so, when you run this, after the final adb shell, what are the permissions on /system/xbin/su?
run su and you should get the root prompt.
I don't get root prompt, su never get copied to /system/xbin/su
here is the list of my finding.
Code:
/data/
-rwxr-xr-x shell shell 167 2012-11-10 05:52 boot_complete_hook.sh
/data/su
-rwxr-xr-x shell shell 586212 2012-11-10 06:07 busybox
-rwxr-xr-x shell shell 22364 2012-11-10 06:07 su
/data/local
lrwxrwxrwx shell shell 2012-11-10 06:20 tmp -> /data/
cat boot_complete_hook.sh
#!/system/bin/sh
/data/su/busybox mount /system -o remount,rw
/data/su/busybox cp /data/su/su /system/xbin/su
chown 0.0 /system/xbin/su
everything is in place and correct, but no dice. either boot_complete_hook.sh didn't get executed or it did but never get launched with root permission.
someone0 said:
I don't get root prompt, su never get copied to /system/xbin/su
here is the list of my finding.
Code:
/data/
-rwxr-xr-x shell shell 167 2012-11-10 05:52 boot_complete_hook.sh
/data/su
-rwxr-xr-x shell shell 586212 2012-11-10 06:07 busybox
-rwxr-xr-x shell shell 22364 2012-11-10 06:07 su
/data/local
lrwxrwxrwx shell shell 2012-11-10 06:20 tmp -> /data/
cat boot_complete_hook.sh
#!/system/bin/sh
/data/su/busybox mount /system -o remount,rw
/data/su/busybox cp /data/su/su /system/xbin/su
chown 0.0 /system/xbin/su
everything is in place and correct, but no dice.
Click to expand...
Click to collapse
well, there should be more stuff in the shell file, you miss the final chown line: chmod 06755 /system/xbin/su
It did, I just didn't copy and paste the output correctly. But regardless, since the foulder /system/xbin don't have the su file, this mean as I suspected earlier, either it wasn't executed or lauched w/ root permission.
someone0 said:
It did, I just didn't copy and paste the output correctly. But regardless, since the foulder /system/xbin don't have the su file, this mean as I suspected earlier, either it wasn't executed or lauched w/ root permission.
Click to expand...
Click to collapse
check if your /system/bin/clrbootcount.sh calls /data/boot_complete_hook.sh
verygreen said:
check if your /system/bin/clrbootcount.sh calls /data/boot_complete_hook.sh
Click to expand...
Click to collapse
This is interesting, it look as if it won't launch the /data/boot_complete_hook.sh
Code:
cat /data/boot_complete_hook.sh
#!/system/bin/sh
/data/su/busybox mount /system -o remount,rw
/data/su/busybox cp /data/su/su /system/xbin/su
chown 0.0 /system/xbin/su
chmod 06755 /system/xbin/su
[B][email protected]:/data $ /data/boot_complete_hook.sh
/data/boot_complete_hook.sh
/system/bin/sh: /data/boot_complete_hook.sh: No such file or directory
1|[email protected]:/data $
[/B]
Yub it does
Code:
cat clrbootcount.sh
#!/system/bin/sh
################################################################################
##
#
# File clrbootcount.sh
# Description Clear the bootcount variable to 0 on successful boot
#
##
# Run potential hook first.
[B]/data/boot_complete_hook.sh[/B]
# Zero the boot count
cat /system/etc/zerobootcnt > /bootdata/BootCnt

[GUIDE] How to mount ext4 formatted MicroSD card on Android 4.2.2 Phone/Tablet.

Why?
MicroSD cards are traditionally formatted using ExFAT filesystem. The trouble is that while universally compatible, ExFAT is rather primitive filesystem prone to data loss, and poor speed. Linux ext4 on the contrary is highly reliable and very fast.
Trouble is that, and I quote, "Android supports devices with external storage, which is defined to be a case-insensitive and permissionless filesystem." (see http://source.android.com/devices/tech/storage/)
Well that pretty much narrows it down to dumb stuff like ExFAT.
Note: As of JB (Android 4.1) default umask is 077, which means that files created by apps on the ext4 formatted SD card will only be readable by the same apps, unless you manually update permissions. See this thread for more: http://forum.xda-developers.com/showthread.php?t=889471&page=5​
The good news is that Android has Linux at its core, which naturally supports ext4, and actually all of the internal storage is (or will be in near future) formatted this way. The design limitation mentioned above is somewhat artificial and is enforced by
restricted functionality of funky little daemon, called vold. The sole purpose of vold is not monitor external storage,
detect filesystem on it, mount it as specified in /etc/vold.fstab (or vold.xxx in Android 4.3), and then report to the Volume Manager.Volume Manager in turn notifies the MTP application, and all other apps, displays icons and handles rest of user-visible stuff.
Stock Android vold only supports ExFAT/vfat filesystem. It has been improved in Cyanogenmod to support ext4 and NTFS filesystems, but for those of us stuck with OEM Android this goodness in unavailable. In my experience simply re-building vold from CM as part of AOSP,
while yields an executable, this executable results in a boot loop for an unclear reason.
All hope lost seemingly, yet there is a silver lining.
Silver Lining?
If MicroSD card is mounted manually in the way that vold can see it, re-running vold will properly report it to the Volume Manager and it will be recognized and utilized by apps.
In theory this is easy to accomplish on any rooted device, in practice there are a number of obstacles:
On a locked device, it is not possible to update init script to run the commands at system bootup.
Since Android 4.2, mount propagation no longer work (as described here http://forum.xda-developers.com/showthread.php?p=36889027),
so if sdcard is mounted in terminal, vold will still not see it. Hence the mount operation has to be done in adb.
Furthermore in Android 4.2.2, running adb on localhost is broken as a result of it loosing its private key.
See here https://code.google.com/p/android/issues/detail?id=48126 for more.
The solution?
Pre-requisites:
Rooted device (don't have to be unlocked) with USB debugging enabled.
MicroSD card formatted as ext4 (inserted)
Terminal app, such as Android Terminal Emulator https://play.google.com/store/apps/details?id=jackpal.androidterm&hl=en
Familiarity with adb.
Step 1 - Fix adb localhost.
Open terminal and type the commands:
Code:
su
setprop service.adb.tcp.port 5555
adb kill-server
stop adbd
start adbd
HOME=/sdcard adb start-server
adb connect localhost
adb -s localhost:5555 shell
exit
stop adbd
cat /sdcard/.android/adbkey.pub >> /data/misc/adb/adb_keys
start adbd
Step 2 - Install scripts.
Please note that the script msd2.sh has to be modified if your device uses different partition names.
To get list of partition names available run command:
Code:
adb shell cat /proc/partitions
There are 3 (very simple) scripts:
sd.sh is just a convenience so that you don't have to type su everytime.
It calls msd1.sh which takes care of starting localhost adb in a reliable way.
It then executes msd2.sh in adb shell, which actually does the mounting trickery.
To install scripts, download the zip file below, open terminal, unzip the archive and change into msd directory.
Then connect your phone to your PC and run the following commands:
Code:
adb push sd.sh /sdcard/sd.sh
adb push msd1.sh /sdcard/msd1.sh
adb push msd2.sh /sdcard/msd2.sh
adb shell
su
mount -o rw,remount /system
cp sd.sh /system/xbin/
cp msd1.sh /system/xbin/
cp msd2.sh /system/xbin/
chmod 755 /system/xbin/*.sh
mount -o ro,remount /system
exit
exit
Step 3 - Profit.
In terminal app run command:
Code:
sd.sh
There will be some messages in notifications bar and then you will be asked if it is ok to restart MTP application. Click Ok.
That should be it.
Note that this last command will have to be executed every time device reboots (see obstacle #1).
You can automate it using Script Manager app from marketplace. In this case, ask Script Manager to run msd1.sh instead, marking it as Root script.
Disclaimers
I've developed and tested this procedure on Samsung Galaxy S4 Active phone from ATT.
Should work for any other Android 4.2 device.
The steps outlined are non-destructive if done properly and should not affect any other functionality, yet obviously I do not assume any responsibility for you damaging your device in the process.
It is a good idea to read the linked articles before performing the procedure, to get a better understanding of what is actually going on.
Motorola Droid 4 (xt894)
Hello!
if you have a Motorola Droid 4 you need to change the third row in "msd2.sh" from
"mount -t ext4 /dev/block/mmcblk1p1 /storage/extSdCard && sleep 5 && /system/bin/vold" to
"mount -t ext4 /dev/block/mmcblk0p1 /storage/sdcard1 && sleep 5 && /system/bin/vold"
in order to get it to work, thanks for the guide!
Best Regards
/ Rasmus
It works well on TW based MIUI
It works well on TW based MIUI, so many many thanks!!!
But I still have the permission problems mentioned.
AOSP based MIUI is ext4 compatibile out of the box, and without permission problems.
This trick is amazing, but the permission issue make it useless ...
I can not shot a picture and than have to manually change the permission of tehf ile in order to view it on the gallery ...
Is there a definititive solution?
My lg l3 e400..sd card not mounted
to sashavasco:
sir, pls help configuring my phone...the codes u've given at the top part seems to work accordingly..but after when i entered the command
"cat /sdcard/.android/adbkey.pub >> /data/misc/adb/adb_keys"
it says: "no such file or directory"
can you point out the problem of the device plss...
i appriciate your response..
my phone s LG L3 E400..CYANOGENMOD 9..external sd wont mount on my device
sashavasko said:
Why?
Step 1 - Fix adb localhost.
Open terminal and type the commands:
Code:
su
setprop service.adb.tcp.port 5555
adb kill-server
stop adbd
start adbd
HOME=/sdcard adb start-server
adb connect localhost
adb -s localhost:5555 shell
exit
stop adbd
cat /sdcard/.android/adbkey.pub >> /data/misc/adb/adb_keys
start adbd
Click to expand...
Click to collapse
I am getting an error here: adb -s localhost:5555 shell stating device offline. I've done this 6 times now, and it's always the same error
Galaxy S4 i337 NC1 Rooted
kevp75 said:
I am getting an error here: adb -s localhost:5555 shell stating device offline. I've done this 6 times now, and it's always the same error
Galaxy S4 i337 NC1 Rooted
Click to expand...
Click to collapse
the same for me...
same error "unable to connect to local host:5555"
rooted Asus memo-7 build ME173X_US_user_4.2.404152_20140714 release-keys. But thanks for the heads up on Cyanogenmod.
>>If MicroSD card is mounted manually in the way that vold can see it, re-running vold will properly report it to the Volume Manager and it will be recognized and utilized by apps.
Re-running vold crashes it ("Segmentation fault") if sdcard is already mounted in ext4. If not, it restarts gracefully.
Stock android 4.4.2. AFAIK, vold must inform userspace stuff that sdcard is available, without it, android do not see any sdcard at all...
What can be done here?
p.s. Is there anywhere patched or recompiled vold which supports ext4?
Gigionaytor said:
the same for me...
Click to expand...
Click to collapse
same here too. Please help.
ZeroBubble said:
same here too. Please help.
Click to expand...
Click to collapse
Same error!
I had to modify terminal commands a bit to allow me to connect properly. Only moving the "start adbd" command down because the key needed to be appended to "adb_keys" before starting the service back up.
Code:
su
setprop service.adb.tcp.port 5555
adb kill-server
stop adbd
HOME=/sdcard adb start-server
cat /sdcard/.android/adbkey.pub >> /data/misc/adb/adb_keys
start adbd
adb connect localhost
adb -s localhost:5555 shell
exit
I'm also still dealing with the "msd1.sh" script execution consistently asking about my fingerprint and not remembering it. If I don't press "continue" quick enough it claims the resource is busy, which prompted me to also change the msd1.sh script sleep from 2 to 5. I have gotten the notification that msd2.sh has been elevated, which seems like it ran, but my partition still doesn't get mounted, even though I've got the right one from the /proc/partitions output.
Another note, because I had BusyBox installed, I needed to prepend "busybox" (no quotes) to the mount command in the msd2.sh or else that wouldn't work either.
Anyone have thoughts?
I followed DemisesAngel suggestion. There was no error this time but nothing happens when running any of the 3 scripts. I tried mmcblk1 and mmcblk1p1, also changed microsd path to match, /MicroSD, but nothing works. Even with manual ext4 mount command ...
Clicking mount in settings still results in incompatible storage and file explorer shows no sdcard.
Edit: Set permissions, script will run but nothing mounts unsupported file system ...
Error directory already exist
I folllow the steps but i.think I meaaes up.
When u run through DemiseAngel scripts
At:
car /sdcard/.android/adbkey.pub >> /
Error:tmp-mkish:cant create /:Is a directory
To I attempt to find and rm it, or would that mess something up
Rca RCT677W22
I dont know if this thread is closed but I have one simple question, can I somehow partition sdcard and have a little space for music and other stuff, and to use ext4 partition alongside with this, lets say "visible" partition ( I mean on windows).
WrathBand said:
I dont know if this thread is closed but I have one simple question, can I somehow partition sdcard and have a little space for music and other stuff, and to use ext4 partition alongside with this, lets say "visible" partition ( I mean on windows).
Click to expand...
Click to collapse
First, I have been able to create a formatted partition of less than the full size of an SD card. I did this because my Android seems to have issues with anything larger than 16GB and all I had lying around was a 64GB. I did not try to do anything with the remaining space. Maybe it could work, maybe not. I would have my doubts.
Second, thanks for this discussion. Here is what "kind of" works on my Android 5.1 TV computer:
su -mm -c mount -t ext4 -o noatime /dev/block/mmcblk0p1 /storage/sdcard1 && sleep 5 && /system/bin/vold
chown -R root:sdcard_r /storage/sdcard1
chmod 771 /storage/sdcard1
I say "kind of" because this is still not seen as a true, external storage card by Android or file manager apps (and the like). However, all apps can read/write/traverse the folder tree and do what they need to. You do NOT have to be root except to do this. As things stand for me now, I have to re-issue this upon every re-start of Android. But using Tasker makes this pretty easy to accomplish.
long as a problem remains so do this thread ! . Well i am on 7.x and wonder if the op would post a method or even approach for getting a
Code:
ext4
partitioned sdcard so that vold is well aware of that and will mount sdcardfs on that giving all apps access to the partitions. I have 3 of these on my card .
Is there a method to auto mount ext4 partition on external SD that works on lineageOS 17.1 on S4 i9506?

"No such file or directory" if tried run binary file in TWRP

I need to run a binary file, dalvikvm which located in /system/bin from TWRP terminal, but no matter what, it says, "No such file or directory found", and then I found that this is link file located another directory, I cd'd there and tried, but still the same result
I can be able to run the same file in Termux without any issues
Can anybody please help me on this?
Thanks
Hi, I think you need to mount the system partition before being able to access it. It's not mounted by default on TWRP, but when the phone is on it is (otherwise Android wouldn't work)
If you need help on how to mount partitions on TWRP, ring me (or google it, it's actually pretty simple)
Raiz said:
Hi, I think you need to mount the system partition before being able to access it. It's not mounted by default on TWRP, but when the phone is on it is (otherwise Android wouldn't work)
If you need help on how to mount partitions on TWRP, ring me (or google it, it's actually pretty simple)
Click to expand...
Click to collapse
Thanks for replying, it wasn't mounted at first, so I had mounted, still it didn't work, while some of the files in bin do work, some don't.
Then I copied the file to /sdcard and /tmp, and tried execute from these folders, still
Well, if when you're free, can you confirm if it's running on yours?
File: /system/bin/dalvikvm
Thanks once again
mizzunet said:
Thanks for replying, it wasn't mounted at first, so I had mounted, still it didn't work,
...
Thanks once again
Click to expand...
Click to collapse
I didn't found it inside, but it may be because I'm not rooted.
While searching around I've found this :
No such file or directory while running dalvikvm
I built AOSP Android and push the dalvik virtual machine in my device just to see if my built dalvik vm runs properly. I pushed it my device /opt directory but when I run dalvikvm, I get the error...
stackoverflow.com
It might get you out of trouble
Raiz said:
I didn't found it inside, but it may be because I'm not rooted.
While searching around I've found this :
No such file or directory while running dalvikvm
I built AOSP Android and push the dalvik virtual machine in my device just to see if my built dalvik vm runs properly. I pushed it my device /opt directory but when I run dalvikvm, I get the error...
stackoverflow.com
It might get you out of trouble
Click to expand...
Click to collapse
I looked into it.
I had no opt folder in root directory. So I made one, and moved dalvikvm to there and tried execute this time, it said permission denied, so I gave it chmod 755. But after that, it says "there no such file or directory".
Well, do you telegram account, so I could contact you there.
Thanks
Raiz said:
I didn't found it inside, but it may be because I'm not rooted.
While searching around I've found this :
No such file or directory while running dalvikvm
I built AOSP Android and push the dalvik virtual machine in my device just to see if my built dalvik vm runs properly. I pushed it my device /opt directory but when I run dalvikvm, I get the error...
stackoverflow.com
It might get you out of trouble
Click to expand...
Click to collapse
And even "file" binary, it says, there no file.
mizzunet said:
I looked into it.
I had no opt folder in root directory. So I made one, and moved dalvikvm to there and tried execute this time, it said permission denied, so I gave it chmod 755. But after that, it says "there no such file or directory".
Well, do you telegram account, so I could contact you there.
Thanks
Click to expand...
Click to collapse
This is really curious, tbh I'm not an expert around that subject, idk what's wrong with this binary...
Hopefully someone who knows more may help you with that. Have a nice day
This is because the binary you are trying to execute was compiled to run in the Android context, but you're trying to execute it in the TWRP one. Each binary has a path to a linker used during execution. The problem is that it refers to a linker that doesn't exist in TWRP.
Suppose we want to execte a binary file and obviously we can't:
Bash:
x00h:/ # /system/bin/awk
/sbin/sh: /system/bin/awk: No such file or directory
Let's take a look to its linker:
Bash:
x00h:/ # strings /system/bin/awk | head -n 1
/system/bin/linker64
Then, you will actually discover that it's sym linked to a linker that is available only when Android is running:
Bash:
x00h:/ # ls -ald /system/bin/linker64
lrwxr-xr-x 1 root shell 38 2009-01-01 00:00 /system/bin/linker64 -> /apex/com.android.runtime/bin/linker64
Since TWRP comes with its linker in /sbin/linker64, we can sym link it to /system/bin/linker64.
So, the hack:
Bash:
x00h:/ # mkdir -p /apex/com.android.runtime/bin/
x00h:/ # ln -s /sbin/linker /apex/com.android.runtime/bin/linker
x00h:/ # ln -s /sbin/linker64 /apex/com.android.runtime/bin/linker64
Retry, and it works:
Bash:
x00h:/ # /system/bin/awk
usage: /system/bin/awk [-F fs] [-v var=value] [-f progfile | 'prog'] [file ...]
Pray to God the TWRP's linker will be compatible and do the job (most binaries works fine), but sometimes you may get CANNOT LINK EXECUTABLE.

Make system as rw on android 10?

So apparently klaxosaur custom rom doesn't have rw enabled as it is ro locked, is there any way to make it rw permanently? and yes, i have tried @lebigmac 's method on making system rw. on orangefox all it says is "error code 255 please install unzip and try again"
Hi @Fgacko did you try to manually install and run my script as per instructions?
Hopefully I can fix that annoying automatic installation error 255 in next version Not sure why it happens in some recoveries and others not.
Do you have recovery log from /tmp/recovery.txt by any chance?
lebigmac said:
Hi @Fgacko did you try to manually install and run my script as per instructions?
Hopefully I can fix that annoying installation error 255 in next version Not sure why it happens in some recoveries and others not.
Do you have recovery log from /tmp/recovery.txt by any chance?
Click to expand...
Click to collapse
I don't have the recovery log, i didn't try the manual install yet. How do you do it? *I don't understand the instructions for manual installation you said in your thread*
Fgacko said:
I don't have the recovery log, i didn't try the manual install yet. How do you do it? *I don't understand the instructions for manual installation you said in your thread*
Click to expand...
Click to collapse
Alright i've done it, now what?
Fgacko said:
Alright i've done it, now what?
Click to expand...
Click to collapse
Universal init.d enabler still says this
Please send me your log files from this folder:
/data/local/tmp/systemrw_1.32/log/
Thanks.
lebigmac said:
Please send me your log files from this folder:
/data/local/tmp/systemrw_1.32/log/
Thanks.
Click to expand...
Click to collapse
no log file appear there
lebigmac said:
Please send me your log files from this folder:
/data/local/tmp/systemrw_1.32/log/
Thanks.
Click to expand...
Click to collapse
ah i needed to run the script, here
systemrw: Initiating procedure...
systemrw: Device is in Android mode. Ignoring
systemrw: Current device: samsung
systemrw: Current Android version: 10
systemrw: Current SELinux status: Permissive
systemrw: Unable to locate super partition on device. Ignoring
systemrw: /system is already R/W capable. Ignoring
systemrw: /product is already R/W capable. Ignoring
systemrw: /vendor is already R/W capable. Ignoring
systemrw: Adjusting permissions...
systemrw: Attempting to disable dm-verity and verification...
systemrw: There was a problem removing read-only restriction(s) of your device. Abort
lebigmac said:
Please send me your log files from this folder:
/data/local/tmp/systemrw_1.32/log/
Thanks.
Click to expand...
Click to collapse
also, every restart or boot, my tmp folder gets wiped
@Fgacko type this and send me result please:
Bash:
adb shell
su
tune2fs -l /dev/block/by-name/system | grep "features"
lebigmac said:
@Fgacko type this and send me result please:
Bash:
adb shell
su
tune2fs -l /dev/block/by-name/system | grep "features"
Click to expand...
Click to collapse
hmm ok, by any chance you know how to revert build.prop? like the default.prop and prop.default, its cause i accidentally changed a line and its stuck in bootloop
Fgacko said:
hmm ok, by any chance you know how to revert build.prop? like the default.prop and prop.default, its cause i accidentally changed a line and its stuck in bootloop
Click to expand...
Click to collapse
nvm, ill just reflash the rom
Fgacko said:
hmm ok, by any chance you know how to revert build.prop? like the default.prop and prop.default, its cause i accidentally changed a line and its stuck in bootloop
Click to expand...
Click to collapse
That's easy. Simply:
boot into custom recovery
login with your password to decrypt /data
mount /system (/system_root) in the mount options
remount /system (/system_root) as r/w by running mount -o remount,rw /system_root
replace faulty default.prop with your original backup from computer
done
lebigmac said:
That's easy. Simply:
boot into custom recovery
login with your password to decrypt /data
mount /system (/system_root) in the mount options
remount /system (/system_root) as r/w by running mount -o remount,rw /system_root
replace faulty default.prop with your original backup from computer
done
Click to expand...
Click to collapse
problem is, every time i reboot to system it replaces it with the faulty one
Fgacko said:
problem is, every time i reboot to system it replaces it with the faulty one
Click to expand...
Click to collapse
ill just reflash the rom and send you the log file thingy later since its 1:32 am here
lebigmac said:
@Fgacko type this and send me result please:
Bash:
adb shell
su
tune2fs -l /dev/block/by-name/system | grep "features"
Click to expand...
Click to collapse
do i need to run this in adb?
Fgacko said:
do i need to run this in adb?
Click to expand...
Click to collapse
also, when i went to /dev/block/by-name/ i dont see a file or folder called "system", instead it was "SYSTEM" with 0 B
Fgacko said:
also, when i went to /dev/block/by-name/ i dont see a file or folder called "system", instead it was "SYSTEM" with 0 B
Click to expand...
Click to collapse
ok it worked
Thanks for the screenshot. I can't believe you actually got that command to work
It looks like your device doesn't have shared_blocks read-only feature so my script will not be able to remove the read-only lock of your device
If you want you can also check your other partitions such as product or vendor with the same tune2fs -l command but it should be the same result.
You must first try to figure out which Android feature is responsible for the read-only lock of your device.
Please let me know if you figure it out. Thanks.
systemrw: /system is already R/W capable. Ignoring
systemrw: /product is already R/W capable. Ignoring
systemrw: /vendor is already R/W capable. Ignoring
Click to expand...
Click to collapse
According to your script log you can already mount your partitions as R/W. Did you try mounting your partitions as r/w yet (see picture below)?
Are you using custom ROM? Some custom ROM's can do this by default. Sadly not all of them.
Good luck!
lebigmac said:
Thanks for the screenshot. I can't believe you actually got that command to work
It looks like your device doesn't have shared_blocks read-only feature so my script will not be able to remove the read-only lock of your device
If you want you can also check your other partitions such as product or vendor with the same tune2fs -l command but it should be the same result.
You must first try to figure out which Android feature is responsible for the read-only lock of your device.
Please let me know if you figure it out. Thanks.
According to your script log you can already mount your partitions as R/W. Did you try mounting your partitions as r/w yet (see picture below)?
Are you using custom ROM? Some custom ROM's can do this by default. Sadly not all of them.
Good luck!
Click to expand...
Click to collapse
yeah im using klaxosaur custom rom, i tried the command "mount -o remount,rw /" but on every boot it becomes ro again and the command only works for whatever i mounted it. ex if i mounted it in terminal, other apps like mt manager still is ro locked. how do you know which read only lock is on my device?

Categories

Resources