btrfs-progs: cleanup unused assignment for chunk-recover
[platform/upstream/btrfs-progs.git] / Documentation / btrfs-device.txt
1 btrfs-device(8)
2 ===============
3
4 NAME
5 ----
6 btrfs-device - control btrfs devices
7
8 SYNOPSIS
9 --------
10 *btrfs device* <subcommand> <args>
11
12 DESCRIPTION
13 -----------
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.
16
17 DEVICE MANAGEMENT
18 -----------------
19 Btrfs filesystem is capable to manage multiple devices.
20
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
23 online.
24
25 Profile::
26 Btrfs filesystem uses data/metadata profiles to manage allocation/duplication
27 mechanism. +
28 Profiles like RAID level can be assigned to data and metadata separately.
29 +
30 See `mkfs.btrfs`(8) for more details.
31
32 RAID level::
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.
35 +
36 See `mkfs.btrfs`(8) for mkfs time RAID level assign and `btrfs-balance`(8) for
37 online RAID level assign.
38 +
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
43
44 Balance::
45 `btrfs-balance`(8) subcommand can be used to balance or rebuild chunks to the
46 desired profile.
47 +
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.
52 +
53 See `btrfs-balance`(8) for more details.
54
55 Device add/remove/replace::
56 Device can be added/removed using `btrfs-replace`(8) subcommand and replaced
57 using `btrfs-replace`(8).
58 +
59 When device is removed or replaced, btrfs will do the chunk rebuild if needed.
60 +
61 See `btrfs-replace`(8) and this man page for more details.
62
63 SUBCOMMAND
64 ----------
65 *add* [-Kf] <dev> [<dev>...] <path>::
66 Add device(s) to the filesystem identified by <path>.
67 +
68 If applicable, a whole device discard (TRIM) operation is performed.
69 +
70 `Options`
71 +
72 -K|--nodiscard::::
73 do not perform discard by default
74 -f|--force::::
75 force overwrite of existing filesystem on the given disk(s)
76
77 *delete* <dev> [<dev>...] <path>::
78 Remove device(s) from a filesystem identified by <path>.
79
80 *scan* [(--all-devices|-d)|<device> [<device>...]]::
81 Scan devices for a btrfs filesystem.
82 +
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 
87 scanned.
88
89 *ready* <device>::
90 Check device to see if it has all of it's devices in cache for mounting.
91
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>.
95 +
96 `Options`
97 +
98 -z::::
99 Reset stats to zero after reading them.
100
101 EXIT STATUS
102 -----------
103 *btrfs device* returns a zero exist status if it succeeds. Non zero is
104 returned in case of failure.
105
106 AVAILABILITY
107 ------------
108 *btrfs* is part of btrfs-progs.
109 Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for
110 further details.
111
112 SEE ALSO
113 --------
114 `mkfs.btrfs`(8),
115 `btrfs-replace`(8),
116 `btrfs-balance`(8)