So now that I created the new partition, we need to do something useful with it.
We need to put a file system on top of it.
In Red Hat Enterprise Linux, XFS is the default file system, and it has been ever since the
release of Red Hat Enterprise Linux 7.
XFS is fast and scalable.
It uses copy-on-write, which is an advanced mechanism to guarantee the data integrity
if ever your server crashes.
You can easily recover because of copy-on-write.
In XFS, you can easily increase the size of your file system, but you can't make it smaller.
An alternative file system is ext4.
That was the default in RHEL 6.
That's quite a while ago, but it's still available.
Ext4 is all the way backwards compatible to ext2, which is the original Linux file system
that was introduced in 1993.
Ext4 is using a journal to guarantee data integrity, and journals are a little bit slower,
but it offers one big benefit, and that is that the size can be increased and decreased.
Oh, and another benefit, it has awesome tools to repair anything that might go wrong on
the ext4 file system.
The tools are much better than the XFS utilities, but that's also because the architecture of
ext4 is a lot simpler.
Now we have VFAT.
VFAT offers multi-operating system support, and you need it for the UEFI boot partition.
That is the main reason for using VFAT.
Use it on shared devices and UEFI.
You may hear about ButterFS, written as B-T-R-F-S, but to be pronounced as ButterFS, because
according to the main developer, butter comes from a cow, and ButterFS was the first cow
for copy-on-write file system.
ButterFS is new.
It's advanced.
It looks amazing, but Red Hat doesn't consider it stable enough, and for that reason doesn't
use it.
Now if you want to create new partitions, you use mkfs.xfs to create XFS, and mkfs.ext4
to create ext4, or mkfs.vfat to create VFAT.
If you use mkfs and you press the Tab key twice, you see a list of all the available
file systems.
By any means, do not use mkfs without anything behind it, because then you will create the
exe2 file system, and really, that's an old file system, and there is no reason to create
exe2 anymore.
Now once it is created, you need to mount your file system.
We already talked about the mount command.
So use mount dev device name on a directory to connect it, and umount to disconnect.
And if ever umount is giving you a hard time, use lsof on your mount point to figure if
there's any open files.
The mount command itself shows all mounted file systems, but it's giving a lot of information.
It also includes administrative kernel mounts, and for that reason, you might be better off
using findmnt or lsblk for a clear overview of your mounts.
Now let me show you how to create a file system on these newly created partitions.
All right, I'm going to start with lsblk, because that's an easy reminder of my new
partition names, and nvme0n2p4 is the first one I'm going to use.
So mkfs.xfs on slash dev slash nvme0n2p4, that will create an XFS file system on it.
And then I can mount it, easy like mount dev nvme0n2p4, and I want to temporarily mount
it on slash mnt.
I don't know why it's saying that FFstep has been modified.
I didn't modify my FFstep, but you can see that the mount command is not complaining,
and when I type mount, I see a list of all the mounts.
The good thing is that the last mount was added is always listed last, but you might
be better off using lsblk for a clean overview of file systems that are currently mounted.
Or if you want to findmnt, which is showing the file system directory structure, and if
a directory is mounted on a specific device, you see all these specific devices.
What I don't like about it is that findmnt is also showing all these administrative mounts,
and really, that's not something that I do care about.
I care about this one, what you see right here.