6 btrfs-device - control btrfs devices
10 *btrfs device* <subcommand> <args>
14 *btrfs device* is used to control the btrfs devices, since btrfs can be used
15 across several devices, *btrfs device* is used for multiple device management.
19 Btrfs filesystem is capable to manage multiple devices.
21 Btrfs filesystem uses different profiles to manage different RAID level, and
22 use balance to rebuild chunks, also devices can be added/removed/replace
26 Btrfs filesystem uses data/metadata profiles to manage allocation/duplication
28 Profiles like RAID level can be assigned to data and metadata separately.
30 See `mkfs.btrfs`(8) for more details.
33 Btrfs filesystem supports most of the standard RAID level: 0/1/5/6/10. +
34 RAID levels can be assigned at mkfs time or online.
36 See `mkfs.btrfs`(8) for mkfs time RAID level assign and `btrfs-balance`(8) for
37 online RAID level assign.
39 NOTE: Since btrfs is under heavy development especially the RAID5/6 support,
40 it is *highly* recommended to read the follow btrfs wiki page to get more
41 updated details on RAID5/6: +
42 https://btrfs.wiki.kernel.org/index.php/RAID56
45 `btrfs-balance`(8) subcommand can be used to balance or rebuild chunks to the
48 Due to the fact that balance can rebuild/recovery chunks according to its RAID
49 duplication if possible, so when using RAID1/5/6/10 with some devices failed
50 and you just added a new device to btrfs using `btrfs-device`(8), you should
51 run `btrfs-balance`(8) to rebuild the chunks.
53 See `btrfs-balance`(8) for more details.
55 Device add/remove/replace::
56 Device can be added/removed using `btrfs-replace`(8) subcommand and replaced
57 using `btrfs-replace`(8).
59 When device is removed or replaced, btrfs will do the chunk rebuild if needed.
61 See `btrfs-replace`(8) and this man page for more details.
65 *add* [-Kf] <dev> [<dev>...] <path>::
66 Add device(s) to the filesystem identified by <path>.
68 If applicable, a whole device discard (TRIM) operation is performed.
73 do not perform discard by default
75 force overwrite of existing filesystem on the given disk(s)
77 *delete* <dev> [<dev>...] <path>::
78 Remove device(s) from a filesystem identified by <path>.
80 *scan* [(--all-devices|-d)|<device> [<device>...]]::
81 Scan devices for a btrfs filesystem.
83 If one or more devices are passed, these are scanned for a btrfs filesystem.
84 If no devices are passed, btrfs uses block devices containing btrfs
85 filesystem as listed by blkid.
86 Finally, if '--all-devices' or '-d' is passed, all the devices under /dev are
90 Check device to see if it has all of it's devices in cache for mounting.
92 *stats* [-z] <path>|<device>::
93 Read and print the device IO stats for all devices of the filesystem
94 identified by <path> or for a single <device>.
99 Reset stats to zero after reading them.
103 *btrfs device* returns a zero exist status if it succeeds. Non zero is
104 returned in case of failure.
108 *btrfs* is part of btrfs-progs.
109 Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for