• 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.btrfs: command not found

by Deepika

mkfs.btrfs is a utility used to create a Btrfs (short for “B-tree file system”) file system on a storage device. By default, mkfs.btrfs creates a RAID1 file system, meaning that data is stored in two identical copies, each located on a separate storage device. This provides data redundancy, allowing the file system to continue functioning even if one of the storage devices fails. The RAID1 layout is specified with the -d raid1 option, and it can be changed to other Btrfs RAID levels (e.g. RAID0, RAID10) if desired. Note that creating a Btrfs file system requires unmounting the target device, and all existing data on the device will be destroyed.

If you encounter the below error while running the command mkfs.btrfs:

mkfs.btrfs: command not found

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

Distribution Command
Debian apt-get install btrfs-progs
Ubuntu apt-get install btrfs-progs
Alpine apk add btrfs-progs
Arch Linux pacman -S btrfs-progs
Kali Linux apt-get install btrfs-progs
CentOS yum install btrfs-progs
Fedora dnf install btrfs-progs
Raspbian apt-get install btrfs-progs

mkfs.btrfs Command Examples

1. Create a btrfs filesystem on a single device:

# sudo mkfs.btrfs --metadata single --data single /dev/sda

2. Create a btrfs filesystem on multiple devices with raid1:

# sudo mkfs.btrfs --metadata raid1 --data raid1 /dev/sda /dev/sdb /dev/sdN

3. Set a label for the filesystem:

# sudo mkfs.btrfs --label "label" /dev/sda [/dev/sdN]

Filed Under: Linux

Some more articles you might also be interested in …

  1. prt-get Command Examples in Linux
  2. pi Command Examples in Linux
  3. “docker logs” Command Examples
  4. arch-chroot Command Examples in Linux
  5. genkernel Command Examples in Linux
  6. traceroute Command Examples in Linux
  7. a2ensite Command Examples in Linux
  8. Sa Command Examples in Linux
  9. partprobe Command Examples in Linux
  10. id: command not found

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