 Okay, again this is part of a series. I hope that you watched the previous videos in this series, hopefully there's an annotation on the screen or a link in the description of the video to the full playlist because you'll probably be lost if you haven't watched them. This is a somewhat advanced stuff and just stuff that's hard to find information on so I thought I'd do some tutorials on. And today we're going to be mounting an Android system partition which is the main file system for your Android device. As we write, so we can make modifications to and we're going to be installing a busy box, a fuller version of busy box on the phone. I'm using the Motorola G here. This should work with any device that uses fast boot which is most devices. It's not a most Android devices. Samsung does not use it but I think for most part other manufacturers use fast boot. It's the most common boot loader. You can get into the boot loader once you have turned on USB debugging by typing sudo adb reboot boot loader. That's where my phone is right now. Also as I mentioned in previous tutorials tools we're using are fast boot adb and a boot img in this series. So go ahead and install them. This is how you do it on a Debian system. Use whatever package manager your system uses and those programs should be in there that might be slightly different name but adb fast boot and a boot img. Once you're at the boot loader, let's list out here. You can see I've got two files here. I've got our twerp recovery project image our team win recovery project image and a version of busy box for Android devices. It's been compiled for ARM Linux devices and so we want to get this installed onto our Android device. So first you need to do is get that file right there and you can compile your own busy boxes for an open source but if you want to get one that's already compiled there already some out there you can get them different places. Be sure you get it from some place you trust. I'm recommending this one right here just because that's the one that I used. I don't know the guy I'm just taking a leap of faith in this case that there's nothing malicious in here but if you google search get hub busy box android you can get from there your phone might already have a version of busy box on it but it may not be a full version may not have all the tools you want. This one here has pretty full versions so this one has an already compiled version of busy box of course you can go to the busy box website get the source code and compile it yourself but this file right here is the binary file again giving trust into this guy here and then we'll click raw view that will download the binary I copied it to my folder here renamed it he had it named busy box dash android I renamed it just busy box but that's the file right there and if we do file busy box it will tell us that it is a arm compiled Linux executable. So now that we have that we want to put it on the phone but we need to mount our system partition as writable so again you go oops did that in the other video too you gotta run this command sudo adb reboot bootloader and that'll bring you to the bootloader which is unlock we did that in the first tutorial and now we want to boot our recovery image because that will give us a root shell in the recovery mode so we'll say sudo adb I'm sorry sudo fast boot boot our twerp image it's downloading it's the phone booting the phone will reboot into the recovery image that we just loaded again that's loading it too ram we didn't make any changes to the actual hard drive on the phone now that we have that now we can sudo adb shell and I just want to point out to not confuse you I'm using sudo just because I need permission on my particular computer I have it set up so that only sudo or root can access the android device that's why I'm using sudo that does not give you the root on the phone the reason I have root on the phone is because the recovery image is set to default to root for the shell now we need to figure out what partition is our system partition and mount it because if we type out mount here you can see recovery has mounted a number of partitions but not a system one so we need to go to our internal hard drive figure out what partition is our system partition so if you watch previous tutorial I use parted which is a tool that's very commonly found on linux systems for modifying and getting info about partitions and our internal hard drive is under dev block mmc blk it's the first one so zero with an enter and if we type out print it will print out all the partitions and their labels and we want to mount the system one so it's partition 36 remember that because I'll probably forget in about a minute when I go to use it again if we list out our root partition here there is a system folder we can list systems see if there's anything in there there is a bin folder is there anything in that again this is a ram disk there's nothing in there so we can kind of overwrite that or we can create our own folder to mount to so the two ways you can do this we can say mount device block the first block device which is zero partition I think I said 36 and we'll hit enter and this particular recovery image knows to mount that based on the labels so if we now list out our root system folder you can now see that there's files in there so there are files in there let's you mount that and that doesn't look like the right partition did I say 36 scroll up I got cut off let's up arrow a few times to check this out again print system yes 36 okay and it's yeah that's it because it's uh over a gig in size so it's it's fairly big so let's go ahead and quit out of that check mount I unmounted that correct yes so you can mount it there or for some reason here you have something mounted or you feel uncomfortable putting it on the system folder there because there was a file or a folder in there because if we list out now we can see that that bin folder is back you can also you know mount it wherever you want you can say make dirt I'll just make an mnt directory and then I can say mount our device block device the first block device partition 36 um mnt and I can go into that mnt and list and there we go we have our partitions and if we see the into bin and list out here I'll list out um um busy you can see there is a busy box already there your phone may already have busy box again a lighter weight so you know either back obviously back up the partition before you make any changes to it before you even mount it back it up uh you can rename that or delete it if you already have it backed up somewhere so what I'll do is that that's actually the one we were about to install because I've already put it on my phone what I'll do is I'll remove uh busy box okay it's removed and if I exit out now clear the screen what I can do is I can su sudo adb put busy box oops never try to autocomplete with adb it just makes things annoying adb put busy box uh to our system bin folder and I obviously typed something wrong oh I said put and it's supposed to be push there we go it said to put it there let's go ahead and log back in system bin list and actually let's oh that's right remember where you mount stuff because I just put it in the wrong directory for a second I thought I just wiped out everything in that directory no I put it in the wrong place because I was showing you how to mount things in different places mnt bin now shell see it's fun when I mess up because you guys get to laugh at me and also might help you if you make the same mistake let's doubt we have all the files here we'll say list busy box dash h is not in the default list program although if you use the one in busy box it is and you can see it's there it is not executable though so you'll probably want to change mod plus x busy box and right there is now executable and let's go ahead and reboot my phone so we'll say reboot from here it's thinking about it oh with the twerp recovery if the screen is shut off and you go to reboot um that's fine if you try to reboot into bootloader and the screen's off it basically if you try to reboot when you're in twerp and the screen is off it like confuses and just restarts the phone which is fine if you're just rebooting you're trying to reboot into the bootloader click the power button turn the screen on first otherwise it'll just boot into your regular operating system which is fine because that's what we're doing now anyway get a little load screen here once it's all booted I will then use sudo adb shell to get back in there on the phone right now I still don't have root divide root permissions that's something we'll get into in a future tutorial building up to that there we go I'll hit enter device not found give it a second okay now if your screen is locked which normally I have my screen locked um I unlocked I turned off the pin for this video um you'll have to log in with the pin before you can access the shell obvious security reasons on newer android devices older android devices now you could log into the shell before the phone even finishes booting but now I can type in busy box and you can see a list of all the programs that are available within busy box you got uh ftp stuff you've got your http servers you can start up a server on there you have your churr root which you need root to really work with um so yeah you have all these commands at your disposal now if you haven't linked them then they're not going to run you're gonna have to either run so let's say I say list lha it's saying uh it doesn't know what the h command is which makes human readable uh for the file so if I say list dash la you can see it lists all the files but uh the file size is in bytes I think uh so a little hard to read when it's a bigger file so normally I like using a dash h if I do busy box ls dash la la lha you can see it does run even color code stuff for you which is nice so you can see already the list command the ls command that's on the device is not as advanced as the ls command that is in the busy box this is also true when it comes to mounting stuff and changing permissions like if I wanted to change permissions something would change mod with the busy box version I can dash x if I try doing that with the regular version I have to use um you know the the hex codes or the the the number codes here so take that in account if you go back to the website we got our busy box from he does have an install sh so we click on that look at it and um what it does here somewhere in here it tries to look link through all the different um busy box commands and uh let's see look through there I think it's pretty sure it's this one here somewhere it links through all the busy box commands and tries to replace the system programs such as ls with the busy box linking it to busy box and changes the permissions so this all script also manually copy it over to your phone for you or it will try to automatically copy it over phone for you so look at that see it's using adb shell to mount that you have to obviously have root on the phone first so I don't know I haven't tried running this script but I uh have oh here we go this is where it's listing all the busy box commands and linking them removing the original and linking the new so you can do that I haven't tried running this script but I I did the same exact thing manually uh based off this script so look into that uh otherwise you have to type busy box and the command for every command you want to run that uses busy box up to you how you do it I haven't uh really changed anything on my system yet rather new phone so but again always back everything up first so let's installing busy box and getting rewrite permissions on your system obviously it's only rewrite when you're in the recovery but you really really really don't want your system partition writable all the time and in fact very rarely do you make changes to it you make changes to it and then leave it you know it's it's not something you should be modifying all the time and of course like as I said a few times back everything up first so I thank you for watching this video I thank you for enjoying it if you did kind of advanced topics but I tried to simplify it for you as much as possible hope you watched all the previous videos or else you might be a little lost on this um not a whole lot of information out there on these topics so that's why I'm doing these videos um if you liked it be sure to let me know comment below like share subscribe uh and as always I hope you visit my website filmsbychris.com that's chris the k should be linked to that in the description and I hope that you have a great day okay this is an introduction to filmsbychris.com I'm chris that's chris the k that's me right there my daughter ember and my wife jennifer we pretty much live in the swamps of florida I'm a firefighter by day as well as by night we work long hours but that's not why you're here you're here about the videos I put up on youtube these videos are mainly about computers and programming which means most of my videos look something like this and if that's what you're interested in great if not that's all right I do videos on other topics too such as video editing special effects photo editing 3d design and music creation if you are one of my viewers and you enjoy my videos my patreon page is a place where you can go to help support my videos so I asked that you take the time to go to my patreon page and look at different levels of rewards you can receive four different levels of backing there should be a link in the description of this video if you were watching it on youtube otherwise you can visit patreon.com forward slash metal x1000 and I thank you for your time and your support have a great day