In this demonstration,
I will walk you through how to partition a file system
in Linux using the F disk tool.
The F disk utility is a menu driven program that is used
to create, modify or to delete partitions
on a storage drive.
We're also going to create an XFS
and an EXT four file system on these partitions.
I'm going to stay root for the walkthrough to save time
since most of the commands require elevated privileges.
So I'm going to start out by creating a partition
on the second hard drive of the device.
So I'm going to use F disk,
by sdb,
(indistinct) second hard drive on the device.
Now I want to print, this.
Now we see that there's no partitions currently
on this drive.
Now click M for help.
Let's take a look at the current options that we can use
for F disk.
Remember, it's just a menu driven tool.
So all I had to do is click the letter,
and it will prompt you all the changes that you
would like to do.
So, first thing we want to do is create a new partition.
And for this example, we're going
to use a primary partition.
A primary partition contains one file system
or a logical drop.
It's sometimes referred to as a volume as well.
Now, typically the swap file system
and the boot portions are stored on a primary partition
and a swap file system is just the part of the hard drive
that the system will use when the RAM is full.
So it's able to offload some information
and to use the RAM for more active applications.
Okay, P.
We use partition one default.
We want to let the first sector stay.
Now we're going to make this drive roughly two gigabytes.
So I'm going to do plus,
2048,
million bytes,
because that's what correlates to about two gigabytes.
And we see that has set.
Now, we're going to have to write,
and that now saves the information that's
on a partition table.
Now, in order to update a kernel,
we have to use a command called partprobe.
This command is used to update the kernel
with the changes on our partition table.
If not, it will only read it once we do a reboot.
So we'll do it now.
Partprobe,
dev, sdb.
All right, good to go there.
Next thing we're going to do is make the XFS file system
on the partition that we just created.
The XFS file system is a high performance
journaling file system that provides fast recovery.
It's used for typically large files.
So we're going to do, make file system,
XFS.
Now, another option for this command.
You can use the dash T after
MKFS,
and then just specify the type of file system you
want to use.
But the faster simpler way is just to use the period after
and add the type of file system you would like to use.
So in this example, its going to be XFS.
All right, we're going to assume is that there
is currently a file system on that particular portion.
So I'm just going to use the dash F, to force it.
Now it looks like everything went through correctly.
Next we're going to make another partition
using the parted tool.
The gnu new parted tool is very similar to F disk,
it's menu driven and it's just used to create partition.
All right, now I'm going to print
out the list of partitions.
So we can see here,
the partition that we created earlier
using the F disk tool.
Now to make the partition,
we use the make part command.
And again, we use the primary command on here.
Primary,
hard drop,
file system we are going to use this time is
going to be EXT four.
So I'm going to use use 2, 1, 4, 9 megabytes.
We just end it at the end of the hard drive,
it's going to be 8, 9, 8, 5, 9, 0 megabytes.
Now just note, when we put in that type of file system
that's not actually formatting the disk
to be that file system.
That's just letting the system know that an
EXT four file system will be formatted on this partition.
Now we have to go through and actually make the file system.
So we're going to do,
EXT four.
SDB two.
We can see by this information,
that the command was executed successfully.
Now, last thing we want to do is to label the partitions.
So for the XFS one,
we have to use the XFS underscore admin command
and this will list out,
the actual partition.
And we can see that the label is empty.
So now we're just going to arrow up,
change this to capital L,
which in that case, that we're going to label
the actual partition,
so we can call that system backup.
Okay. That went through successful.
Now for the EXT four file system,
we are going to have to use a different command.
I'm going to use E two label,
dev,
two.
And that blank currently indicates that there's no label
for the EXT four partition.
Now to set it, we're simply going to arrow up
and label it,
data
back up.
And now, she got through successfully.
Let's go back to verify,
looks like we are good there,
Okay.
We just did a walk through of how to create partitions
on Linux using the F disk and the parted tool.
We also used the XFS command to make file systems
on the partitions.
And I'll see you, in the next lesson.