CompTIA Linux+ XK0-005 – Unit 08 – System Maintenance Part 2

  • By
  • August 7, 2023
0 Comment

13. Tape Archives Part

Well, now that we’ve talked about compression, the next thing is backup. And that’s kind of what we said we’re going to start with, is talking about doing backups. Now, understand that the compression used to be something we did when we stored files on our servers because we didn’t have a lot of storage room. And then we would back things up with tape, or basically take all of these files, all of these zip files, and put them into what we call a tape archive. We also see many times when people create a tape archive and then compress the archive. So the order is kind of up to what you’re trying to accomplish. Anyway, when we talk about tape archives, we often use the term tar, which was short for tape archive.

In fact, it takes multiple files and packages it into a single file. And often people call that a tar ball, meaning it’s just a balled up package of files. Now, when you do a tape archive, originally the idea was just that you are backing things up to tape. You’re archiving them, and on that tape it is a single backup package. So we can do that without backing it up to tape, which is a way, again, of being able to transfer multiple files by having them packaged as a single file. And then again, if that one single archive is big, you can compress it. And often people start seeing these tar GZ files being sent to them because it’s telling you, look, this is a compressed tarball.

So not only do you have to decompress it, but you have to untar it so you can get all the files out, but it makes for the transfer of information. Very simple. I attach one file, I transfer one file. It’s a smaller file because of compression, and it just makes sense. Now, you can take these packages, these files, you can save them to disk. Like I said, it doesn’t have to go to tape. It can be saved to tape. The original idea behind doing these or any other device that can store a file, USB drive, optical drives, or whatever else you want to use. The command simply is tar and the destination and the source. So tell me what it is I’m Torring up and where it’s going to go.

14. Tape Archives Part

The options for Tarri are going to be many. Some of the ones that you’ll see. The most common are like C for creating the Tar, the F for the input or output file, the T for the list of files in the archive, the V if you want verbose information about the action of creating the archive or taking it out. X to extract whatever is in the Tar and Z to compress or uncompress with GNU zip the actual tape archive. As I said, it’s not uncommon to archive and then compress so that I have as small file as possible and only one file to be able to send to you. You can decompress it, open it up, and then there you have this nice new present. You open the package and you got all these files.

15. Demo – Creating Archiving with tar

All right, so we’re back to our tape archive copied location, the backup tests. I’ve got a lot of log files here that we’ve copied from the VAR log and change the permission, so we should all be good to work with this. And then we’re going to type in the command, target a taped archive with the CVF, and we’re going to call it the log backup so I can’t spell back up. Let’s try that again. Backup tarphile. And we’re going to take all these star logs and put it into that one file. Boom. So there’s all the ones that were put in there. Let’s do an LS LF. And there you can see my new backup. Now I’m going to bed. If I added all of these files up, with the exception of this log backup, that that number to come up to the same value, because I didn’t say anything about the compression, really. So that should have been an uncompressed file that I created by putting it in there.

Okay, so now we’re going to create a compressed tape archive file, and we’re going to give it a little bit different name. We’re going to add that same logbackup tar, but we’re going to add in the GZ at the extension. So I’m going to come over here, and I’m going to say, I want to zip those things. And at the end of the tar, we’re going to call it GZ. Hit the command again. You can see the ones that we grabbed a hold of are the same files, LSL capital F. And you can certainly see that I not only have a tarball, but because of compression, it’s taking a whole lot less space. Okay, so the first one we want to look at extracting. And if I do extract these files, I would use the same tar command, but I use the X for the extraction and again, verbose and all of the files in the logbackup tar file.

Notice I’m not doing this with the compressed file because in this particular case, I haven’t actually said anything about extracting it with the compression. I don’t have the Z option. And there are all those files that were in the tar file, and so those come back out. LS LF. We take a look, and it’s still the same files that we had before, but it’s just the command that you go through to actually do all of that. And in fact, let’s remove just to prove that we actually do it, let’s remove and let’s force the removal of all the star log files. There we go. And now let’s untar that file. In fact, let’s look at the LS. So we have just those two backups. Now let’s untar that file. And now LS LF again, and then they’re back. Okay, so I love my up arrow. You know, I’m saving myself a lot of time.

I’m going to remove all those files up arrow to verify that I only have those two. And I’m going to do the next Tar command I’m going to extract. For this time, I want to decompress verbose all of the files in the log backup tar GZ, and hit the tab key to make that even faster. And I’m really trying to show off all the fun you can have. So now I’ll LS dash LF, and those files are back again. I almost feel like I’m doing a magic trick, you know? Now you see them, now they’re gone. Now you see them. Now the nice thing about that, of course, as a taped archive is I have just a single file to send to you. Whereas in another example, we compressed everything, but we ended up with 810 the same number of compressed files. This case, they’re all nicely packaged into one Tarball. So those are some of the options you have. As far as another way of doing some backups.

16. cpio and find

Now let’s talk about a couple of other utilities that you might want to use. One of them is called the copy in out or the CPIO. What it does basically is it collects and copies files to your standard output. Now the standard output generally might be a printer. It used to be anyway, mandatorily, a printer could also be your monitor or whatever you’re using. Is that standard output? It’s just a way of collecting and copying files so that you can spit them out somewhere. You might even standard out to a backup source. Another tool that we often see is this tool called Find. Now the reason we might use a Find is because we’re trying to find or locate a file that we want to back up with the CPIO. So we use Find to be able to provide information about what is this file is about, what’s in it. It’s a way of saying, okay, find all of the programs that this user owns.

Find all the ones with certain permissions or by this name. Even if you don’t know the full name, maybe you even want to look at it with its last access time or create a time. It’s just trying to find files. That’s all it is. It’s a searching utility. The results of the search could then be fed to the CPIO program. There’s also another type of files like Dump and Restore that allow you to be able to do just what it sounds like. Dump a bunch of data, restore the data. These are just other utilities that you have to be able to help you creating or in creating these backups, these copies, looking for the files you want to find. The more you work with these utilities, the more you’ll see that they have lots of other uses. Like Find, for example, is not used just for backups. We can use Find for a number of different searchrelated needs.

17. Demo – Backing Up with cpio

Okay, we’re going to do a little bit of a backup with the CPIO. So hard not to say C threePO. I know for those of you who aren’t as old as me, that goes back to Star Wars in the 70s. Okay, we’re going to do a find command here real quick to find the home of me. Basically I’m, I’m the user we’re going to search, but it’s kind of straightforward. So I’m going to, to look for in the home directory, in the home directory, the user folder for Trainer. And when I did, boy, just zipped all that stuff right on your screen. So I’m going to pipe it to the More command and it shows me all these files and all these folders and all this stuff, even the hidden stuff that is there for me to back up. So I hit type in Q and we’re going to type all that stuff. We’re going to pipe it instead into those files.

We’re going to pipe that into the little program called CPIO. And when we do that, we’re going to have to create a O output file and redirect that output file to this new location Vartemp. We’re going to call it the backup Oops, the backup CPIO file. So to make sure you understand what we’re doing, we’re going to take the files that we find here. Notice I’m not listing them, I’m finding the files different than listing their name. I’m finding those files, I’m piping it the output to the CPIO that’s going to create an output file, redirecting it to this file in that location and hit enter. Now the more you work with Linux, the more what I just did is going to make sense. It’s a matter of just the flexibility of piping and redirection and all that really kind of cool stuff. Okay, so it took a little bit of time to get all of those in there.

That’s LS now the VAR temp folder, the backup CPIO, and there’s that one file and it’s a pretty good size. In fact, if we did an LS of the VAR temp here, we can see that that’s the only file that we have in that location. Okay, so we’ve done the backup. Now we didn’t do those, we didn’t compress the backup. So we’re going to try kind of that same command. I’m going to edit that command though because I just don’t want to keep typing it. So there’s my up arrow. That brings me up to that previous command and I’m going to use the control b to go back. And what I’m going to do is I am going to use this program CPIO, which by the way, creates a binary file, which means that I probably am not going to get a lot of compression out of it, but I’m going to pipe that to the Gzip C to compress that file and again, using the redirect, send it to a new file.

So look at this control e so I can put in GZ. Okay, so let’s make sure that this is making sense. Again, I’m taking the files with a find command from the trainer folder, piping them into the backup, which is going to pipe that into the ganuz zip. And that finally will result in an output being redirected to a new file that ends in the GZ. So it might actually take a little longer because not only are backing them all up like last time, but I’m also compressing stuff. So let’s find out what happens as we wait. We wait and we wait, and then we’ll take a look at both of those files, and then we’ll also remove them. We’re going to clean up the garbage that we make so that we’re not leaving some backups around that we’re just practicing with.

Okay? So when they’re done, what I’m going to do is I’m going to list both files. I’m going to use a little bit of a wild card to list both the files. There. All right. LSVAR temp. And there they are. They’re both listed. Notice again, not a lot of compression compared to some of the other examples we saw. But that’s because the backup CPIO is a binary file, not a text file. Text files and picture files, for the most part, can be compressed pretty good. This one is a binary. Doesn’t get a lot, but you still have a little bit of savings on space. Okay? And like I promised, we’re going to forcibly remove RM f the VAR temp backup asterisks so get rid of both of those files. And now we’ve cleaned up our mess.

18. Backup with dd Part

All right. Now, another utility that we can use for backup is this thing called DD. Now, I’ve heard some people call it data duplication. Some will call it disk duplication. I’m just going to call it DD. And we use it for not just backing up information. A lot of us use this as a great utility for doing forensic analysis on a hard drive. Now, here’s what I mean. It doesn’t do the analysis. It makes a sectorby. Sector copy of a drive, not just up to the point where the file is located. And this takes you back to a little bit of the understanding of how the hard drive works. A sector is storing a file.

19. Backup with dd Part

Now, if the sector is bigger than the remainder of the file, then the file, we would say, would not fill up the entire sector. Many of your copy programs would just copy the file, leaving all of that, what we would call unused portion of the sector uncopied. Now, having said that, when we do DD, it’ll take the entire sector and copy it, if that’s what you want. Forensics that’s invaluable because you can find fragments of old files that might still be in those other sectors. Now, let me get back on track with what we’re using it here for, which is just backing up your file system. I just wanted to kind of tell you what else we use it for besides just backing up it’ll.

Back up your file system, obviously, your disks, your master boot record. The command line structure is fairly straightforward DD and then you put in if equals the input file of is the output file and then you’re done. As an example, if you wanted to back up the master boot record, the MBR, your input file would be slashdev for device HDA, whatever number it is for that hard drive device. The output file would be whatever destination path you’re going to do, whatever you’re going to call it, MBR, or whatever you want to call that file.

Then you can put in information about the size of each of the sectors and some other options if you want to. But then when you’re done, you’ve got the backup ready to go, you hit the enter and it starts doing the job likewise. The restore is just kind of the opposite. The input file is what was the output file, and the output file was what was the input file? Right. You just switching them around to restore this back together. So DD is a very straightforward program. I would encourage you to practice with it with a couple of the files, a couple of folders, just to see how simple and straightforward it is.

Comments
* The most recent comment are at the top

Interesting posts

Preparing for Juniper Networks JNCIA-Junos Exam: Key Topics and Mock Exam Resources

So, you’ve decided to take the plunge and go for the Juniper Networks JNCIA-Junos certification, huh? Great choice! This certification serves as a robust foundation for anyone aiming to build a career in networking. However, preparing for the exam can be a daunting task. The good news is that this guide covers the key topics… Read More »

Mastering Microsoft Azure Fundamentals AZ-900: Essential Study Materials

Ever wondered how businesses run these days without giant server rooms? That’s the magic of cloud computing, and Microsoft Azure is a leading cloud platform. Thinking about a career in this exciting field? If so, mastering the Microsoft Certified: Azure Fundamentals certification through passing the AZ-900 exam is the perfect starting point for you. This… Read More »

The Impact of Remote Work on IT Certification Exam Processes

With remote work becoming the new norm, it’s not just our daily routines that have changed but also how we tackle IT certification exams. Gone are the days of trekking to testing centers; now, your living room can double as an exam room. This shift has brought about some fascinating changes and challenges. Let’s dive… Read More »

IT Risk Management: CRISC Certification Exam Essentials

Do you ever feel like the IT world is moving at warp speed? New tech seems to pop up every day, leaving you wondering how to keep up and truly stand out in your field. Companies are increasingly concerned about online threats, data leaks, and meeting legal requirements. That’s where the CRISC (Certified in Risk… Read More »

The Ultimate Guide to Mastering Marketing Automation for Email Wizards

Hey there, email aficionados! Welcome to your new favorite read – the one that’s going to turbocharge your email marketing game. You’re about to dive into the captivating world of marketing automation, a place where efficiency meets effectiveness, letting you boost your campaigns without breaking a sweat. Get ready to discover how automation can not… Read More »

Master YouTube Marketing with These 10 Powerful Steps

Welcome to the dynamic world of YouTube marketing! Whether you’re a seasoned pro or just getting started, harnessing the power of YouTube can significantly boost your brand’s visibility and engagement. With over 2 billion monthly active users, YouTube offers a vast audience for your content. But how do you stand out in such a crowded… Read More »

sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |