 Okay, in a previous video, I showed you how to find which partition is which on an Android device using twerp recovery. And today we're going to back up a partition, destroy that partition and recover it, which there are different ways to do it. Obviously, with twerp you can do that. They will make backups and restores, but we're going to look at doing it a different way, a cooler way. We're actually going to pull the system image to our desktop computer. So first thing I need to do is I have the phone hooked up through ADB, and this is my Nexus 5X, ADB reboot, boot loader, and the phone will now reboot. And again, I assume that you already know how to unlock your phone and you know how custom recovery works. You can install custom recovery. I actually have the recovery for this twerp image for this phone, and I'm not going to install it. I'm not going to flash to the phone. I'm just going to use fastboot to boot that image. So it's basically copying this image over and loading it to RAM without affecting the internal memory. So once twerp is loaded, I can now ADB shell to get into it. I'll let it finish loading, otherwise it will kick me out in a moment. Let's see. Okay. So dev, block, boot devices, and then by name. And again, I can list out all the, again, there's symbolic links to different block devices and partitions. We want the system one here. So I can either pull this link here or a direct link to dev, block, our block device, zero partition 41. So now that I know that, and I know that this is an Android device, which means that it is a Linux device and Linux, just like a Unix system, it's a Unix like system, all your hardware is a file. So real quick, with ADB, we know that we can push and pull files. So I can ADB pull, and I can pull that partition, and I can just call it whatever I want. I'll call it system.img, and I am going to pull that. Now as you can see on the screen here, it doesn't know the file size, but it's pulling that basically the raw information from that partition. You can do this with any of the partitions, although remember certain partitions such as your user data might be encrypted. And I know of no way to unencrypt those partitions on a desktop device. But you can always load it to a phone and decrypt it. Also realize that we're pulling the raw data, it's better to have it unmounted. You can pull it while it's mounted, just you don't want to be making changes to the partition while you're backing it up. That's usually a bad idea when you're backing things up. And again, we're pulling this, it's going to be just like any other image. Now, you could log on to the phone and use DD. There's a lot of tutorials using DD to make a copy of that partition. And there's nothing wrong with doing that. There's a lot of benefits of using DD. You can change the block size so that you can, it might be a little bit faster. And there's other benefits of using DD, but you don't need DD. You can just pull it just like this. And on any Linux system, you can actually cat a partition or a drive to a file and make an image. You don't need any special tools. And again, like this, we're just pulling it as if it was a file. And it's that system partition. Do realize though, in this particular case, this system partition is a three gig partition. Only under two gigs of that is being used. Over a gig of it is free space, but it's still going to pull down three gigs in size. Because it's pulling on the whole partition. Now, once you pull it down and once you use it, you can compress it with GZip or some other compression tool. And it should compress very well because that empty space in theory should compress very well. So like I said, it's just under two gigs. I think it's 1.8 gigs are being used and 1.1, 1.2 gigs are free. It should compress down to at least that 1.8 maybe smaller, at least in theory. Also, once we have it pulled, you'll see we can look at this particular partition. It's just a standard Linux partition. Again, the system partition is basically your core of Android. And normally when you're running Android, it's mounted as read only. All your changes, all your installed applications usually don't mess with the system partition. In fact, if you modify your system partition and you go to do an official update, it probably won't let you because it's going to look at that partition and realize it's been modified and it won't push the update. So you do want to, if you're going to make any modifications to the system partition, definitely have a backup so that later on if you want to do an upgrade of an official stock upgrade, you can do that. Now, again, this is going to take a while because it's going to be pulling three gigs. But once it's pulled, again, this particular partition, not every partition on that device is a standard Linux partition, but I can mount this and go through the files and see the whole system and how it works. What I'm going to do here is I'm going to speed up the video to the end of this because it's going to take a little while to do. And then we will trash the system and reflash the system, which is actually very simple. But we'll also make sure that our backup backed up properly. So let's go ahead and speed things up. So it has backed up. Let's go ahead and check the size of that file. We can see that it is three gigs in size. And we can also check it with file, which tells us what type of file it is. It will look at it and it tells us that it's a Linux file system because it's the UUID and it says its volume name system. So even if we didn't name the system, we would know that it's the system partition, which is awesome. It's an EXT2. And now we want to make sure that it was backed up properly, that it's identical to the one on the phone. So I can sum, sorry, MD5 sum this file, system image. And it's going to take a little while to do that. While it's doing that, I'm going to split the screen here and I'm going to ADB shell into the phone. And I will go device, block, boot device, buying name. And I'm going to, on the phone, MD5 sum the system partition. And we should get the same output for those two things, the image. And that partition should have an identical output. If they don't, then it didn't copy identically. And that could be bad. It could mean something's corrupt. There we go. So you can see E48927, E48927, and all the way down to 28ED. So we got a great copy. So what I'm going to do here, let me close out the screen here. So I am currently on my phone right here. And I am going to mount that system drive. So I'm going to mount system to the system folder. And I will go into the system folder. And you can see everything here. And I'm going to be brave. I'm going to say remove everything from here. And so I just wipe my system clean. So what I'm going to do is I'm going to type reboot. And the phone will now reboot. And it might go into a little thing where it says, command not found. No, it seems to be booting fine. Let's see what happens here. We should get stuck in a boot loop, because the system just isn't there anymore. Unfortunately, I don't know of any way to get messages to show up on the screen here for troubleshooting. But you'll see here that it's going to stay at that Google screen for a long time. And probably reboot at some point. So yeah, the system is now wiped. I mean, I can sit here longer to prove it. But you saw me wipe it. So what I'm going to do now is I'm going to hold down my power button. And when the phone turns off after, I don't know, five or 10 seconds, I'm going to hold down the volume button. Volume down button. OK, so now I'm going to fast boot, boot my recovery image again. And once we're in the recovery, I will bring up something important. So ADB shell. Once that's done loading, there we go. Oh, no, there we go. And I'll go into device, block device, boot devices, name. And again, I will list out the system partition here. And we can see that it's pointing here. Now, I could, when I pull it, point to this symbolic link. You do not want to push to the symbolic link. I made that mistake, and it messes up your partitions. And you've got to fix them. It's not that big of a deal. But it's going to make things worse. We want to push it directly to this dev block. And in this case, it's partition 41. Maybe different on your phone. Make sure you check. So what I'm going to do here is now ADB instead of pull, I'm going to ADB push my system image to that block device. And why does, did I spell something wrong? Oh, I've put pull again. Push. There we go. Let that run for a little while. And we will come back when that is all done. Basically, it's copying back. I think it's going to copy to the device a little bit faster, it seems. Maybe not. We're at 3% already. But I'm going to pause the video, and we'll come back momentarily. OK. So it has completely pushed. So let me just ADB reboot the device. And our phone is now booting. We have our Google logo. And let's see if it actually starts. Oh, look at that. The boot animation is starting. And the boot animation is found on the system partition, as I will show you in future videos. So that is one of many ways to back up a partition and push it to your device. In future videos, we'll look at some other options where maybe you don't have that customer recovery and you just have fast boot, which is the boot loader on many, many Android devices. Unless you have a Samsung device, that's what your boot loader is going to be. So I hope you did find this useful and interesting. And again, you can obviously do backups with Torp and save it to your phone. But sometimes it's good to have that partition. Because again, if you have the image like that, there's other ways you can restore it, not just with Torp. So in case for some reason, it's just good to have multiple backups in different formats. So I do thank you for watching. I hope you found this useful, interesting. And I hope that you visit my website, filmsbychrist.com. Again, this video was more of a step above beginners. But if you're looking for how to, what am I thinking here? Unlock boot loader, a little more about Torp, a little bit about customer recoveries, a little bit more about Android in general. You can go to filmsbychrist.com. Here you can search for things like Android. You gotta spell it right though. Android and, yeah, droid, void, there we go. I before E, no, I before O, O before I, okay. Or you can type in Torp or fastboot. And you can find all my videos I've done in the past on this sort of thing. And again, some of those videos are older and Android's constantly changing as inconsistent on how it does stuff. So some of the older videos, you know, some of the little tricks I did may not work, but the general ideas work. Unlocking the boot loader is different for different devices. That's why I'm not going over in this tutorial, but I have gone over both these devices in the past. I do thank you for watching and as always, I hope that you have a great day.