 Okay, today we're going to be looking at flashing the system partition again. Last time we did it through ADB just by pushing an image using ADB in our custom recovery of twerp. But we're going to look at a different way of doing it. Again, I'm in my directory here. I have a twerp recovery image here that I will boot into. So let me ADB reboot boot loader. Again, this tutorial is for intermediate users. It isn't for beginners. I assume you already know how to unlock your boot loader and how to use custom recovery. And we're just looking at some more advanced things. So here we are at the boot loader screen. And at this point, we can use the fast boot program on our computer, which I've installed through my repositories here on Debian, to communicate using the fast boot protocols to the phone here. And so you don't need a recovery at all. If you were to mess up your recovery partition, your boot partition, your system partition. If you were to mess up all those partitions, as long as you didn't mess up the boot loader, you should be able to get to this screen and be able to fix things. Now we're going to trash the system a little bit more later on and fix some things. But right now we're just going to go in and we're going to trash the system partition again. So I'm going to go ahead and use fast boot to boot this image. So basically what this is, you can on most devices just simply flash a custom recovery. Some phones, it takes a little more messing around. But in either case, if your phone supports fast boot, you can just tell it to boot an image. And if it's a bootable Android image, it will boot it. So basically what happens here is we have the twerp image, which is the twerp, basically it's an operating system. We're copying that file to the phone, loading it to RAM, mounting it and running it. Much like if you had a live CD or a live USB of distro of Linux that ran from RAM. So here we are in here. So now I should be able to ADB into the shell. Again, I can go into dev, block devices, boot devices, or block boot devices by name. Again, I can list out the system partition with the dash L and see that it's pointing to this partition here. So partition 41, we'll want to remember that. At this point I'm in here, so I can just say mount the system link. Again, since I'm in the directory, I can just give it that. Otherwise I'd have to give it the full path. And we'll mount that to our system folder here. I will go to my system folder again. I can type in mount here to list all mounted partitions. And we can see that it is mounted here. And if we list out here, you can see the files. Just like last time, I'm going to go ahead and I'm going to remove everything in the system directory, basically wiping out the main system of Android on this phone. If I was to now type reboot, the phone will reboot, but it will, let's try to focus this a little better. There we go. It's going to get caught in a boot loop. We shouldn't get any further than this Google screen. If that sits there long enough, it will restart. And unfortunately, I know of no way to get anything to come up on the screen. To troubleshoot that, we'll look more into possible options for that in the future. Again, I'll just let this sit here for a minute so you can see that it's not booting. So you can believe me that it's truly a trashed system. It shouldn't take more than five or six seconds before the animation should start. So what I'm going to end up doing here is I'm just going to hold down the power button until the phone turns off. And as soon as it turns off, I'm going to hit the down volume button and hold it. And now we're back at this bootloader screen with Fast Boot enabled. So let me go ahead and clear the screen here. Again, we have our system image, which we created in a previous video. If you want to see how I got that, check out the previous video. This should be video three in the series. So check out video two. But again, last time we used ADB to push it, basically writing it like it was a file after mounting Torp, which is a Linux operating system. But now we're just working on Fast Boot here. So what we can do is we can say Fast Boot, Flash, and give it and say system and image. I'm going to go ahead and hit Enter. So real quick, let me explain a few things here. So we're using Fast Boot, the command on our computer to use the Fast Boot protocols to the phone through USB. We're telling it to flash a partition that is labeled system. So in this particular case, you have to already have a partition there that is labeled system. If not, you have to create that. We'll look a little more into that in a future video. Let's go ahead and flash this. Now, first thing it's going to do is it's going to go ahead and erase that partition, make sure it's clear, and then it's going to start sending the file over. In this particular case, it's sending it in four chunks. Now, you notice we get this invalid sparse file format at header magic. When you get a stock ROM, usually the image file is split into multiple images. So the system partition is split into multiple images and you would load them up one at a time. And I believe that error is just basically telling you, okay, this is just one big file. That's not right. But then it just figures it out. It's smart enough to figure it out. And basically what it's doing is this is a three gig image and it has to load it all over, unlike when we did it through ADB where we basically pushed it through USB and was running it directly to the internal memory. This is loading it over to the phone, basically into RAM, writing it to the partition, then loading up the next section of it and doing the same thing for all four sections here. And obviously this phone, I'm not sure does it say on the screen here. I forget how much RAM this phone has. I'm going to guess three gigs of RAM. So I mean, if you don't want to push gigs and gigs to a phone that doesn't have that much RAM, it's going to overwrite it. So basically fast boot is smart enough here to split this up into sections. So it's going to divide it up, send over a section, write it to the drive, then send the next section over after removing that first section from RAM, writing it to the drive, so forth and so on. And it shouldn't take too long. So you can see here that it took 16 seconds to copy. It took less than a second to erase the system partition. 16 seconds to copy the first. It's about a half a gig here if you did the math. And then it took about 20 seconds to write it. Same here, 16 seconds to copy it over. And then to write the drive, it took 70 seconds. Now we're on the third part. It's copied over again. It takes about 16 seconds to copy over that half a gig. Write it. We're on the last one. It's the smallest. It shouldn't take very long. So again, this is a lot faster than it was, again, pulling from the phone. We can push to it faster. And I'm not really sure why that is. I guess the read speed is faster. I'm not even going to guess why. But here we go. It's writing the last little part of this. And as soon as it is, we can see we're already on the start option here on the screen. And my camera battery is about to die. So hopefully we get this done before that dies. And just writing that last little section. The suspense. Okay. There we go. So it tells you how many seconds it took. And at this point, all I have to do is click start. So the power button there, because the volume buttons go up and down on this particular phone to go through options. And the power button chooses that. We get the Google screen here. And everything went well in a couple seconds. There we go. We have our boot animation. Again, I feel like this camera is not focused. It's very hard to focus the cameras kind of on, or the phones kind of on angle. I hate filming screens like this. I say that all the time, but there's only so much I can do. I want to work on real hardware for you and give you a visual. And there we go. We're right back to how we were. So that is another option as opposed to just using ADB and pushing it as a file to the drive. We were able to use our bootloader and fast boot tools to copy it over. So even if you don't have a recovery image and or if you got trashed or whatever, you don't need it because the whole point of fast boot is to fix your partitions and to flash partitions. So if you have those images and those images aren't corrupted, you should be able to flash them over as we just did. And you can do that for any of the partitions. The boot partition, the cache partition, the user data. That's a good question because on a lot of newer phones, it's encrypted by default. I'm not sure if it will copy it over. That's a good question. Anyway, just thinking there. Like I said, there's almost 40 partitions on this phone. So we'll look at how to pull ways of pulling each of those. Obviously, twerp can make a backup and restore those, but it doesn't hurt to make your own images in case for some reason something happens to twerp and it won't write those. You have to be able to fix stuff with fast boot if your partitions really get messed up. I do thank you for watching. Please visit FilmsByChris.com. This is Chris with a K. Check out the link in the description. As always, I hope that you have a great day.