Member-only story
In “Linux — Filesystems Introduction, Part One”, I introduced what Filesystems is in Linux and its basic concepts, let’s continue explore Linux Filesystems in this article.
Common Filesystem Operations
Creating filesystems
To utilize a filesystem, the initial action involves its creation, which entails configuring the essential components that constitute the filesystem, utilizing a partition or volume as the input source. Once you’ve gathered all the necessary details, you can employ the mkfs
command to establish the filesystem.
mkfs
stands for "make filesystem." It is a command-line tool that is available on most Linux distributions. The primary purpose of mkfs
is to format a block device, such as a partition or a volume, into a specific filesystem format, allowing it to store and manage files and directories.
To create a filesystem using the mkfs
command, you need to specify the filesystem type you want to create, the target device (partition or volume), and any optional parameters. The general syntax of the mkfs
command is as follows:
$ mkfs -t filesystem_type device
For example:
$ sudo mkfs -t ext4 /dev/sdb1
...
mke2fs 1.45.5 (07-Jan-2020)
Creating filesystem…