TWRP - The big mystery.. or "TWRP in a Nutshell" Chapter 3: Advanced, Mount, Troubleshooting

Before we start I encourage you not to mess around in this section.. you can mess around pretty much .. you should have at least basic Linux Knowledge to use the Advanced Section as powerfull as it can get.. yes you can mess your mobile pretty bad in TWRP in terms of erasing your content or installing wrong stuff.. but in here you actually can mess around deep in the system... nothing you canot fix with a wipe/fresh install but as i said.. Linux Knowledge is a requirement to use it right.



lets first have a look at the "Mount" section


Please login to see this attachment.


Mount you maybe heared in other circumstances.. you Mount a Volume... the choices you have are different volumes.. you can allso call it drives if you want to make a connection to windows... System is a volume (explanation of the different volumes are in the predecessing chapters ) .. Data.. Cache .. EFS .. MicroSD Card and USB OTG


the system volume is per default UNMOUNTED... means normally you canot access the system volume directly in twrp.. except you mount it exclusively..


Data is mountet per default since there arent so much system relevant stuff... ok it IS relevant.. but nothing that prevents the mobile from booting or functioning .. as the system volume does...


Cache is somewhat volatile... missing stuff is rebuilt every boot.. mounted per default


EFS is unmounted per default since it houses the most important stuff of your Mobile... the IMEI and other stuff... just dont mess around with it..


MicroSD card aka external sd card mounted per default since you normally want to interact with it (installing roms, stuff from it)


for paranoid ones you can mount system read only.. so you can look on the system volume but dont have to panic that you do something wrong..


this does not apply when installing ROMs and such... the aroma installer mounts system volume read/write per default and overrides this setting.. its only for debuging purposes of the user not for programs


honestly i dont know what the "select storage" button does... makes no sense to me =)))

Disable MTP disables the Media Transfer Protocoll .. wich is needed when transfering files from external sources (like UBS OTG).. it can be enabled again



If you want to modify specific files.. like (not that you have to.. there are many zip files that handle that for you) .. just if you wanted to modify for instance the Boot and shutdown screen of the samsung you need acces to the system volume ... you can then move/delete/copy/rename files around in the file manager.. but only after you mounted the system volume..


that brings mi directly to the next one.. ADVANCED


Please login to see this attachment.


In there the button you will youse 99.9% of the time is the FILE MANAGER


if you mounted system before.. you can go into the file manager and drive around in the VERY root of your phone.. so be a bit focused not to delete/move/whatever something down there... cause it could softbrick your phone..


Please login to see this attachment.Please login to see this attachment.


this is your folder structure.. the ones you normaly mess around with in 99% are either "external_sd", "sdcard", "system" ... some stuff can also us sys and sbin .. normally you wont need that directly since most stuff is automated these days ... dont be confused about the root folder ... its NOT your root and no program can see the root folder .. it is merely the SuperSU wich twrp includes to help you get root if you dont have one..


These folders have to be "MOUNTED" to be used... the root folder will never be mounted by the system so the system doesnt know it exists.. also the sdcard folder is not seen in the system.. it will be refered as "/storage/emulated/0/sdcard"(kick me if i am wrong.. im writing this out of my memory hehehe)


now to our littlehypothetical example (just to explain.. dont do this just for fun..hehe) ..


you want to change the boot screen of the samsung and have the respective file (only name one now.. ) bootsamsung.qmg ..


this file is resided in the /system/media folder... you can now go to that folder and search for the respective file.. you can then delete it.. no problem...


Please login to see this attachment.


you press on the respective file and you get those 6 buttons...


Copy folder => copys everything in this folder (recursively) .. you have then to go to the directory you want to place and press the button at bottom right that appears and it wil do so... remember there is no indicator of how long it will take since this is a pretty rudimental kind of file manager... if the files are several gigs big it can take a while


Move => move a file.. you get a folder structure like above..

delete => pretty sums it up.. deletes something..

rename folder => renames a folder though :)


Chmod => this is something what linux users know for sure.. it is the all beloved attribute changing command ... here you can change file acces attributes .. very essential since android is nothing less than a kind oflinux..


i wont cover this entirely.. there are way better tutorials articles about chmod ..


just to explain how it is built up



Owner Group Public
Read 4 4 4
Write 2 2 2
Execute 1 1 1



looks strange ... ok .. its rather simple ... Chmod is made out of 3 digits ... the first digit is the owner digit... the group digit is the second and the public digit is the last one..


if you want for instance have a file only read/write by you (owner) and the others should ownly have read access.. you can count the numbers together columnwise top down


and get .... 6 (read write owner = 4+2) 4 (read group) 4 (read public) ==> 644

or owner read/write/executable, group read/executable, public none => (4+2+1, 4+1, 0) => 750


i hope you get it hehe ... sometimes you see in root browsers something like rw-r--r-- or rwxr-x--- or rwx-r--r-- .. this is also related to this.. and rather simple... from left to right owner/group/policy ... a chmod 644 would be rw-r--r-- or a chmod 750 would be rwx-r-x---... i think you get it hehe


.... now back to the bootsamsung.qmg .. once deleted you have to copy the new one in here.. /system/media ... and then you have to give it the PROPER RIGHTS ... the chmod.. if you dont give the proper rights the system canot act with it as supposed to... you have then to chmod it 644 .. (RW-R--R--) otherwise it wont work... and your device wont boot..


so now you also understand the button "Chmod 755" ... comon... tell me.... yes!! rwxr-xr-x that is =))


since this is commonly used for executable apps wich belongs to "you" .. it doenst make sense to make a jpeg for instance executable... huh ? executable jpeg ? wtf =))




you can do alot fixing in the file manager if you for instance deleted something you shouldnt have.. of to rip out magisk.. or super su.. or whatever... most of this stuff is automated in zips these days so you dont have normally to mess around with it but its nice to know its there if you are in a troubled situation.. i for my part had to uninstall supersu / magisk manually back the days they came out.. no zip files written or only some shell scripts =)




Now lets head back to the "main" advanced Screen..


I wont go too deep in the rest of the advanced menu since some stuff is very rarely used or only for real linux freaks who know how this stuff works..


Please login to see this attachment.


Copy Log => can be handy if you have werid behaviour and a dev asks you for a log...

Fix Contents => it will say too when you press the button that it is VERY rarely used.. can fix some permission / partition glitches... i wouldnt touch it.. normal it will cause more problems than solving it.. i would rather format/wipe/reinstall rom than doing "fixing contents"

Partition SD card => says it all..

Reload thme => supposed to be a debug thing for themers of twrp.. dont have any idea.. just reloads the twrp ui



Terminal => Now that is what a linux user really can make something of....

Please login to see this attachment.



A Terminal window is also refered as shell .. or command prompt somehow... if you know linux (android specificaly) you can act in here like in a terminal window and do stuff like sudo or grep whatever...


ADB Sideboard => this takes the Terminal to the next level ... to use ADB Sideboard you need additionaly a usb cable connected to your PC and an ADB terminal on your PC wich works... then you can start ADB Sideboard on the Phone and then start de ADB terminal on the PC and can basically use the ADB Terminal on the pc to inject commands (like in terminal) and also transfer Files back and forth... only for VERY advanced users and people who really know what linux/android is about.. i for myself tried a few times to use ADB but it failed me on the PC side... wanted merely to know how it works.. never got it to work... terminal i know a bit.. i know a bit linux stuff but not as much that it makes sense to use it...


So that pretty closes off the TWRP in a Nutshell Blog .. hope y ou enjoyed it..


Tell me if you are something missing.. need more details or what you would change.. or if i explained something totally wrong and want it to be corrected...


I didnt google for anything in this blog.. its all of my personal library.. my brain.. and my experience over the last decade(s?) of mobile stuff i work with


If you have some specific wishes / inputs what you would like to see next.. just tell me here or write me a message... it can be also something different... have also other hobbies like you can see in my signature hehe .. other hot stuff atm with me is the PC customization stuff.. different platforms (AMD/Intel/Nvidia) or cooling stuff (air/water/passive/active)


                                                                                                                         


Don't take life to serious... nobody will get out alive anyway :cflol:

                                                                                                                         

Samsung Lover...<3

PC Modding/Watercooling Enthusiast...:-P

Can write with 300 Chars/sec B-)

I love Anime :heyes:

Roleplayer for like ever :hollow: