1BTRFS(8)                             btrfs                            BTRFS(8)
2
3
4

NAME

6       btrfs - control a btrfs filesystem
7

SYNOPSIS

9       btrfs subvolume snapshot <source> [<dest>/]<name>
10
11       btrfs subvolume delete <subvolume>
12
13       btrfs subvolume create [<dest>/]<name>
14
15       btrfs subvolume list <path>
16
17       btrfs subvolume set-default <id> <path>
18
19       btrfs filesystem defrag <file>|<dir> [<file>|<dir>...]
20
21       btrfs filesystem sync <path>
22
23       btrfs filesystem resize [+/-]<size>[gkm]|max <filesystem>
24
25       btrfs device scan [<device> [<device>..]]
26
27       btrfs device show <dev>|<label> [<dev>|<label>...]
28
29       btrfs device balance <path>
30
31       btrfs device add <dev> [<dev>..] <path>
32
33       btrfs device delete <dev> [<dev>..] <path> ]
34
35
36       btrfs help|--help|-h
37

DESCRIPTION

39       btrfs  is  used to control the filesystem and the files and directories
40       stored. It is the tool to create or destroy a snapshot or  a  subvolume
41       for  the filesystem, to defrag a file or a directory, flush the data to
42       the disk, to resize the filesystem, to scan the device.
43
44       It is possible to abbreviate the  commands  unless  the  commands   are
45       ambiguous.   For example: it is possible to run btrfs sub snaps instead
46       of btrfs subvolume snapshot.  But btrfs dev s is not  allowed,  because
47       dev  s  may  be interpreted both as device show and as device scan.  In
48       this case btrfs returns an error.
49
50       If a command is terminated by --help , the relevant help is showed.  If
51       the  passed  command matches more commands, the help of all the matched
52       commands are showed. For example btrfs dev --help shows the help of all
53       device* command.
54
55

COMMANDS

57       subvolume snapshot <source> [<dest>/]<name>
58              Create  a  writable  snapshot of the subvolume <source> with the
59              name <name> in the <dest> directory. If <source> is not  a  sub‐
60              volume, btrfs returns an error.
61
62
63       subvolume delete <subvolume>
64              Delete  the  subvolume <subvolume>. If <subvolume> is not a sub‐
65              volume, btrfs returns an error.
66
67
68       subvolume create [<dest>/]<name>
69              Create a subvolume in <dest> (or in  the  current  directory  if
70              <dest> is omitted).
71
72
73       subvolume list <path>
74              List  the subvolumes present in the filesystem <path>. For every
75              subvolume is showed the subvolume ID (second column), the ID  of
76              the  top  level  subvolume (fifth column), and the path (seventh
77              column) relative to the top level subvolume.  These <ID> may  be
78              used  by the subvolume set-default command, or at mount time via
79              the subvol= option.
80
81
82       subvolume set-default <id> <path>
83              Set the subvolume of the filesystem <path> which is  mounted  as
84              default.  The subvolume is identified by <id>, which is returned
85              by the subvolume list command.
86
87
88       filesystem defragment <file>|<dir> [<file>|<dir>...]
89              Defragment files and/or directories.
90
91
92       device scan [<device> [<device>..]]
93              Scan devices for a btrfs filesystem. If no devices  are  passed,
94              btrfs scans all the block devices.
95
96
97       filesystem sync <path>
98              Force a sync for the filesystem identified by <path>.
99
100
101
102       filesystem resize [+/-]<size>[gkm]|max <path>
103              Resize  a filesystem identified by <path>.  The <size> parameter
104              specifies the new size of the filesystem.  If the prefix + or  -
105              is  present  the  size is increased or decreased by the quantity
106              <size>.  If no units are  specified,  the  unit  of  the  <size>
107              parameter  defaults to bytes. Optionally, the size parameter may
108              be suffixed by one of the following the units designators:  'K',
109              'M', or 'G', kilobytes, megabytes, or gigabytes, respectively.
110
111              If  'max'  is  passed,  the filesystem will occupy all available
112              space on the volume(s).
113
114              The resize command does not manipulate the  size  of  underlying
115              partition.  If you wish to enlarge/reduce a filesystem, you must
116              make sure you can expand  the  partition  before  enlarging  the
117              filesystem  and  shrink the partition after reducing the size of
118              the filesystem.
119
120
121       filesystem show [<uuid>|<label>]
122              Show the btrfs filesystem with some additional info. If no  UUID
123              or label is passed, btrfs show info of all the btrfs filesystem.
124
125
126       device balance <path>
127              Balance the chunks of the filesystem identified by <path> across
128              the devices.
129
130
131       device add <dev> [<dev>..] <path>
132              Add device(s) to the filesystem identified by <path>.
133
134
135       device delete <dev> [<dev>..] <path>
136              Remove device(s) from a filesystem identified by <path>.
137

EXIT STATUS

139       btrfs returns a zero exist status if it succeeds. Non zero is  returned
140       in case of failure.
141
142

AVAILABILITY

144       btrfs is part of btrfs-progs. Btrfs filesystem is currently under heavy
145       development, and not suitable for any uses other than benchmarking  and
146       review.   Please  refer  to the btrfs wiki http://btrfs.wiki.kernel.org
147       for further details.
148

SEE ALSO

150       mkfs.btrfs(8)
151
152
153
154btrfs                                                                 BTRFS(8)
Impressum