 Okay, this is for a viewer that I'm trying to help with some Samsung firmware for an Android device. I don't even know what Android device, but it does not matter. He gave me an image. If I list it out here, you can see it's called System IMG. Just remember, extensions mean pretty much nothing. That's just for you as a user to know what this is. And this is not a standard image file. If we do File and the name of the file, it will tell us what type of file it is. And you can see it's an Android sparse image. And if we list it all out, you can see that it is about 90 megabytes. Okay, so we cannot mount this as is we need to convert it or basically extract it because what this is, it's a compressed image. It's a compressed image of a partition that holds the firmware for his device. So what I need to do first is convert it. And with some Googling, we know that the program is called SIMG to IMG. Thing is, where is that package found? If we do aptitude or if you're on Ubuntu apt cache, if I could type today, there we go. Cache and I say search for this, it's not gonna find anything. So next thing I did, I know I'm running Debian here. So I open up my web browser, I type in SIMG to IMG Debian. First page that comes up is Debian website and its packages. And right here, I can see that it's in a package called Android tools, file system utilities. I also tried doing a more thorough search with aptitude or apt to get, searching the, what should we call it, the description of the package. And it did not come out there. So my third step was doing Google. So I'm gonna do aptitude or just so Ubuntu users don't get confused, apt get install, and that's the name of the package that I would type in my password. It's going to download and install. It's not a very big file. It's only gonna take a few seconds to install. This is actually my first time doing it. This is something I already tested out on my laptop when I was talking to the person the other day. Package is installed. That's all you have to do to install it. Don't go and download it from someplace else. So now to run it again, our file is called system IMG. And that's our sparse, Android sparse system image. We're gonna say SIMG to IMG. We're gonna give it the original file name and an output file name, which I'll just call sys.img. Okay, extract now if we list it out again, you're gonna see that the original file is 90 megabytes. And the uncompressed image is 5.4 gigs, because almost all of that space, besides 90 megabytes of it, is empty space. So it compresses fairly well. But once extracted, it's 5.5 gigs. So make sure you have space on your drive. And so at this point, I can also run file on Sys IMG. And you can see that it is an EXT-4 file system, which is just your standard Linux file system that you'd find on most Linux desktops. And in this case, you know, Android devices. There are other file systems, but we know exactly what this is because it tells us right here. So now that we know that it's just a regular image containing an EXT file system, we can mount it just like we would mount any partition from any hard drive. So let's make a directory to mount it. So I'm gonna go make directory. I'll call it FS for file system. You can call it whatever you want. I'm gonna say sudo mount. And I'm gonna say sys.img and FS. And this might work, it might not. It worked. In some cases, you might have to say, tell it which file system it is. You would say dash t, EXT-4. And you might have to say dash o, loop for a loop back. But usually most modern desktop systems, if you're running Ubuntu or Debian, you don't need to put that information in. It figures out. If you're running a lighter weight system, you might have to. Just to tell you that in case you come across that. But in most cases, if you're running a modern file system, there you go. And if we list out files inside that FS folder, you can see what's in there. And we're working directly with image now. So if I go in here, any changes I make will be affecting that image just as if it was a partition. So if I move into the FS app, and that's where most of the files are here, I can do a du-h will tell me how big all the files are in this folder, not very big. Let's say I wanted to delete a file. Let's say I wanted to delete this file so I can remove this file. And I'm just highlighting and center clicking to paste that in there. And if I list out, you can see that the sec browser tests packages are now gone. If I was to move out of these folders, because you can't unmount it if you're in those folders, I can now control L to clear the screen. Pseudo, you mount FS, that folder. Knowing that I'm in the folder that folder's in, you have to point it to it. Okay, so if I list and I list out FS, you can see nothing's in there because it's just an empty folder now, nothing's mounted to it. If I Pseudo, mount, sys.img to that FS again, and I move into FS and into app and list, you can see the files we deleted are still missing because we deleted them. Okay, at this point, something I have not done yet is converting this image back to a Android sparse image. So hopefully this works. I have not tried this yet. With the package I installed before, so at the Android tools file system utilities, and if we look at the Android here, you can see that there is also in this package a file called img2 simg. I'm just gonna guess that that's the program that converts everything back to what it was to the sparse image. So I should be able to run that img2 simg, give it the file name of the ext partition image that we have, and I'm gonna give it a different, I don't wanna overwrite the original just in case. So now I'm just gonna say system2.img. I'll hit enter, not getting any errors. Now I was gonna say it might take a little while because we're compressing it, it didn't take that long, let's list things out. And you can see, okay, so converting it back, it didn't compress, oh it compressed quite a bit more actually. I was reading that wrong, I thought that said gigs. So, depending on the files that we deleted, we now have shrunk down the size, there might have also been some other empty space in there that it wasn't compressed as much the first time, but we can see that we do have now, if I say file system2.img, it's an Android sparse image. And just to check it, let's convert it back. So we're gonna basically start all over again with this new image, just to make sure all our changes took, I'm gonna say simg2.img, our new system2.img, and I'll just call this new.img just so I don't get confused. I know this is the new one. And again, give it a second to uncompress it. Hopefully, I don't run out of space, I'm not sure how much space I have on this partition. I'm gonna split the screen here, and list things out. We can see the new.img is already at two point is, I'm gonna delete this file just to make sure, there we go. That was the file that we originally converted. And you can see it's taking a little bit longer this time. And I'm not really sure why, it could be that it's more compressed, there might be different levels of compression, maybe we compressed it more than the original was, so it's taking longer to decompress. There we go, it did it. So I'm going to now list out my files. And you can see the new.img is five point four gigs, just as the original only extracted was, because the partition is staying the same size. Compressing it will change based on how much empty space is in that. But when it's not compressed, the empty space still takes up the same amount of space. So now I can pseudo, oh, I can also file new.img, and we can see it still is an ext4 file system, and I can pseudo mount new.img to that fs folder. I can move into that fs folder, and into the app folder, and I can list things out. And you can see the files that deleted are still deleted. The original file here will still contain them, that's compressed, so you can still retrieve them from there. It's why you don't overwrite the original, unless you're sure you want to, we can always go back to it there. And that's pretty much it. That's working with Android sparse file systems. I don't know much about them other than what I just showed you. Apparently, like I said, this is supposedly firmware from a Samsung device. And I hope that you found the store useful. If you did, be sure to check out my website, filmsbychris.com, that's Chris the K. There should be a link in the description. Okay, this is an introduction to filmsbychris.com. I'm Chris, that's Chris the K. That's me right there. My daughter, Amber, 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. Now, 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 ask that you take the time to go to my Patreon page and look at different levels of rewards you can receive for different levels of backing. There should be a link in the description of this video if you're watching it on YouTube. Otherwise, you can visit patreon.com forward slash metalx1000. And I thank you for your time and your support. Have a great day.