EX200 Red Hat Certified System Administrator RHCSA – Partitioning
1. Partitioning and file systems
Welcome all to this tutorial. Today I will talk about partitions and partitioning in Linux. It’s fairly simple. However, you do need to use the command line interface. But the commands are not complicated at all for partitioning. They are rather short and pretty easy to comprehend. This is not a difficult chapter, but a relevant one in any case. But it’s not very difficult to do. It’s not very challenging. The commands are short and simple, easy to understand, and easy to remember as well. Let’s go ahead and begin with known file systems that are used. So XFS is one of them.
That is the default file system of Red Hat and a lot of distros today a lot of significant distros today the bigger ones anyway, it is very fast and that is its primary advantage is the speed over ex four which is a lot slower than XFS. There are some other differences, but that’s the primary one. The speed. The speed difference you wouldn’t probably notice on a file system, which is maybe 100 gigs total size. But imagine if you had about 100 terabytes, or even a petabyte, which is 1000 terabytes, and if you were searching for a file in that system, and if you were using extra four over XFS, you would definitely notice that it’s a lot slower. It’s been around for a while, extra four, and it’s really old now. It’s been built for systems that didn’t really have a lot of capabilities in terms of storage.
Back then, storage was measured in megabytes, so hard drives were actually in megabytes. So just keep that in mind. Anyway, next up we have VFAT. VFAT is for compatibility primarily this is something that you would use to format your USB drives or portable storage for the sake of compatibility with other operating systems such as Windows.
Now, it’s not a good idea to actually format your partitions as VFAT in your desktop machine or in your server machine because in this moment I instantly saw like 100 people thinking oh, I am going to format all of my partitions with Visat and then I can share all my drives with my Windows machine. True, you could probably do that although then you might as well format them as NTFS. This is a file system used by Windows but this is not something we do in Linux that’s equal to heresy and you would significantly hinder your operating system. So just use XFS, which is the well, it’s not the latest one. There are some other ones that were supposed to come alive this year, but with red hat seven and 7. 1.
But it would seem that XFS has remained persistent and it stays and it has stayed the way it is. Anyway, in order for us to have a look at the partitions, well, we can either type in Fdisl. Fdisc is a fantastic utility it has been around with us for quite a long time now and it has served pretty much all who have used it very well. Here we can see some of the interesting information. You can see dev SDA One. SDA Two. These are the two partitions SDA. That’s the disk up there. So it says dev SDA. And down here it says dev SDA One and two. These are the two partitions of the disk SDA. I don’t believe I have another disk here. No, I do not. This is a bit difficult to see, especially if you are starting up with this. It’s kind of difficult to figure out what is what, where is what. For the time being, I would advise you to focus yourselves on this first line here and then follow up on what is written down below immediately. There we go. So where it says devices and I don’t know, it says boot.
And then it has a marketing for boot. Where it’s booting from? Where is it booting from? You don’t actually need to pay that much attention to these lines here, as they are not that significant for you at this point of time. But like this, you will be able to see the partitions of the disk. You will be able to see the disk, the device itself. Another way of doing this is by typing in Cat Proc partitions. And Proc is basically communication of the colonel with the user.
Well, I couldn’t put it like that, but it’s a fantastic way to see the things that the kernel is doing because in Linux everything is a file. So even the things that the kernel is doing are being written out here so that you can actually see them. So these are the partitions and the disks that are known to the kernel. Didn’t have to list the partitions. I could have done. Let’s do LS. Proc, you have a lot of things here. If I were to open, for example, this file, you probably wouldn’t understand the contents of it. Doesn’t matter. Completely relevant for you now. But let me just show you just a bit of extra. Yes. Come on.
Why aren’t you doing it? Okay. Cat. So this is input output memory. And this is something that the kernel has written out to this file. There it can be seen and usually used for troubleshooting purposes, complex troubleshooting. Pretty much the sort of problems where you literally dig your head into the system and you don’t dig it out for the next week. And then you basically don’t go to sleep. You crash, your brain crashes, and eventually it reboots and everything is fine, hopefully. Anyway, let’s stick back to the subject. So Proc, and we’re going to go ahead and type in partitions.
Press Enter. And here I can see that I have partition SDA One. SDA Two. This is SDA, this is the disk. And SR zero is actually my drive, one of my drive bay, my CDBA. So that’s where I would put a CD into a computer. The physical place where I would put a CD into the computer. Anyway can go ahead and dump the rest. Now at this point of time, I would like you all to go ahead and create an additional disk in Virtual Box for us to partition. This is fairly easy to do. You just go over to machine Settings storage and you won’t be able to do this while the system is up and running. So just keep that in mind.
The first one it says add CD DVD device. The second one it says Add hard disk. Now, it’s supposed to have a VDI extension. You can name it whatever you like, it doesn’t really matter. Whatever you wish, you can name it probably you should name it something that is unique to you or that’s fun and interesting because you’re going to have to look at that label for a while.
And yeah, it should be interesting to an extent. Anyway, I am going to do this in the next tutorial where I continue with the partitioning section. But I would like you to do this before we get into the next tutorial. If you fail, it’s perfectly okay. Just follow through the next tutorial and I will show you exactly how to do it. This is two, 3 seconds, that’s all. But the machine needs to be powered off. Anyway, I would like to bid you all farewell and a download of luck until next tutorial.
2. Partitioning a new disk
Welcome back everybody. So just go ahead and right click on Red Hat. Go into settings again. Storage. Here it says Controller Setup. So go ahead and click on the blue icon where it says Add hard disk. Do not click on the one where it says Add CD DVD Device. Just add a hard disk. And now it’s says Create new disk or choose an existing disk. Since we don’t have an existing one, we are going to go ahead and say create new. Just choose a VDI one. That’s not a big deal. Dynamically allocated is perfectly fine and we are going to I personally am going to allot 20 gigs if I can manage to be precise. Okay, 2055 is fine by me. But you can allot as much space as you want. If you don’t have a lot of space on your hard drive that remaining, it doesn’t really matter. The system is not dependent on this one like it was on the first one that we created when we created this virtual machine. So you can assign as much space as you want. You can actually assign it in Megabytes if you want, whatever. It doesn’t really matter as long as you have it there and as long as it has at least some size which we can split into smaller portions. Now. The name is new. Virtual disk. I will name this disk Udemy and I will go ahead and click on Create. There we go. So it says Udemy VDI had 20 gigs, approximately to 20 gigs and I will say, okay, I’ll leave that place. Oh, by the way, if you would like to delete a hard drive or something of a kind, the options are fairly simple. You just click on it and then you have an option.
Down here it says remove the attachment highlighting in the store tree. Once you do that, you will delete it. If you have an SSD drive, you can also select a solid state drive. So there is an option if you only have like solid state drives within your laptop or your desktop or whatever. You can select it there as well, if you would like. Anyway, I will now go ahead and power on the machine. So the boot process will take a fairly short amount of time, but it still does require us to wait just a little bit. No big deal. Have my bar prompting me here on the left side. Just the way I’ve tuned it. When I hit it with the mouse, it just kind of pops into existence. One way of looking at it anyway. So it is booting. I swear I should have used one of the songs from you know, when you’re calling somebody on the phone or you’re usually calling a service or something of a kind, you have that tune that sings while you wait. I should get me one of those and just play them while the system is booting.
I guess it could be interesting. I wonder what the feedback on that would be. But okay, then we are finally here. I’m just going to go ahead and log in. Oh, by the way, the boot procedure will be faster on a physical machine. Just keep that in mind always. There were four failed logins. Amazing. Okay, come on, sing along. Booting blackness brownness. Somebody might say that I’m color blindly, but I assure you I’m not. Okay, then let’s go into applications. Pop up the terminal. There we go. Let’s become root, shall we? So we don’t have any problems. With permissions. Excellent. There we go. Now, if I type in Cat proc Partitions, I can see that there is another drive here. It says SDB. Let’s have a look with defdisk.
But it doesn’t have any partitions here. There is no SDB. One, two, three something. Let’s go ahead and take a look with FDIs l SDB. Let’s make it a little bit clearer. Okay, so there is indeed a disc called Dev SDB. And okay, that’s unit, right. But can you see the important detail here? Perhaps I should show you the SDA as well. This is the SDB part and this is the SDA part.
You can see how SDA has a partition table down below. While on the other hand, SDB doesn’t actually have anything of a kind. So let us be kind and grant SDB some sort of a table. Let’s create it for it and let’s make it happy. Go ahead and clear the screen. Type in fdisc. And if I just type in the name of my drive here. So deist. Excellent. So now we are in the Fdisc menu and says welcome to Fdisc.
One thing to keep in mind here is that whatever you do until you decide to write the changes here, it says right here at the top, until you decide to actually write them, they will not take effect. And if you exit, they definitely won’t take effect. You need to write them and then, and only then, this is a security feature in order to prevent accidental partition deletion. Believe it or not, that sort of a thing actually happens in the real world too. So let’s type in. It says command M for help. I mean, it’s waiting for a command and it then says M for help. Well, that sounds like a good idea.
Let’s go ahead and press M and we get a download of options. If we go ahead and press X, it says Expert Command. And if we type in M again, then we get even more options. That’s a lot. Well, maybe not that many, but still quite a good deal. So let’s go ahead and use some of them in order to actually go ahead and create a new partition table. So what have we got here? Let’s see. B print the partition table. Okay, let’s go ahead and do that. Nonexistent. That’s not something that we want. Do we have any other options. Oh, by the way, if you want to quit, just use Q and it’s going to quit without saving changes, which means it will quit without applying them in the first place.
Just give me a moment. A list known partition types. Let’s have a look. A lot of them here, there’s a good deal of them, but that is good because you can read pretty much anything with a Linux system, more or less anything. It’s unbelievable. While on Windows you can just read a few of them on a Linux. Linux understands pretty much any sort of disk, whatever format used to write onto the disk, whether it’s XFS or whether it’s X four or whether it’s NTFS or something of a kind, linux will recognize it. And even if you don’t see some of the options here, I do believe that they can be installed additionally. If I’m not mistaken, they can definitely be installed additionally, but I’m just not sure if all of them are here now at this point of time. Well, that was a miraculous thing that I did there.
Let’s go ahead and type in N for new. And now we are prompted. It says, Would you like to create a primary partition or would you like to create an extended partition? You can only create four primary partitions per a disc. So you go ahead and create primary partitions first and then you create the secondary one. Simple.
Yes, but how should I put this? You always want to max out your primary partitions on a disc before you go into secondary ones. So you don’t want like one primary partition and then three secondary ones, three extended ones. Sorry, what you want is four primary partitions. If you have a need for multiple partitions per disk, make sure that you always go primary, primary, primary, primary and then you move on into extended. Anyway, let’s go ahead and press P for primary. And the default is P as well. Partition number. This is partition number one, I guess. So we will use the default one. Press Enter. I didn’t actually type in one there.
I could have just pressed Enter. But hey, it doesn’t really matter here it says here First Sector and it says Default 2048. I’ll just press Enter and it says using Default. Now this part here is a bit more interesting. Let me just go ahead and expand the screen so you can see it a little bit better. The command is not that long, but the menu behind it is anyway, it says Last sector plus sectors or or which is far more useful. This is for the definition of the size of this partition.
You just type in plus. And how big would you like your disk to be? Well, how much space did I assign? Ten gigs. Excellent. So I’ll say five G and I will press enter. That is literally all that I needed to do it’s over. It’s done. I have created it. Now I would like to do something else. I would like to print the partition table. Oh, guess what? Now SDB one exists. Let’s see. We will need to use this option of course, before we exit.
If we don’t use the W option before we exit, all of our work will be in vain for nothing. And we will most likely tear the hair out of our heads and then rage. Then come back and then do it again. Anyway, let’s go ahead and take a look. So change display, change partition, create a new empty Sun Disk label. Now I don’t really need that. Add a new partition from this menu. Okay, so let’s go ahead and delete the partition. So how would we do that? We would type in the partition one is deleted because there is only one partition. Okay, so let’s go ahead and create two partitions and see what happens there. So, new primary default one. This is all good. Let’s say plus 5G.
Okay, that’s when it’s been created. Let’s go ahead and create another one. So P for primary partition number don’t really care, just use a default first sector. Yes, use the default one last sector. So we will type in plus five as well. Let’s say that this one will be plus ten. This is the partition, that is the man. And I will create one more because I will need it for later on. Most likely the default is three. No problems.
Notice how the numbers go from one to four and then they increase. So it was from one to four. It was from two to four and now it’s from three to four. Just a bit of detail there for you in the background. Oh, mess this one up. Doesn’t really matter. I will delete it anyway because I didn’t specify the size at the end. But I just need it to basically delete it.
So I press D and see what it is asking me. Now it says hey, which partition, which partition would you like to delete? Well, I don’t know. Let’s go ahead and try with the three since I messed it up anyway and says partition three has been deleted. So give me the partition table. And there you go. Now we have exactly two partitions here. It says SDB One and SDB Two. After all this effort and after all that we have done, we have only created partitions. We didn’t actually format anything, we didn’t do anything, we didn’t apply any changes. We’ve just set the field for writing changes to disk. What shall we do? Let’s write it. Careful. Once you press right, you cannot undo. So if you are writing and if you’re in the middle of the process, if you press CTRL C, that will not help you. That will pretty much almost guarantee to make things worse.
So let’s go ahead and press Enter. Partition table has been altered to reread partition table. So no need to actually go through any of that at the moment. That’s a function up there with the brackets. Not the brackets, the parentheses. Okay, so we no longer need Ftisk. We no longer need to be inside of Fdisc. Let’s go ahead and clear and type in Fdisl devsdb. Thank you. So now you can see that dev SDB has partitions. Indeed, like dev SDA, they both have partitions. SDB is not being booted from. So it doesn’t have that, doesn’t have this asterisk as you see it here.
And now in the next tutorial, I will show you how to format partitions. And that’s really what I meant when I said when you interrupt, it won’t really help you. This is what I’m referring to during the formatting procedure, when you actually assign a file system to a partition, when you format it in accordance with that file system, if you interrupted during the middle of that process, or something of a kind, will do more damage than good, believe me. Anyway, at this point of time, I would like to bid you all farewell, and I hope to see you in the follow up tutorial.
Interesting posts
The Growing Demand for IT Certifications in the Fintech Industry
The fintech industry is experiencing an unprecedented boom, driven by the relentless pace of technological innovation and the increasing integration of financial services with digital platforms. As the lines between finance and technology blur, the need for highly skilled professionals who can navigate both worlds is greater than ever. One of the most effective ways… Read More »
CompTIA Security+ vs. CEH: Entry-Level Cybersecurity Certifications Compared
In today’s digital world, cybersecurity is no longer just a technical concern; it’s a critical business priority. With cyber threats evolving rapidly, organizations of all sizes are seeking skilled professionals to protect their digital assets. For those looking to break into the cybersecurity field, earning a certification is a great way to validate your skills… Read More »
The Evolving Role of ITIL: What’s New in ITIL 4 Managing Professional Transition Exam?
If you’ve been in the IT service management (ITSM) world for a while, you’ve probably heard of ITIL – the framework that’s been guiding IT professionals in delivering high-quality services for decades. The Information Technology Infrastructure Library (ITIL) has evolved significantly over the years, and its latest iteration, ITIL 4, marks a substantial shift in… Read More »
SASE and Zero Trust: How New Security Architectures are Shaping Cisco’s CyberOps Certification
As cybersecurity threats become increasingly sophisticated and pervasive, traditional security models are proving inadequate for today’s complex digital environments. To address these challenges, modern security frameworks such as SASE (Secure Access Service Edge) and Zero Trust are revolutionizing how organizations protect their networks and data. Recognizing the shift towards these advanced security architectures, Cisco has… Read More »
CompTIA’s CASP+ (CAS-004) Gets Tougher: What’s New in Advanced Security Practitioner Certification?
The cybersecurity landscape is constantly evolving, and with it, the certifications that validate the expertise of security professionals must adapt to address new challenges and technologies. CompTIA’s CASP+ (CompTIA Advanced Security Practitioner) certification has long been a hallmark of advanced knowledge in cybersecurity, distinguishing those who are capable of designing, implementing, and managing enterprise-level security… Read More »
Azure DevOps Engineer Expert Certification: What’s Changed in the New AZ-400 Exam Blueprint?
The cloud landscape is evolving at a breakneck pace, and with it, the certifications that validate an IT professional’s skills. One such certification is the Microsoft Certified: DevOps Engineer Expert, which is validated through the AZ-400 exam. This exam has undergone significant changes to reflect the latest trends, tools, and methodologies in the DevOps world.… Read More »