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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • 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. How to enable bind query logging to find out Who’s Querying a Name Server
  2. What are SELinux Users and how to Map Linux Users to SELinux Users
  3. apt-file: command not found
  4. qtile Command Examples in Linux
  5. v4l2-ctl: command not found
  6. How to Create An LVM Snapshot Of The Root Filesystem And Restore To An Earlier State
  7. tvservice: command not found
  8. ac: command not found
  9. btrbk Command Examples in Linux
  10. CentOS / RHEL : How to prioritize the devices used for swap partition

You May Also Like

Primary Sidebar

Recent Posts

  • diffstat: Create a histogram from the output of the diff command
  • diffoscope: Compare files, archives, and directories
  • diff-pdf: Tool for comparing two PDFs
  • dict: Command line dictionary using the DICT protocol

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright