6 btrfs-balance - balance btrfs filesystem
10 *btrfs balance* <subcommand> <args>
14 *btrfs balance* is used to balance chunks in a btrfs filesystem across
15 multiple or even single device.
17 See `btrfs-device`(8) for more details about the effect on device management.
19 NOTE: The balance subcommand also exists under the *filesystem* namespace. This
20 still works for backward compatibility but is deprecated and should not be
23 NOTE: A short syntax *btrfs balance <path>* works due to backward compatibility
24 but is deprecated and should not be used anymore. Use *btrfs balance start*
30 Cancel running or paused balance.
33 Pause running balance.
36 Resume interrupted balance.
38 *start* [options] <path>::
39 Balance chunks across the devices *online*.
41 Balance and/or convert (change allocation profile of) chunks that
42 passed all filters in a comma-separated list of filters for a
43 particular chunk type.
44 If filter list is not given balance all chunks of that type.
45 In case none of the -d, -m or -s options is
46 given balance all chunks in a filesystem.
51 act on data chunks. See `FILTERS` section for details about <filters>.
53 act on metadata chunks. See `FILTERS` section for details about <filters>.
55 act on system chunks (only under -f). See `FILTERS` section for details about <filters>.
59 force reducing of metadata integrity
61 *status* [-v] <path>::
62 Show status of running or paused balance.
64 If '-v' option is given, output will be verbose.
68 From kernel 3.3 onwards, btrfs balance can limit its action to a subset of the
69 full filesystem, and can be used to change the replication configuration (e.g.
70 moving data from single to RAID-1). This functionality is accessed through the
71 '-d', '-m' or '-s' options to btrfs balance start, which filter on data,
72 metadata and system blocks respectively.
74 A filter has the following stucture: ::
75 'type'[='params'][,'type'=...]
77 The available types are:
80 Balances only block groups with the given replication profiles. Parameters
81 are a list of profile names separated by |.
84 Balances only block groups with usage under the given percentage. The
85 value of 0 is allowed and will clean up completely unused block groups, this
86 should not require any new space allocated. You may want to use usage=0 in
87 case balance is returnin ENOSPC and your filesystem is not too full.
90 Balances only block groups which have at least one chunk on the given
91 device (by btrfs device ID -- use btrfs fi show to list device IDs)
94 Balances only block groups which overlap with the given byte range on any
95 device. (Use in conjunction with "devid" to filter on a specific device). The
96 parameter is a range specified as <start..end>.
99 Balances only block groups which overlap with the given byte range in the
100 filesystem's internal virtual address space. This is the address space that
101 most reports from btrfs in the kernel log use. The parameter is a range
102 specified as <start..end>.
105 Convert each selected block group to the given profile name identified by
109 Process only given number of chunks, after all filters apply. This can be used
110 to specifically target a chunk in connection with other filters (drange,
111 vrange) or just simply limit the amount of work done by a single balance run.
114 Takes no parameters. Only has meaning when converting between profiles.
115 When doing convert from one profile to another and soft mode is on,
116 restriper won't touch chunks that already have the target profile. This is
117 useful if e.g. half of the FS was converted earlier.
119 The soft mode switch is (like every other filter) per-type. This means
120 that we can convert for example meta chunks the "hard" way while converting
121 data chunks selectively with soft switch.
123 Profile names, used in profiles and convert are one of: 'raid0', 'raid1',
124 'raid10', 'raid5', 'raid6', 'dup', 'single'.
128 *btrfs balance* returns a zero exit status if it succeeds. Non zero is
129 returned in case of failure.
133 *btrfs* is part of btrfs-progs.
134 Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for