All right, so let's talk about creating file systems.
So what is the purpose of a file system? Well, we just created a partition, but we can't do anything with
it. If you want to do something with your partition, you need to put a file system on top of it.
File systems are required to store files on partitions.
Generic file systems on Linux are XFS and ext4.
XFS is the default on Red Hat. Ext4 is the default on Ubuntu.
You may also hear about butterfs, written as BTRFs to be pronounced as butterfs,
which is a relatively new file system and is used on some distributions.
But as the main distributions are using XFS and EXE for. I'm not going
to make it too complicated and we won't talk about butterfs in this class.
If you want to create file systems, MKFS is the main utility now
MKFS XFS for XFS and MKFS EXE4 to create an EXE4 file system.
If you are interested in multi operating system support, there's also vfat and
ntfsng which are provided for Windows support. But I'm wondering, hey, this is
a Linux system, why would you want to have Windows support?
You're not going to run Windows on top of your Linux system. So NTFS NG, forget about it.
VFat is a different thing because VFAT is used for the UEFI system partition, and this UEFI
system partition is required while booting to get essential boot information from disk. Now, if you want
to know how that is relevant to Linux. Well, on a Linux system that is using GPT
for booting, and GPT is a standard since 2010, so all systems nowadays should be using it.
There should be a UEFI system partition with the system information, and this is formatted as vfat
so that it can be read From Linux, from macOS as well as from Windows.
That's an industry standard. So you need this VFAT partition and you will also see it.
Now let me show you the current file systems in use, and let me also show
you how we can create a file system on the partition that we just created.
All right, so we want to show these current file systems.
Well, I'm going to use sudo, mount, pipe, grab everything starting with a slash and
there we can see that we have an LVM logical volume which is xfs.
We have partition number two mounted on boot, which is also xfs. We have
partition number one, which is the EFI partition which is mounted as vfat.
All right, this is the existing partitions, we need to do something with the new partition.
So sudo mkfs xfs on dev nvme0n1p4 because
that's the name of the new partition.
Hey, this is kind of unexpected.
What do we see here? Well, we see that it has an error unexpected device. That's because of
this weird behavior that the disk that I am expecting to be NVMe 0n1 has become NVMe 0n2.
So I need to change my command and do it on disk number two.
Now, as I know that these disk names are subject to change, that's something that we need
to carefully consider in the next lesson when we are going to make for persistent mounts.
For now, all is good and we now have a file system on this partition.