 Today we're going to be looking at doing a net install from a current running system using the Bootstrap. If you enjoy my tutorials and would like to see more, please think about contributing to my Patreon account at patreon.com forward slash metal x 1000. Okay, so we're going to be creating a file system for a Debian install using the Bootstrap. And I'll explain more about what we're doing in a little bit, but it's going to take a little while for some stuff to be pulled down, so let's just get going. How much everything I do today is going to require root or pseudo access, so I'm just going to log in as root. But if you prefer pseudo for each command, you can do that as well. I already have a partition set up on my hard drive for this. I am going to mount my SDA to partition to a folder on my computer. And if I go in there, you can see there's nothing in there. And if I check the mounts, you can see that I've already formatted it as an EXT4, you're going to want it to be some sort of file system that Linux can install to one of the EXTs, either two, three, or four, there's some other options, but those are the most common. Obviously using something like a FAT32 is not going to work because you're not going to be able to do file permissions and stuff. Next you're going to want to install the Bootstrap. Now this doesn't have to be done in Debian, it can be done in pretty much any Debian based distro. It can be done in Ubuntu or Grillum, or I say I'm sorry, I pronounced it Grillum, G-R-M-L Grillum, I don't know how you pronounce that. I'm actually going to get more into that in a future tutorial, but you would want to do aptitude install the Bootstrap, but I already have it installed. So I'm not going to bother installing it again. But I am currently in the directory that I want to install it to. Now there's lots of options on what you can put in the Bootstrap command, but we're going to do the very basics today. I'm going to say the Bootstrap, boot, if I could type, bootstrap, I'm going to tell that I want to do a SID install, but you can do Lenny, or Weezy, or whatever distribution you want, or version of Debian you want, and I'm going to say the current directory, so just a dot or a dot slash, I'm going to hit enter, and right away it's going to start retrieving stuff from here. So now what are we doing? What is Debootstrap? You've probably been watching this video for two minutes now and you're running. What is Debootstrap? What Debootstrap does, it's something created by Debian that allows you to do net installs from current running Debian systems. What does that mean? Okay, so now you go to the Debian website, you can download different installer CDs. I normally use the netboot CD, which is like, I don't know, 10, 11 megabytes. All it has is, you know, it boots, connects to your net, and downloads all the files you need for Debian install. This is basically doing that, but from within a running Debian system. Again, you can do it from Ubuntu or Mint, and I'm doing a Debian install, and by default, I didn't tell it what server to use, so it's using the default Debian servers, but there are servers out there for Ubuntu, so you can install Ubuntu this way. If you have your own server set up, you can do, I install from your own server, and you can also do different architectures, which we're going to get into in future tutorials. Just now, most people would say at this point, why would you want to do this? There's lots of reasons you want to do this. Right now, I'm currently installing to a partition that I have set up. So at the end of this, I'll be able to do a dual boot, or I can just boot into the other operating system that we're creating right now and wipe out the one I'm currently in, so I can do an install from a running system. You can do it from a live CD as well. Just a net install, so everything should be up to date. Last time, you'll get like an Ubuntu CD or a Linux Mint CD, you install it, and then you have to do all these updates. Well, we're just pulling down the newest version of everything we're pulling down while we're doing the install, but we don't have to only do installs. What we could also do is we could create a folder that we can churroot into if for some reason we want a churroot environment to have somewhat of a sandbox for some applications, or something I commonly use it for is on my system right now, which is a 64-bit system, I can pull down an arm install, and I can create an arm image. So instead of putting it in a folder, I can put it right into an image or in a folder and then into an image. I've gone over that sort of stuff in previous tutorials, and I can create a full Debian file system in an image that I can put on my Android phone and churroot into Android, which is what I do do on Android quite often. That way I have all of the packages in the Android repositories to choose from and run on my phone. So you can do different architectures. Once again, I'm on a 64-bit system. I could create an image for a 32-bit system. Maybe I want to make a live CD, and I want to make a 32-bit live CD, or for some other architecture other than what I'm running on, a PowerPC. You could do a PowerPC. If you have a PowerPC, I can do an image, make a CD, and boot it over there on an old Mac or something like that. So there's lots of reasons that you might want to do a DebootStrap. Another option, I know, I have a friend who would have a server upwards, and this sounds very dangerous because if you screw it up and you're not there, you can't fix it. But you could network into a Debian system you have up and running through SSH. And he would unmount the swap partition that he had running, format it, do a minimal install to that, reboot the system onto that, wipe out the original system, clone everything over, and then reboot into the new system. Or I guess you could also expand out the partition he just created. So you could do a whole new install without even being at the machine. Now that's kind of dangerous once again. Not dangerous like you're going to break your system, but you would break the operating system. I mean, you'd have to actually go there and physically boot. But if for some reason you couldn't, you could do this. There's lots of reasons to do a DebootStrap install. Plus it's just easy. And like I said, up to date, another real good reason is, let's say I have something like Debian already installed on my system up and running, but I want a fresh, clean install. Oh good, it's done. I've talked longer than it took to download a whole file system. And what you could do, lots of times you'll boot into something like Debian or even Ubuntu, and maybe your wireless drivers aren't available. Now you got to go get a physical connection, download your wireless drivers, and then it was lots of times maybe reboot or something. With this, I already have the drivers installed. So I have Debian already on my laptop. I create a new partition, or I already have one. I do the install there. I can now churroot into it, install the drivers I need, reboot into a new system, and wipe out the old one. Never had to get a physical connection. It's just lots of reasons to use a DebootStrap. So what we just did, we pulled out into a minimal Debian system. In fact, let's see. I'll do a du-h. And yeah, so 290 megabytes is what we've pulled down. And it's a fairly minimal Debian system. It's not compressed at all. If you were to compress this for a live CD, depending on the type of compression, you'd probably get down to a third that size. So a little over 100 megabytes, if you were to try to turn this into a live CD, I'm guessing here, just from past experience. So at this point, we've pulled down the minimal file system. Let's churroot into it, because that's once again one of the things you want to be able to do. So I'm going to churroot. Once again, you have to be root or sudo to do this. I'm in the current folder, so I'm just going to say dot churroot into this folder. And then I'm going to say bin bash to start my bash command prompt. So right now, you notice my coloring went away here, because I have no settings within this file system. I'm actually running on a whole new, another operating system within this terminal window. I've gone over churrooting in the past. It's very useful for many different things. And that's what I'm doing right now into this new Debian 290 megabyte file system. Things you might want to check at this point. Once again, also when you're churrooting, to get the full system effect, there's certain folders you'd want to mount and devices you want to mount. We're not going to do any of that right now. What I am going to do, though, is I'm going to cat out ETC, APT, and my source list. By default, in this case, we pulled down some, a source file for aptitude and apt-get that has the Debian server in there, force it, and it's just the main repositories. So you may want to go in there, add in the repositories. Maybe you need those non-free drivers to add in the non-free repositories and do an update for that. Or maybe there's other servers you want to use. So there we go. Oh, one other reason you might want to do a debutstrap install is maybe you have a whole lot of systems that you manage and you want to do an install on. Now, you could make a live CD and go around and make changes, but then if you make changes later on and you need to do installs, you now have to update that live CD. You could have a live CD that goes in and grabs the churroot from your own personal server with all your settings. And any changes you make, you can churroot it into the new systems without having to create a new CD. I'm just throwing out because people will ask, why would you want to do this? Lots of reasons. So now that I have this file system installed, I want to be able to boot into it. Now, I won't be able to show you the boot process because I can't record while booting because I'm not using hardware to record. I'm using my software to record. But what we need to do is actually install a kernel because there's no kernel installed yet on this file system. So I'm going to aptitude search and I'll say Linux image. So I'll install this image for my system. So I'll say aptitude install. There's no tab completion yet because I haven't set any of that up in this brand new system. And with that, it's going to be installing busybox and a few other things, minimal stuff that you need. And once that's done downloading, there's one other thing that we want to install. I could put into that command as well. Also, I've never done it, but I'm pretty sure that you can tell the bootstrap packages you want to install. So I could have told it to install this kernel image while doing the bootstrap. So I wouldn't even have to churn into it to do that. So now I'm going to aptitude search kernel. And I think that we probably, no, we're good. OK, so now what I'm going to do is I'm going to exit out of here. So again, now if I was to reboot right now, I wouldn't see this operating system on here. Now, if I was planning on wiping out the system I'm in now and booting into the new system regularly, I would want to install grub to that new system. I'm not going to do that just yet. I already have grub installed to my current system. I just want to add that partition to the boot options. So what I'm going to do, again, as root or sudo, I'm going to say update grub2, because that's what I have installed. Give it a second here. And you'll see right there at the end it found the new file system. So now when I reboot, I should see that new system in my boot menu. And again, at this point, even before we churn into it, if there's any drivers I need to install, I can do that in the churn route. I could install any packages I want. And again, as an image for a live CD, whatever I need to do. So this is a first look at the bootstrap. There's a lot of other options for it. But this is just a basic look at it. Again, I did it to a partition, but you can do it to any folder or an image. These are things we're going to do in the future. And it's a very convenient way without having to burn any CDs or make a flash drive that's bootable. From a running system, I can create a whole new system that I can boot into or do lots of stuff with. So yeah, that's our first look at it. I feel like there was something else I wanted to say. Can't think of it. I want to thank you for watching this. Oh, I was just going to review, I think. I was going to say, remember it's the bootstrap. Again, if you're, I don't know why I keep typing that wrong. The bootstrap should be in your repositories for pretty much any Linux, Debian-based distro, Ubuntu, Mint, whatever. And again, I didn't give it any other parameters other than I want SID or I can say Weezy or Lenny or whatever I want and whatever folder I want to install it to. And that's it for the basics. Again, you can tell it what server you want to go to if you want to do an Ubuntu install like this, you can do that. And again, other architectures, which we'll get into in a future tutorial. Anyway, a lot of talking in this video, the bootstrap is a great thing if you're really going to get into doing this sort of thing, you know, making file systems and images, which is what we've been going on over in this series. I was doing these weekly videos on this topic. They're going to be a little more spread out now, but continue watching. There should be an annotation to the full playlist. If a video is marked private, it's just because it hasn't gone public yet. It will in the near future. And I want to thank you for watching. Please, it's filmsbychrist.com. That's Chris with a K. There should be a link in the description. And hopefully, if this is something interesting to you, you found this useful. Otherwise, you probably found it kind of boring. But I want to thank you again for watching and I hope that you have a great day. There is something that I just realized, cause I just finished recording this tutorial, that I forgot to say. What we did was great for doing a cheer root. But if you want to boot into the system we just created, obviously we installed the kernel, added it to our boot loader. What I did not do is while you're in the cheer root, you're going to want to set up a username and password, or at least a password for root. Otherwise, you won't be able to log in once you boot. So cheer root in and create a password for root or create a whole new user and add a password. So sorry, I forgot to say that. Majority of the time I'm using this for cheer rooting, so I don't think about the username and password. But you would have realized once you booted into the new system that you couldn't log in because you don't have a username and password. So again, thank you for watching. I hope that you have a great day.