 This is a stick of RAM. You have one in your device, or at least something similar, whether it's a laptop, desktop, or even your mobile device. You have RAM. Now, obviously, your phone doesn't have a big stick of RAM like this. It's a tiny little chip on there. In fact, laptops nowadays probably don't have something like this. They're usually smaller or even soldered onto the board of laptops nowadays. But RAM is where things are stored before they're processed. So any application you're running or files you have loaded are in RAM. What if I told you you could store files on RAM? Well, put files on RAM. I wouldn't use it too much for storage. So what does that mean? Why would you do that? Well, theoretically, if you have stuff files on RAM, whether they're files or applications, theoretically they should load faster because they're in RAM, and RAM should be faster than your hard drive. Nowadays, solid-state drives and the way they are, they're pretty fast. So I don't know if you'll notice too much of a difference, but especially on older machines. On older machines, having something in RAM will make a big difference. I've noticed when I've taken like, let's say I take a machine that's like 25, 30 years old, right? I can run Linux on them still because Linux is backwards compatible like that. But, and sometimes they'll run really well until you start saving files because writing to those old disks is super slow. Well, you could actually just put everything in RAM. Obviously, the older machines you're limited on RAM, but speed is one reason that you might want to do it. Another time I've seen where there's RAM as drives is on small devices like a router. If you've ever worked with router where you've gotten a shell because most routers run Linux, I have found that your operating system is on a small flash, maybe only 8 megabytes or 16 megabytes, but it still needs more space to run. Linux is very small and the basic tools you need to run it are small so they can fit in that 8 or 16 megabytes. But to actually run and generate files, there's no room on the flash. So what they'll normally do, or at least I've seen done, I don't want to say they normally do it, but what I've seen done is they will mount their temp directory and any place that needs to be written temporarily to RAM. Now, unlike on your desktop where it's writing stuff in your temp directory to your hard drive and then it's wiped out when you reboot, these smaller devices will just mount a RAM directory because they might have 32 gigs, or 32 gigs, they don't have 32 gigs, 32 megabytes of RAM so they have more space to load things. So there's a few uses, also privacy, so you're writing files to your hard drive even if you delete them. We all know that you can, unless you override the files on the drive, they can be recovered. So on RAM, once you turn the power off to it, they're pretty much gone. Theoretically, they're on there for like up to a minute. If you freeze the RAM with a cold boot attack, it might be a couple of minutes, highly unlikely. But if you have files that you don't want someone to be able to recover but you want to manipulate or whatever on your device, you can load them to RAM. So that's what we're going to do today. We're going to create a directory on our device and then say, take part of my RAM and make it storage on that folder. And then anything you put in there, well, again, not only load faster, but when you restart the device, should be completely wiped out and, for the most part, not recoverable. So let's go ahead. It may not be something you do often, but it doesn't hurt to know and it's really, really simple. Literally, one to two commands. One command to create a directory and another command to, say, mount a specific amount of RAM to that directory. Okay, here we go. This is, again, super simple. A link notes in the description. But again, it's two commands. The first one, we're going to create a directory which you can do in your home directory or anywhere on your system. If you are doing your home directory, you don't need sudo. If you're mounting it in a directory like we're going to, you'll need to sudo to at least create the directory. You'll still need sudo to mount the directory. But we'll just make a directory under MNT and we'll call it tempfs because it's a temporary file system. So we've created that directory. And now all we have to do is say sudo mount. And then we're going to say dash o size equals, and in this case, I'll say one gig. So I'm going to say I want it to be one gig in size. Next, I'm going to say dash t for type and I'm going to say tempfs because it's a temporary file system. They're going to say none. I'm not really sure what none is for. It's just in my notes. And then we're going to say where we're going to put it. And again, it's going to be that tempfs under MNT. And that is it. If I was to run mounts now, you can see that a little smaller. So everything's on one line for one moment. You can see here that we have mounted a temp file system. It tells you the size there in kilobytes. If I was to df-h, it will list all my drives. And you can see that it's a temp file or it's mounted at temp file system. And the size is one gig and it's one gig available because I haven't written anything to there. So let's go ahead and go into that directory, tempfs, and I could echo test into a file test. I can date into a date file. And now we have files there. I can df-h and you can see that we've used a little bit of space, but this is in RAM. Anything I put in here. And again, you can copy applications here. And theoretically, those applications will load faster because they're loading from RAM. But that's pretty much it. It's that simple. Now, when I restart this directory, the directory will still exist, but the stuff in it will be completely gone. And they were never written to the hard drive, so they can't be recovered from your hard drive. If I was to move out of this directory, I can sudo, you mount, and I will unmount that directory. Theoretically, they're still in your RAM, I would assume. But RAM is being written to all time. It's going to be all written. And again, once power is cut to it, that stuff is going to disappear. So again, if you're really paranoid and you want to make sure that files aren't recoverable, but you're able to manipulate and use them how you can, you can obviously download files to that directory, use them, and then when you reboot, it's gone. So that's it. Our whole system isn't now... Now, be aware if you're doing this for privacy reasons and you open up something like GIMP and you're manipulating an image, it may be... GIMP might be storing files and copies of those files into other directories. So that's something you need to be aware of. It might be your temp directory somewhere in your home directory. I really don't know. I'm just saying that as a blanket example. But if you're in the shell and you're creating stuff and modifying stuff, you're pretty much sure that everything you're writing is going where you're writing and there aren't backup and temp and recovery and history files. But that's it. Super simple. Again, there's a link in the description to the two commands. But the main command you're looking at is this mount command. Again, you can change this to basically any size. Just make sure it's within the size of your RAM and you still need RAM to work as RAM. So if you have 8GB or 16GB or 32GB, don't make the file, the mounted directory that size. I would assume that would cause problems. I haven't tried it. I don't even know if it will let you do that. But that's it. Thanks for watching. Films by chris.com. That's Chris at the K. There's a link in the description. As always, I hope that you have a great day.