mkfs, mke2fs, fdformat, and more
Disk formatting is the process of preparing a storage device such as a hard drive, SSD, or USB flash drive for data storage. Formatting creates a filesystem on the storage device, which allows the operating system to organize and manage files on the device. In Linux, several disk formatting tool commands can be used to format storage devices. These tools include mkfs
, mke2fs
, fdformat
, and more.
mkfs
is a command that’s used to create a filesystem on a storage device. This command can be used to create a variety of filesystems, including ext2
, ext3
, ext4
, XFS
, btrfs
, and more. The mkfs
command is important in preparing storage devices for use in Linux systems. For example, when a new hard drive is added to a Linux server, it must be formatted before it can be used for data storage. Let’s examine a straightforward approach to utilize this tool on CentOS 8:
Figure 4.17 – Formatting a partition using mkfs...