• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

mkfs: command not found

by admin

The mkfs command is used to build a Linux file system on a device, which is usually a drive partition. The below table lists some options of the mkfs command and their descriptions.

Option Used To
-v Produce verbose output
-V Produce verbose output including file-system specific command
-t {fstype} Specify type of file system to build
fs-options Pass file system specific options to builder
-c Check device for bad blocks before building
-l {file-name} Read list of bad blocks from file

Syntax

One syntax option of the mkfs command is:

# mkfs [options] {device name}

Another syntax option is:

# mkfs.{file system type} [options] {device name}

If you encounter below error while running the mkfs command:

mkfs: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
OS X brew install util-linux
Debian apt-get install fdisk
Ubuntu apt-get install fdisk
Alpine apk add util-linux
Arch Linux pacman -S util-linux
Kali Linux apt-get install fdisk
CentOS yum install util-linux
Fedora dnf install util-linux
Raspbian apt-get install util-linux

mkfs Command Examples

1. To make the file system:

# mkfs /dev/sda2 

2. To produce the verbose output:

# mkfs -V /dev/sda2 

3. To specify the file system type:

# mkfs -t fstype /dev/sda2 

4. To file system-specific options to be passed to the real file system builder:

# mkfs fs-options 

5. To check the device for bad blocks before building the file system:

# mkfs -c 

6. To read the bad blocks list from filename:

# mkfs -l filename 

7. To produce the verbose output:

# mkfs -v /dev/sda2 

Filed Under: Linux

Some more articles you might also be interested in …

  1. command: Command forces the shell to execute the program and ignore any functions, builtins and aliases with the same name
  2. mktemp: command not found
  3. gnmic Command Examples
  4. aws configure – Manage configuration for the AWS CLI (Command Examples)
  5. sstat Command Examples in Linux
  6. joe Command Examples
  7. “git verify-commit” Command Examples
  8. Which network ports are reserved by the Linux Operating System?
  9. caja: command not found
  10. who Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright