🖥️btrfs
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the btrfs command with important options and switches using examples.
2 minute read
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██████╗ ████████╗██████╗ ███████╗███████╗
# ██╔══██╗╚══██╔══╝██╔══██╗██╔════╝██╔════╝
# ██████╔╝ ██║ ██████╔╝█████╗ ███████╗
# ██╔══██╗ ██║ ██╔══██╗██╔══╝ ╚════██║
# ██████╔╝ ██║ ██║ ██║██║ ███████║
# ╚═════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚══════╝
# Create a btrfs file system on /dev/sdb, /dev/sdc, and /dev/sdd
mkfs.btrfs /dev/sdb /dev/sdc /dev/sdd
# btrfs with just one hard drive, metadata not redundant
# (this is danegerous: if your metadata is lost, your data is lost as well)
mkfs.btrfs -m single /dev/sdb
# data to be redundant and metadata to be non-redundant:
mkfs.btrfs -m raid0 -d raid1 /dev/sdb /dev/sdc /dev/sdd
# both data and metadata to be redundan
mkfs.btrfs -d raid1 /dev/sdb /dev/sdc /dev/sdd
# To get a list of all btrfs file systems
btrfs filesystem show
# detailed df for a fileesystem (mounted in /mnt)
btrfs filesystem df /mnt
# resize btrfs online (-2g decreases, +2g increases)
btrfs filesystem resize -2g /mnt
# use maximum space
btrfs filesystem resize max /mnt
# add new device to a filesystem
btrfs device add /dev/sdf /mnt
# remove devices from a filesystem
btrfs device delete missing /mnt
# create the subvolume /mnt/sv1 in the /mnt volume
btrfs subvolume create /mnt/sv1
# list subvolumes
btrfs subvolume list /mnt
# mount subvolume without mounting the main filesystem
mount -o subvol=sv1 /dev/sdb /mnt
# delete subvolume
btrfs subvolume delete /mnt/sv1
# taking snapshot of a subvolume
btrfs subvolume snapshot /mnt/sv1 /mnt/sv1_snapshot
# taking snapshot of a file (copy file by reference)
cp --reflink /mnt/sv1/test1 /mnt/sv1/test3
# convert ext3/ext4 to btrfs
btrfs-convert /dev/sdb1
# convert btrfs to ext3/ext4
btrfs-convert -r /dev/sdb1
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command btrfs in a clear format. This allows users to quickly access the needed information for btrfs without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for btrfs are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.