Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[SOLVED] Using Terminal Emulator to write to system

OP bodieism

12th January 2014, 10:55 PM   |  #1  
bodieism's Avatar
OP Senior Member
Flag Piedmont Triad
Thanks Meter: 34
 
243 posts
Join Date:Joined: Dec 2010
Donate to Me
More
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.
Last edited by bodieism; 24th May 2014 at 08:37 AM.
The Following User Says Thank You to bodieism For This Useful Post: [ View ]
30th January 2014, 07:53 AM   |  #2  
radionerd's Avatar
Senior Member
Flag Ukiah
Thanks Meter: 89
 
188 posts
Join Date:Joined: Dec 2013
Donate to Me
More
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:	61
Size:	155.6 KB
ID:	2548132  
The Following User Says Thank You to radionerd For This Useful Post: [ View ]
21st April 2014, 11:09 PM   |  #3  
bodieism's Avatar
OP Senior Member
Flag Piedmont Triad
Thanks Meter: 34
 
243 posts
Join Date:Joined: Dec 2010
Donate to Me
More
Quote:
Originally Posted by radionerd

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

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.
22nd April 2014, 05:53 AM   |  #4  
radionerd's Avatar
Senior Member
Flag Ukiah
Thanks Meter: 89
 
188 posts
Join Date:Joined: Dec 2013
Donate to Me
More
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: [ View ]
24th May 2014, 08:33 AM   |  #5  
bodieism's Avatar
OP Senior Member
Flag Piedmont Triad
Thanks Meter: 34
 
243 posts
Join Date:Joined: Dec 2010
Donate to Me
More
^ That did do the trick!

Phone is back to 100% working order
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes