EX200 Red Hat Certified System Administrator RHCSA – Partitioning Part 2

  • By
  • January 18, 2023
0 Comment

3. Formatting a partition using xfs file system

Welcome back, everybody. Today I am going to show you how you can actually create a how you can format a partition. So we are going to go ahead and type in mkfs. Now, mkfs is an extremely simple and easy and yet a powerful tool for formatting partitions. So if I just press tab twice here, I’m going to get a list of possible options. And amongst those possible options is the Btrfs, which was to be the future. I’m not sure where they stand with that at the moment. The default one is still XFS, as we saw during the installation procedure. And I am using Red Hat Seven here. So I have updated it to the latest version, of course, but it’s still XFS. It’s not Btrfs, even though there was a lot of talk about this Btrfs. Why? Well, Btrfs actually possessed the ability to undelete things. So once you deleted something in Linux, you could actually undelete it, which was fascinating.

Yeah, when you delete something in Linux, it’s gone. I do believe that I stated this something of a kind of previous tutorials. When you use the RM command or something like that, the file that you have deleted, it’s gone quite literally and rather difficult to get back. Anyway, that’s one of the reasons why they had Btrfs, but it’s still not in its prime. So we’re going to have to wait a little bit further for that, even though it is available here. Anyway, let’s go ahead and use the default one, which is XFS XFS. And we would like to get a help menu for this. I’m going to go ahead and set the label for the drive. I do not believe that I shall set anything else. I do not think that there really is a need at this point of time. This is a very nice option here. It says force override. If you’re getting any warnings. If you’re being stopped by the system, you are being stopped for a reason.

However, if you really don’t care about that reason or reasoning in general, just go ahead and force the procedure in whatever manner you see fit. I do not think that there will be a need for me to force the procedure. I do believe that I will be able to simply format the partition with a proper label without any difficulties of whatsoever. So what shall we place as a label? Well, what do I see on my table? I see coffee, but I do believe I have used that already for labeling another partition. Well, let’s go with spoon. So spoon. Dev SDB two. I should organize some sort of a competition. I had an idea to organize a competition for names, like whoever would provide ten best naming suggestions would get coupons for pretty much any other course or something of a kind. That was just an idea that I had in mind so people could submit their own list of names that I could use in the tutorials and if one list was truly innovative and kind of funny and yet not that vulgar because I do have to limit myself to what I’m saying in these tutorials. I would actually use it and that person would get a prize. That was just an idea that ran through my head. Let me know what you think about it and I’ll see if I can implement it. Anyway, type in Mkfsxfs shell for the label and then devsdb two. Press Enter. There you go, it’s up and running. The partition has been formatted and now it is an XFS File system.

There is another tool that I can share with you here. You can paste it, so it’s lsblk. It has just use its help, but you’re going to see a lot of things there. But basically like this, you can specify the fields that you would like to see. So name, label, size, output I can also say instead of A for all and here you can see pretty much all the information in regard to particular disks. But let me just go ahead and clear that and use O. So what would be like name? I would like a label and I would like size, of course. Well, it’s not a zero genius, it’s O. There we go. And we have a name, we have a label and we have a size. So I have named SDB One while I was not recording coffee and I have named SDB Two while I was recording spoon, which is 10GB and coffee is 5GB.

Somehow this doesn’t make any sense. Coffee should be bigger than a spoon, but it’s not the way it is in tutorial anyway. So this is just one of those tools that can help you get around things you see. You get a really nice listing and you can format it any way you like, which is amazing. You can also say all for pretty much all the information that can be listed, that can fit the screen. It will be listed out for you and you’ll be able to see it there. Quite simple, no big, no big deal, very easy commands to use. It’s not a hassle to use them or anything of a kind. You can run Fdisc shell one more time if you want to have a look here in regard to the SDB. But you won’t really see much here.

You will only see the partitions of the disk, you won’t see their mount points and we will talk a little bit about I haven’t passed in any of the arguments I’ve just used. I actually have passed just one argument and I want to list the partitions and discs. That’s pretty much it. But later on I will say a few things about the mount points, about mount the partitions manually, that is, and how you can actually mount some other devices as well, such as USB or something of a kind. Pretty much the same way you would mount anything. There is a universal way of mounting things in Linux. Anyway, I would like to bid you all farewell until we see each other in the Fallout Tutorial. And I would like to wish you a ton of luck with this.

4. Mounting the partitions

Welcome all to this tutorial. Today we are going to attempt to mount a partition that we have created and we will play around with it a little bit. So, first of all, we will deal with temporary mounting, and then we will set up permanent mounting options in fstap etsy fstap. First off, imagine that you have a USB or something of a kind, and you just plug it into your computer. So suppose that you don’t have the GUI interface up and running and you want to mount it through the terminal. Or what is a more common case, you have created a new disk partition and you need to set up the auto mounting options for it. Well, for both of those things, we will well, for the temporary mounting, we will use the Mount option. So. Mount Plain English language. If you want to mount a partition, just type in mount. That’s literally, it all that you need to type in there. So go ahead and type in dev SDB. And I would like to mount the second partition of the SDB disk, and I would like to mount it to MNT now, since I have mounted it there. Let’s go to MNT LS. There is literally nothing there.

So let’s go ahead and type in mkdeer. Hey, Ellis. Okay, we have Hay in there. Reverse back and type in unmount, not unmount. Sorry, u mount. The common error that people make is type in unmount, but it’s just U mount. I guess somebody thought it would be simpler like that. Dev SDB two. Aside from writing SDB Two, you can also type in the mount location as well. But I prefer to type in the disk, the disk name. So STB two, not a Disney. Sorry, the name for the partition you mount. Okay, target is temporarily busy. Why is it busy? Well, Root is currently using that folder. How do we know? Well, PWD, I am in that folder. So let’s go. Get out of there. And now let’s try to unmount it. You see, I have successfully unmounted it, but what has happened to this file that I have created here? This directory that I have created? What happened to that? So let’s go back to MNT and do LS you see, it is no longer there. It is quite literally gone. Why is it gone? It’s not actually deleted or anything of a kind. It’s still in existence. But the partition has been unmounted and it is no longer used by the system. Since it is no longer used by the system, the file is no longer accessible to us until we actually mount the drive again. Mount the partition again.

So let’s go ahead and do that, but this time, let’s go ahead and create a new folder in which to mount it. So this is also a nice feature. You can pretty much create these folders for yourselves, specify their location, or just type in MK deer in MNT and this one will be what should we name the folder? I do not know. Let’s see what do I have on my table now? That would be stupid. Let’s just do udemy. That seems fine. So we have a folder called Udemy. Now if I do ll, you will see that there is a folder Udemy here that has been created there. Let’s go ahead and type in the mount command again. I’m so lazy with the typing. Prefer to use these things in this fashion. Excellent. So it says mount spacedevsdbdu and where shall we mount this? Well, MNT udemy l and if we enter udemy now LS, you will see that the directory that we have created previously does indeed exist there.

So it’s hey, this directory will exist anywhere on any mount point where the partition has actually been mounted. Fairly simple, no big deal. There you just type in the command, you type in mount, you type in the partition here and then you type in the mount point here. As long as you have the permissions as long as the permissions are right, this shouldn’t be a problem. But for example, if I try to let’s dismount it so u mount I’m going to have to exit this first. So u mount udemy you see, I can also type you mount Udemy. I don’t need to type in the partition at all, type in the partition name at all. Rather, instead I can just type in umountudemi and now I will be able to actually go ahead and create an error message for you. So let’s go ahead and try to mount this to a nonexistent folder. Let’s type in test here, or even better, I do not exist. Let’s put it so and there you go. It says mount point I do not exist, does not exist. It is not there. So it won’t be able to mount it until we first create it.

It won’t create it for us. Please keep that in mind. That is a common error encountered by people in general. And as I was saying, if you have a USB drive or something like that, well, just type in Fdiscl and find it here. Can be a little bit disorientating. It’s nothing too difficult. Here it says dev SDB two devsda. You can also see the size. Usually by that size you can figure out which one of these is actually your USB drive. Also, generally people know the partitioning schemes of their disks. So they know that it’s not SDB. They know that it’s not SDA or anything of a kind because that’s something that they’ve created. So as soon as they see something new, they know it’s a USB drive.

But honestly, the easiest way that I have found is simply by looking at the size. And then you will be able to also see that it has some sort of partitioning scheme like, I don’t know, it will say VFAT, NTFS or Windows, something of a kind doesn’t really matter. You will be able to see it there, recognized it literally stabs the eyes. So let’s go ahead and clear the screen. But you see, these things are temporary mounts. This mount will not survive system wide reboot. What we need to do is create permanent mounting points for these. We’ve created mounting points, but we need to tell the system, we need to tell the Colonel, okay, I would really like it if you would mount these partitions at boot time. That would be really nice because I don’t really feel like typing it in every time I log in. There is another way of doing this, which is not the brightest of ways.

You can set up a cron job to automate the the partitions for you to automate tasks at boot time or at specific times. But I do believe that we will deal with automated tasks in process management part for the time being. Let’s go ahead and edit the Etsyfstab. So Vimfstab, press Enter and there you go.

We’ve just opened up this file and in this file we have some useful information here. For example, you see here for the mounting of this particular mounting of this particular partition, where it says Boot UUID has been used. Now this is unique. This will not change and this will stay the same. Device names might change depending on the system configuration or depending if things change in general on servers or something of a kind.

There are ways, there are situations when this happens, but we don’t need to go into them now. Just know that this does not change and that this might change. So keep that in mind. Also, there is another simpler fashion of actually doing this, more akin to our human understanding. You all remember that we have specified the labels for our disks. And we can actually have a look at the labels because I’m not actually sure what they are, or let’s say that I’m not sure what they are. So let’s just type in blkid and there you go. We have our partitions listed up, listed here. So four of them down below we have some other things as well. We will deal with them at a certain point of time. Do not worry about it. Here it says UUID for SDA One and then it gives us the UUID.

And then it says type XFS. But let’s go ahead and see SDB One, which is more interesting to us, where we have a label. You see, SDA One and Two do not have labels. SDB One does have a label. It says coffee. Or the one that we have created during the previous tutorial, if I’m not mistaken, it says Spoon. I know, strange labels, right? I would advise you to give some sort of meaningful labels to these partitions so that you actually might later on know what they are or what their purpose is. But for the time being, I just named them coffee and Spoon because those are the two things that I literally saw in front of myself on my table. Again, we have the same information that follows it. You have the UID and then you have the type XFS. But we are interested in this part.

So let’s take this label for example. It says spoon. Let’s go back to Etsyf tab and here we will say, okay, we want to insert first bring me to the end, enter and let’s type in label. I could have just as easily typed in dev and so on and so forth. Just type in the partition name. But no, that’s not really the preferred way of doing this. Probably one of the best ones is the UID, but the simplest for us to understand is in all likelihood the label. So let’s use the label. In this example, type in label equals Spoon and the mount directory shall be MNT. Okay, we are using this for testing purposes, but feel free to make your own Udemy. The file system type will be XFS. You can just set the mount options to default. There is literally no need to do anything here. And you can feel free to copy the rest of the stuff here. Shouldn’t do any harm, really. Let’s just go ahead and paste it here. The columns here are not properly aligned. They generally are, but you see, the UUID is messing it up just a little bit. I guess you can format this to look a little bit better or something of a kind, but don’t think it’s going to help you all that much. Anyway, let’s go ahead and exit this. But before we do, remember, please save it all. So go ahead and right quit. Now that we have fstab up and running, you can clear the screen and there is an option mount a hyphena. But you’re telling the system in such a way to mount everything that is mountable. Let’s do that. No problems. Okay, let’s go ahead and check whether the Udemy is actually whether the SDB two is mounted properly.

So let’s go ahead and enter CD enter MNT Udemy LS. Hey, guess what it is? It’s right there. This is one way of checking it. Of course, you definitely know that it is indeed there. You can also type in mount, grab Devsto, press Enter and there you go. You can see that it is mounted on MNT Udemy. Says, well, here, let me just select it for you. You’ll be able to see it better. Devsdb two on MNT Udemy. Let’s go ahead and unmount it and just try to do it one more time to see if it’s actually working properly, because I’m not sure whether I have left it mounted or not. Let’s go ahead and use unmount. Hey, this was a brilliant error on my part. So demi unmount and then mount hyphen A again, we get no errors, but if we just do unmounted demi one more time and then do Mount A. I’m making these fascinating errors. So I want to unmount your Demi and then I want to show you something. Let’s go ahead and type in where do I have that command? Yeah, there we go.

So mount graph dev SCP two. It is not mounted because it is it can’t find the system cannot find it. There is nothing to graph out of the mount output and we can’t actually see it there, so it is definitely not mounted. Now, if we go and enter the Udemy folder now, you can see that this is indeed empty and there is nothing there. If we just say mount Hyphen A and press Enter, you will see soon enough that it is indeed mounted. One more time. So it says hey, and if we use mount grab devstb two, there you have it. You can see that it is actually mounted and it is there. So you know for sure that what you’ve placed in Etsyfstap, okay, it might not be the best of syntaxes or something of a kind, but hey, you can know that it works and that it doesn’t actually give you any errors or anything of a kind.

For example, if the folder didn’t exist, I’ve showed you that the error that your base will be prompted with an error, it will say, hey, I don’t really have that folder at all, so I can’t really mount it. The mount point does not exist. Another interesting feature is that at a certain point of time we might want to change certain attributes of our partitions. So let’s go ahead and use XFS. Since we did format it as XFS. If I press tab twice, you can see that there are quite a bit of options here. Let’s go ahead and say underline Admin Help. That’s not really what I wanted. Let’s do this. Let’s do see the help bar. The help is not very useful here. I suppose it can be useful in a way, but we can do I know what I want to do, but I want to show you where you can actually get useful information from it.

So xfsadmin. Excellent. So we have the band pages, and here you can read up on XFS admin and how you can actually use it in order to change the attributes of your partition after you have created them, which is not a bad idea. Look, you can even set the UUID of the file system. You can change the label. Is there anything else that I am thinking at this point of time that’s interesting to us? No, not really. Not at this point of time anyway. But let’s just go ahead and exit this. What I really want to show you is how you can actually change these attributes after you have created a partition. So you type in XFS underline Admin and I think that the labels are quite ridiculous. So let’s change it to something else. What shall I change it to? Well, no, not Silver Surfer. That would be a stupid name for a partition label. For a partition? Let’s call our partition earth. I know it’s an original name. Anyway, this will be for Dev SVB Two and contains a mounted file system could not process this command. What do you think this is? Well, we have to unmount the system first.

As you can see, it’s mounted. We can see this folder here. We need to get out of this folder and stop using it. And type in umount and go ahead and type in Udemy. Clear the screen and let’s go ahead and attempt XFS Admin one more time. Hey, guess what the new label is? Earth blkid. This is too much output. Let’s go ahead and clear the screen. So blkid, grab Dev SDB Two and you can see that the label is changed. Indeed. If I type in Mount Hyphen A, it says, Cannot find label spoon. Error. If I type in Vim at CF Stab and change the label from spoon to Earth. If I just go ahead and write and quit this now, we can go ahead and try the Hyphena option. And there you go. It works faithfully, without any errors and without any problems of whatsoever.

Mount Hyphena is simply to test out whether everything and whether you can actually mount everything that specified in the step file. One of the ways in which you can verify your configuration there, if there are no errors, it’s working out just fine. And you can use BL, you can use Mount and then Grep and then the device name. So Dev SDB Two to figure out where it is exactly mounted and where the mount point is and whether it is mounted or not at all. Anyway, I would like to be you all. Farewell now and I’ll see you in the next tutorial.

Comments
* The most recent comment are at the top

Interesting posts

Impact of AI and Machine Learning on IT Certifications: How AI is influencing IT Certification Courses and Exams

The tech world is like a never-ending game of upgrades, and IT certifications are no exception. With Artificial Intelligence (AI) and Machine Learning (ML) taking over everything these days, it’s no surprise they are shaking things up in the world of IT training. As these technologies keep evolving, they are seriously influencing IT certifications, changing… Read More »

Blockchain Technology Certifications: Exploring Certifications For Blockchain Technology And Their Relevance In Various Industries Beyond Just Cryptocurrency

Greetings! So, you’re curious about blockchain technology and wondering if diving into certifications is worth your while? Well, you’ve come to the right place! Blockchain is not just the backbone of cryptocurrency; it’s a revolutionary technology that’s making waves across various industries, from finance to healthcare and beyond. Let’s unpack the world of blockchain certifications… Read More »

Everything ENNA: Cisco’s New Network Assurance Specialist Certification

The landscape of networking is constantly evolving, driven by rapid technological advancements and growing business demands. For IT professionals, staying ahead in this dynamic environment requires an ongoing commitment to developing and refining their skills. Recognizing the critical need for specialized expertise in network assurance, Cisco has introduced the Cisco Enterprise Network Assurance (ENNA) v1.0… Read More »

Best Networking Certifications to Earn in 2024

The internet is a wondrous invention that connects us to information and entertainment at lightning speed, except when it doesn’t. Honestly, grappling with network slowdowns and untangling those troubleshooting puzzles can drive just about anyone to the brink of frustration. But what if you could become the master of your own digital destiny? Enter the… Read More »

Navigating Vendor-Neutral vs Vendor-Specific Certifications: In-depth Analysis Of The Pros And Cons, With Guidance On Choosing The Right Type For Your Career Goals

Hey, tech folks! Today, we’re slicing through the fog around a classic dilemma in the IT certification world: vendor-neutral vs vendor-specific certifications. Whether you’re a fresh-faced newbie or a seasoned geek, picking the right cert can feel like trying to choose your favorite ice cream flavor at a new parlor – exciting but kinda overwhelming.… Read More »

Achieving Your ISO Certification Made Simple

So, you’ve decided to step up your game and snag that ISO certification, huh? Good on you! Whether it’s to polish your company’s reputation, meet supplier requirements, or enhance operational efficiency, getting ISO certified is like telling the world, “Hey, we really know what we’re doing!” But, like with any worthwhile endeavor, the road to… Read More »

img