Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,731,300 Members 52,644 Now Online
XDA Developers Android and Mobile Development Forum

[SOLVED] Using Terminal Emulator to write to system

Tip us?
 
bodieism
Old
(Last edited by bodieism; 24th May 2014 at 07:37 AM.)
#1  
bodieism's Avatar
Senior Member - OP
Thanks Meter 34
Posts: 243
Join Date: Dec 2010
Location: Piedmont Triad

 
DONATE TO ME
Default [SOLVED] Using Terminal Emulator to write to system

Not sure if this will help anyone else, but I searched forever trying to figure out how to write into the system folder using Terminal Emulator on the Note 3 to no avail. I found a slew of posts that said to type "mount -o rw,remount /system" to achieve this. When I used this command it didn't return any errors so I assumed it worked, however no files ended up being copied and pasted to the location I wanted. I found numerous other examples that were supposed to enable writing to the system as well, but none of them worked. I finally figured out how to get it to work on my Note 3 by typing "mount" in terminal emulator and noticing that at the very beginning of the string that was returned was "rootfs". So if you are wanting write to your system using Terminal Emulator on the VZW Note 3 here is what ended up working for me:

Code:
mount -o remount,rw rootfs
to return to read only enter:

Code:
mount -o remount,ro rootfs
I wanted to figure this out because a bug in TWRP v2.6.3.0 maimed my efs partition and bricklooped my phone. Even flashing the Stock Developer tar by Beans wouldn't bring it out of the brickloop. I was able to get out of the brickloop by following this thread, but even though my phone booted up and the IMEI # was correct, my /efs folder was missing in action. This caused odd things to happen like my lock screen not functioning and the power button instantly turning the phone off instead of bringing up the power menu. I discovered this was because the phone was placed into something called "factory mode" and that to fix it you needed to edit some files in the efs folder, which were completely missing on my device. Member js0uth graciously sent me his efs folder from his Developer Note 3 and when I copied it to my phone it began to function normally again (big shout out to js0uth!). However, this folder was completely deleted once again after a reboot. So now you can see why I was looking for a way to copy these files using Terminal Emulator. I ended up making a Tasker profile with the Secure Settings plugin that automatically copies the files from my ext SD card to my system folder on boot of the device. In order to mount, copy/paste the files while retaining the correct permissions from the folder that js0uth sent me, and unmount the system I had the set up my Secure Settings command as follows:

Code:
mount -o remount,rw rootfs;cp -Rpf /storage/extSdCard/efs/* /efs/;mount -o remount,ro rootfs
So now I have a livable workaround for my problem until I can discover a way for the phone to rebuild my own /efs folder.

Edit: See radionerd's post for a permanent fix to this issue and be sure to hit thanks under his name if it helps you.
Current Phone: Verizon DE Samsung Galaxy Note 3 with Android 4.3
The Following User Says Thank You to bodieism For This Useful Post: [ Click to Expand ]
 
radionerd
Old
#2  
radionerd's Avatar
Member
Thanks Meter 33
Posts: 88
Join Date: Dec 2013
Location: Ukiah

 
DONATE TO ME
I did the same to my DE. Corrupted EFS about a month ago after a few flashes using TWRP 2.6.3.0. Boot loops for 28 hours of hell until I followed your tracks to the trick that deleted my corrupted EFS folder, and created a new empty folder. I guess this would wipe out IMEI, Mac, and more in models that store phone specific data in EFS. We lucked out I've read that our phones have that info in a few other folder not EFS

Since wiping EFS I have run stock ROM, CM11, and now bean V6. I didn't see the factory mode popup until recently. I noticed that the screen will flash when leaving or entering cell service.

My corrupted EFS was 3MB. I'm curious what's the size of the EFS folder from js0uth?

Were you able to enter the factory mode on string? something like this?
Code:
# echo -n ON > /efs/FactoryApp/factorymode
this is from an S3

Thanks for documenting your steps to recovery.

radionerd
Attached Thumbnails
Click image for larger version

Name:	Screenshot_2014-01-26-12-20-14[1].jpg
Views:	50
Size:	155.6 KB
ID:	2548132  
The Following User Says Thank You to radionerd For This Useful Post: [ Click to Expand ]
 
bodieism
Old
#3  
bodieism's Avatar
Senior Member - OP
Thanks Meter 34
Posts: 243
Join Date: Dec 2010
Location: Piedmont Triad

 
DONATE TO ME
Quote:
Originally Posted by radionerd View Post
My corrupted EFS was 3MB. I'm curious what's the size of the EFS folder from js0uth?
It's 1.04 MB. Sorry for taking so long to respond. I thought I had it set up to send instant emails for replies to this thread, but apparently I didn't.

Quote:
Originally Posted by radionerd View Post
Were you able to enter the factory mode on string? something like this?
Code:
# echo -n ON > /efs/FactoryApp/factorymode
this is from an S3
Setting the Factorymode folder to ON is actually what disables that mode. Seems backwards I know, but when it's set to OFF (or if the folder is completely missing as in my case) that warning message will display. If that folder is intact on your phone then you should be able to use a string to disable or enable Factorymode.
Current Phone: Verizon DE Samsung Galaxy Note 3 with Android 4.3
 
radionerd
Old
#4  
radionerd's Avatar
Member
Thanks Meter 33
Posts: 88
Join Date: Dec 2013
Location: Ukiah

 
DONATE TO ME
Default It got worse before it got better :)

[QUOTE=bodieism;52087122]It's 1.04 MB. Sorry for taking so long to respond. I thought I had it set up to send instant emails for replies to this thread, but apparently I didn't.

No worries, I went from an annoyance of no lock screen to bricked for over 6 weeks. This happened after trying to do an EFS backup.

I've learned a lot since back then, My DE is back 100%, EFS is repaired. I think we ran the same script which actually points to the wrong mount in our phones. It brought us out of bootloops, but efs was pointed to block12. Qualcom snapdragon Note-3's use mmblk0p11 to load /efs.

If you still have to load the tasker script, I think I figured out an easy fix to rebuild your original efs folder.
I would backup mounts first, delete /efs folder. Then run the original script, but this time change from 12 to 11.


Code:
adb shell
su
mke2fs /dev/block/mmcblk0p11
mkdir /efs
mount -t ext4 /dev/block/mmcblk0p11 /efs
Bet that would do the trick

Here is my thread
The Following User Says Thank You to radionerd For This Useful Post: [ Click to Expand ]
 
bodieism
Old
#5  
bodieism's Avatar
Senior Member - OP
Thanks Meter 34
Posts: 243
Join Date: Dec 2010
Location: Piedmont Triad

 
DONATE TO ME
^ That did do the trick!

Phone is back to 100% working order
Current Phone: Verizon DE Samsung Galaxy Note 3 with Android 4.3
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes