mkfs.btrfs

Create a btrfs filesystem. Defaults to raid1, which specifies 2 copies of a given data block spread across 2 different devices. More information: <https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html>.

Install

All systems
curl cmd.cat/mkfs.btrfs.sh
Debian Debian
apt-get install btrfs-progs
Ubuntu
apt-get install btrfs-progs
Alpine
apk add btrfs-progs
Arch Arch Linux
pacman -S btrfs-progs
image/svg+xml Kali Linux
apt-get install btrfs-progs
CentOS
yum install btrfs-progs
Fedora
dnf install btrfs-progs
Windows (WSL2)
sudo apt-get update sudo apt-get install btrfs-progs
Raspbian
apt-get install btrfs-progs
Docker
docker run cmd.cat/mkfs.btrfs mkfs.btrfs powered by Commando

Create a btrfs filesystem. Defaults to raid1, which specifies 2 copies of a given data block spread across 2 different devices. More information: <https://btrfs.readthedocs.io/en/latest/mkfs.btrfs.html>.

  • Create a btrfs filesystem on a single device:
    sudo mkfs.btrfs --metadata single --data single /dev/sda
  • Create a btrfs filesystem on multiple devices with raid1:
    sudo mkfs.btrfs --metadata raid1 --data raid1 /dev/sda /dev/sdb /dev/sdN
  • Set a label for the filesystem:
    sudo mkfs.btrfs --label "label" /dev/sda [/dev/sdN]

© tl;dr; authors and contributors