File System Creation (Demo)

Video Activity
Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *
or

Already have an account? Sign In »

Time
21 hours 25 minutes
Difficulty
Intermediate
CEU/CPE
21
Video Transcription
00:00
>> Hello there cybrarians and welcome back to
00:00
the Linux plus course here at Cybrary.
00:00
I'm your instructor Rob Gills and in
00:00
today's lesson we're going to be
00:00
discussing the file system creation.
00:00
Upon completion of the day's lesson,
00:00
you'll be able to explain the difference between
00:00
the ext and xfs file systems and we're
00:00
also going to use the command mkfs
00:00
in order to create file systems on disk.
00:00
The ext file system is actually the Linux extended
00:00
file system and has been
00:00
the default file system in Linux for a very long time.
00:00
Starting with ext2,
00:00
ext3 came along and improved
00:00
ext2 by allowing journaling and journaling
00:00
is a concept that prevents
00:00
file system corruption because it tracks
00:00
all the changes that are made to
00:00
every file in a journal, hence journaling.
00:00
If the system crashes,
00:00
the file system can be recovered
00:00
>> because the journal can
00:00
>> play back any changes to
00:00
those files by recovering file metadata.
00:00
Ext4 was an improvement upon ext3 supporting
00:00
larger file systems up to one exabyte and
00:00
larger file sizes up to 16 terabytes.
00:00
It also improves the performance
00:00
of file system checks and
00:00
defragmenting file systems and
00:00
you'll see that in Ubuntu,
00:00
ext4 is still used as the default file system type.
00:00
One last file system we're going to discuss here
00:00
today is the extend file system,
00:00
which is known as xfs,
00:00
and that is the default file system for Red Hat and has
00:00
been so since Red Hat Enterprise Linux 7,
00:00
which we usually just abbreviate as RHEL
00:00
7 and this has been the default since 2014.
00:00
Xfs tends to be faster on larger drives that ext is,
00:00
however, you can't shrink an xfs file system.
00:00
With ext and ext4,
00:00
if you're not using all of
00:00
the files space on disk and you need to free it
00:00
up and add another partition or
00:00
another file system you can do so.
00:00
You can shrink ext4,
00:00
you cannot shrink xfs.
00:00
Now, the command that we're going to
00:00
use in order to create
00:00
any file system is mkfs.
00:00
How does one use that command
00:00
though? Well, that's a good question.
00:00
Why don't we answer it with some demo time?
00:00
[NOISE] Here we are in
00:00
our CentOS environment and
00:00
the first thing I want to do is just type out
00:00
the block devices we have in the
00:00
>> system by using lsblks,
00:00
>> let's list the block devices and now
00:00
we can see that we have STB1 and
00:00
SDC1 on the STB and SDC devices, respectively.
00:00
Full disclosure, I did a little bit of clean up
00:00
over here from our last lesson where we did
00:00
stuff with RAID and mdadm and
00:00
that's just so that we could play around
00:00
with creating file systems.
00:00
What we're going to do is we're going to use
00:00
the mkfs command,
00:00
let me clear our screen by
00:00
>> hitting Control L [NOISE] and
00:00
>> we're going to type out here
00:00
mkfs and we're going
00:00
to specify the file system that we
00:00
want to set on our partition.
00:00
We're going to give this first partition on DevOps TB1,
00:00
the file system type of mkfs and we hit Enter,
00:00
we can see that it's actually created the file system
00:00
and then before K blocks and a number of I nodes,
00:00
it's giving it a UUID.
00:00
But oddly enough, we can see that
00:00
it actually runs mke2fs.
00:00
Well, the thing that you should know about mkfs,
00:00
make fs is that it's really just a wrapper around
00:00
the underlying tools that are
00:00
used for any given file system type.
00:00
Exts uses mke2fs and
00:00
when we touch on xfs here in a minute,
00:00
you'll see that it doesn't use that,
00:00
it uses something else..
00:00
In fact, let's go ahead and do that.
00:00
Let's use mkfs and give it
00:00
a type and this time we're going to
00:00
specify the type is xfs,
00:00
the extend file system and we're going to
00:00
create a file system on DevSD1.
00:00
[NOISE] Now, we can see that that is created
00:00
and it did not use mke2fs.
00:00
It just in fact use
00:00
the underlying xfs tools to create this partition,
00:00
to create this file system on the partition rather
00:00
and we can see all the information
00:00
about what has been created.
00:00
We will see more about
00:00
ext and xfs file systems in a later lesson,
00:00
but for now that's it
00:00
[NOISE] and we've reached the end of
00:00
our lesson and in this lesson we covered
00:00
the difference between ext and
00:00
xfs and how to create file systems with a command mkfs.
00:00
Thank you so much for being here and I look
00:00
forward to seeing you in our next lesson.
00:00
[NOISE]
Up Next