btrfs subvolume create [-i <qgroupid>] [<dest>/]<name>
btrfs subvolume delete <subvolume> [<subvolume>...]
btrfs subvolume list [options] [-G [+|-]value] [-C [+|-]value] [--sort=rootid,gen,ogen,path] <path>
btrfs subvolume snapshot [-r] <source> <dest>|[<dest>/]<name>
btrfs subvolume get-default <path>
btrfs subvolume set-default <id> <path>
btrfs subvolume find-new <subvolume> <lastgen>
btrfs subvolume show <path>
btrfs filesystem df <path>
btrfs filesystem show [--mounted|--all-devices|<uuid>]
btrfs filesystem sync <path>
btrfs filesystem defragment [options] <file>|<dir> [<file>|<dir>...]
btrfs filesystem resize [devid:][+/-]<size>[gkm]|[devid:]max <path>
btrfs filesystem label [<device>|<mount_point>] [<newlabel>]
btrfs [filesystem] balance start [options] <path>
btrfs [filesystem] balance pause <path>
btrfs [filesystem] balance cancel <path>
btrfs [filesystem] balance resume <path>
btrfs [filesystem] balance status [-v] <path>
btrfs device add [-Kf] <device> [<device>...] <path>
btrfs device delete <device> [<device>...] <path>
btrfs device scan [--all-devices|<device> P[<device>...]
btrfs device ready <device>
btrfs device stats [-z] {<path>|<device>}
btrfs scrub start [-BdqrR] [-c ioprio_class -n ioprio_classdata] {<path>|<device>}
btrfs scrub cancel {<path>|<device>}
btrfs scrub resume [-BdqrR] [-c ioprio_class -n ioprio_classdata] {<path>|<device>}
btrfs scrub status [-d] {<path>|<device>}
btrfs check [options] <device>
btrfs rescue chunk-recover [options] <path>
btrfs rescue super-recover [options] <path>
btrfs restore [options] <device>
btrfs inspect-internal inode-resolve [-v] <inode> <path>
btrfs inspect-internal logical-resolve [-Pv] [-s <size>] <logical> <path>
btrfs inspect-internal subvolid-resolve <subvolid> <path>
btrfs inspect-internal rootid <path>
btrfs send [-v] [-p <parent>] [-c <clone-src>] [-f <outfile>] <subvol>
btrfs receive [-ve] [-f <infile>] <mount>
btrfs quota enable <path>
btrfs quota disable <path>
btrfs quota rescan [-s] <path>
btrfs qgroup assign <src> <dst> <path>
btrfs qgroup remove <src> <dst> <path>
btrfs qgroup create <qgroupid> <path>
btrfs qgroup destroy <qgroupid> <path>
btrfs qgroup show <path>
btrfs qgroup limit [options] <size>|none [<qgroupid>] <path>
btrfs replace start [-Bfr] <srcdev>|<devid> <targetdev> <mount_point>
btrfs replace status [-1] <mount_point>
btrfs replace cancel <mount_point>
btrfs help|--help
btrfs <command> --help
btrfs is used to control the filesystem and the files and directories stored. It is the tool to create or destroy a snapshot or a subvolume for the filesystem, to defrag a file or a directory, flush the data to the disk, to resize the filesystem, to scan the device.
It is possible to abbreviate the commands unless the commands are ambiguous. For example: it is possible to run btrfs sub snaps instead of btrfs subvolume snapshot. But btrfs file s is not allowed, because file s may be interpreted both as filesystem show and as filesystem sync. In this case btrfs returns filesystem sync If a command is terminated by --help , the detailed help is showed. If the passed command matches more commands, detailed help of all the matched commands is showed. For example btrfs dev --help shows the help of all device* commands.
Options
List the subvolumes present in the filesystem <path>. For every subvolume the following information is shown by default. ID <ID> top level <ID> path <path> where path is the relative path of the subvolume to the top level subvolume.
The subvolume's ID may be used by the subvolume set-default command, or at mount time via the subvolid= option. If -p is given, then parent <ID> is added to the output between ID and top level. The parent's ID may be used at mount time via the subvolrootid= option.
Options
for --sort you can combine some items together by ',', just like -sort=+ogen,-gen,path,rootid.
The start position and the number of bytes to defragment can be specified by start and len. Any extent bigger than threshold will be considered already defragged. Use 0 to take the kernel default, and use 1 to say every single extent must be rewritten. You can also turn on compression in defragment operations.
Options
For start, len, size it is possible to append a suffix like k for 1 KBytes, m for 1 MBytes...
NOTE: defragmenting with kernels up to 2.6.37 will unlink COW-ed copies of data, don't use it if you use snapshots, have de-duplicated your data or made copies with cp --reflink.
If 'max' is passed, the filesystem will occupy all available space on the device devid.
The resize command does not manipulate the size of underlying partition. If you wish to enlarge/reduce a filesystem, you must make sure you can expand the partition before enlarging the filesystem and shrink the partition after reducing the size of the filesystem. This can done using fdisk(8) or parted(8) to delete the existing partition and recreate it with the new desired size. When recreating the partition make sure to use the same starting disk cylinder as before.
Options
Options
Options
Options
Options
Options
Options
Options
Options
Options
Options
The result is undefined for the so-called empty subvolumes (identified by inode number 2).
Options
Options
Options
Options
Options
btrfs returns a zero exist status if it succeeds. Non zero is returned in case of failure.
btrfs is part of btrfs-tools. Btrfs filesystem is currently under heavy development, and not suitable for any uses other than benchmarking and review. Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for further details.