5,596,784 Members 48,027 Now Online
XDA Developers Android and Mobile Development Forum

[SOLVED] Using Terminal Emulator to write to system

Tip us?
(Last edited by bodieism; 12th January 2014 at 11:11 PM.)
bodieism's Avatar
Senior Member - OP
Thanks Meter 33
Posts: 241
Join Date: Dec 2010
Location: Piedmont Triad

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:

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

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:

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.
Current Phone: Verizon DE Samsung Galaxy Note 3 with Android 4.3
radionerd's Avatar
Thanks Meter 16
Posts: 60
Join Date: Dec 2013
Location: Ukiah

I did the same to my DE. Corrupted EFS about a month ago after a few flashes using TWRP 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?
# echo -n ON > /efs/FactoryApp/factorymode
this is from an S3

Thanks for documenting your steps to recovery.

Attached Thumbnails
Click image for larger version

Name:	Screenshot_2014-01-26-12-20-14[1].jpg
Views:	30
Size:	155.6 KB
ID:	2548132  
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes