The mkfs tool creates the disk file system on a partition of the block storage
device. Note that a partition is just that - a separate physical space on a disk labeled
as a partition. The file system is written inside the partition and is contained in it.
Linux supports a large number of file systems, each with their own pros and cons. The various
disk file systems try to balance read performance, write performance, large file performance,
small file performance, reliability, and recoverability. There is not a perfect solution,
which is why there are so many options. The xfs disk file system is the default for CentOS
while ext4 is the default for Ubuntu and Fedora Linux. Both provide a good balance for
workloads typically associated with a development workstation.
The example in Figure 4.5 (on page ) shows how the mkfs
command can be used to create an ext4 disk file system on partition 1 of the sdb block
storage device. The -t option is used to specify the type of disk file system to create.
Out of the box, CentOS Linux supports the following disk file systems: btrfs, cramfs,
ext2, ext3, ext4, fat, minix, msdos, vfat, and xfs.
The most common file system that you will deal with are ext4, xfs, and btrfs.