]> git.sesse.net Git - bcachefs-tools-debian/blob - bcachefs.8
New upstream snapshot
[bcachefs-tools-debian] / bcachefs.8
1 .Dd May 26, 2018
2 .Dt BCACHEFS 8 SMM
3 .Os
4 .Sh NAME
5 .Nm bcachefs
6 .Nd manage bcachefs filesystems/devices
7 .Sh SYNOPSIS
8 .Nm
9 .Ar command
10 .Op Ar options
11 .Op Ar arguments
12 .Sh DESCRIPTION
13 The
14 .Nm
15 utility supports the following subcommands,
16 which are documented in detail below:
17 .Ss Superblock commands
18 .Bl -tag -width 18n -compact
19 .It Ic format
20 Format one or a list of devices with bcachefs data structures.
21 .It Ic show-super
22 Dump superblock information to stdout.
23 .El
24 .Ss Repair commands
25 .Bl -tag -width 18n -compact
26 .It Ic fsck
27 Check an existing filesystem for errors.
28 .El
29 .Ss Startup/shutdown, assembly of multi device filesystems
30 .Bl -tag -width 18n -compact
31 .It Ic assemble
32 Assemble an existing multi device filesystem
33 .It Ic incremental
34 Incrementally assemble an existing multi device filesystem
35 .It Ic run
36 Start a partially assembled filesystem.
37 .It Ic stop
38 Stop a running filesystem.
39 .El
40 .Ss Commands for managing a running filesystem
41 .Bl -tag -width 18n -compact
42 .It Ic fs usage
43 Show disk usage
44 .El
45 .Ss Commands for managing devices within a running filesystem
46 .Bl -tag -width 18n -compact
47 .It Ic device add
48 Add a new device to an existing filesystem
49 .It Ic device remove
50 Remove a device from an existing filesystem
51 .It Ic device online
52 Re-add an existing member to a filesystem
53 .It Ic device offline
54 Take a device offline, without removing it
55 .It Ic device evacuate
56 Migrate data off of a specific device
57 .It Ic device set-state
58 Mark a device as failed
59 .It Ic device resize
60 Resize filesystem on a device
61 .El
62 .Ss Commands for managing filesystem data
63 .Bl -tag -width 18n -compact
64 .It Ic data rereplicate
65 Rereplicate degraded data
66 .El
67 .Ss Commands for encryption
68 .Bl -tag -width 18n -compact
69 .It Ic unlock
70 Unlock an encrypted filesystem prior to running/mounting
71 .It Ic set-passphrase
72 Change passphrase on an existing (unmounted) filesystem
73 .It Ic remove-passphrase
74 Remove passphrase on an existing (unmounted) filesystem
75 .El
76 .Ss Commands for migration
77 .Bl -tag -width 18n -compact
78 .It Ic migrate
79 Migrate an existing filesystem to bcachefs, in place
80 .It Ic migrate-superblock
81 Add default superblock, after bcachefs migrate
82 .El
83 .Ss Commands for debugging
84 .Bl -tag -width 18n -compact
85 .It Ic dump
86 Dump filesystem metadata to a qcow2 image
87 .It Ic list
88 List filesystem metadata in textual form
89 .El
90 .Ss Miscellaneous commands
91 .Bl -tag -width 18n -compact
92 .It Ic version
93 Display the version of the invoked bcachefs tool
94 .El
95 .Sh Superblock commands
96 .Bl -tag -width Ds
97 .It Nm Ic format Oo Ar options Oc Ar devices\ ...
98 Format one or a list of devices with bcachefs data structures.
99 You need to do this before you create a volume.
100 .Pp
101 Device specific options must come before corresponding devices, e.g.
102 .Dl bcachefs format --group=ssd /dev/sda --label=hdd /dev/sdb
103 .Bl -tag -width Ds
104 .It Fl b , Fl -block Ns = Ns Ar size
105 block size, in bytes (e.g. 4k)
106 .It Fl -btree_node Ns = Ns Ar size
107 Btree node size, default 256k
108 .It Fl -metadata_checksum_type Ns = Ns ( Cm none | crc32c | crc64 )
109 Set metadata checksum type (default:
110 .Cm crc32c ) .
111 .It Fl -data_checksum_type Ns = Ns ( Cm none | crc32c | crc64 )
112 Set data checksum type (default:
113 .Cm crc32c ) .
114 .It Fl -compression Ns = Ns ( Cm none | lz4 | gzip | zstd )
115 Set compression type (default:
116 .Cm none ) .
117 .It Fl -data_replicas Ns = Ns Ar number
118 Number of data replicas
119 .It Fl -metadata_replicas Ns = Ns Ar number
120 Number of metadata replicas
121 .It Fl -replicas Ns = Ns Ar number
122 Sets both data and metadata replicas
123 .It Fl -encrypted
124 Enable whole filesystem encryption (chacha20/poly1305);
125 passphrase will be prompted for.
126 .It Fl -no_passphrase
127 Don't encrypt master encryption key
128 .It Fl -error_action Ns = Ns ( Cm continue | remount-ro | panic )
129 Action to take on filesystem error (default:
130 .Cm remount-ro )
131 .It Fl L , Fl -label Ns = Ns Ar label
132 Create the filesystem with the specified
133 .Ar label
134 .It Fl U , -uuid Ns = Ns Ar uuid
135 Create the filesystem with the specified
136 .Ar uuid
137 .It Fl f , Fl -force
138 Force the filesystem to be created,
139 even if the device already contains a filesystem.
140 .El
141 .Pp
142 Device specific options:
143 .Bl -tag -width Ds
144 .It Fl -fs_size Ns = Ns Ar size
145 Create the filesystem using
146 .Ar size
147 bytes on the subsequent device.
148 .It Fl -bucket Ns = Ns Ar size
149 Specifies the bucket size;
150 must be greater than the btree node size
151 .It Fl -discard
152 Enable discards on subsequent devices
153 .It Fl q , Fl -quiet
154 Only print errors
155 .El
156 .It Nm Ic show-super Oo Ar options Oc Ar device
157 Dump superblock information to stdout.
158 .Bl -tag -width Ds
159 .It Fl f , Fl -fields Ns = Ns Ar fields
160 List of sections to print
161 .It Fl l , Fl -layout
162 Print superblock layout
163 .El
164 .El
165 .Sh Repair commands
166 .Bl -tag -width Ds
167 .It Nm Ic fsck Oo Ar options Oc Ar devices\ ...
168 Check an existing filesystem for errors.
169 .Bl -tag -width Ds
170 .It Fl p
171 Automatic repair (no questions)
172 .It Fl n
173 Don't repair, only check for errors
174 .It Fl y
175 Assume "yes" to all questions
176 .It Fl f
177 Force checking even if filesystem is marked clean
178 .It Fl v
179 Be verbose
180 .El
181 .El
182 .Sh Startup/shutdown, assembly of multi device filesystems
183 .Bl -tag -width Ds
184 .It Nm Ic assemble Ar devices\ ...
185 Assemble an existing multi device filesystem.
186 .It Nm Ic incremental Ar device
187 Incrementally assemble an existing multi device filesystem.
188 .It Nm Ic run
189 Start a partially assembled filesystem.
190 .It Nm Ic stop Ar filesystem
191 Stop a running filesystem.
192 .El
193 .Sh Commands for managing a running filesystem
194 .Bl -tag -width Ds
195 .It Nm Ic fs Ic usage Oo Ar options Oc Op Ar filesystem
196 Show disk usage.
197 .Bl -tag -width Ds
198 .It Fl h
199 Print human readable sizes.
200 .El
201 .El
202 .Sh Commands for managing devices within a running filesystem
203 .Bl -tag -width Ds
204 .It Nm Ic device Ic add Oo Ar options Oc Ar device
205 Add a device to an existing filesystem.
206 .Bl -tag -width Ds
207 .It Fl -fs_size Ns = Ns Ar size
208 Size of filesystem on device
209 .It Fl -bucket Ns = Ns Ar size
210 Set bucket size
211 .It Fl -discard
212 Enable discards
213 .It Fl f , Fl -force
214 Use device even if it appears to already be formatted
215 .El
216 .It Nm Ic device Ic remove Oo Ar options Oc Ar device
217 Remove a device from a filesystem
218 .Bl -tag -width Ds
219 .It Fl f , Fl -force
220 Force removal, even if some data couldn't be migrated
221 .It Fl -force-metadata
222 Force removal, even if some metadata couldn't be migrated
223 .El
224 .It Nm Ic device Ic online Ar device
225 Re-add a device to a running filesystem
226 .It Nm Ic device Ic offline Ar device
227 Take a device offline, without removing it
228 .Bl -tag -width Ds
229 .It Fl f , Fl -force
230 Force, if data redundancy will be degraded
231 .El
232 .It Nm Ic device Ic evacuate Ar device
233 Move data off of a given device
234 .It Nm Ic device Ic set-state Oo Ar options Oc Ar device Ar new-state
235 .Bl -tag -width Ds
236 .It Fl f , Fl -force
237 Force, if data redundancy will be degraded
238 .El
239 .It Nm Ic device Ic resize Ar device Op Ar size
240 Resize filesystem on a device
241 .El
242 .Sh Commands for managing filesystem data
243 .Bl -tag -width Ds
244 .It Nm Ic device Ic rereplicate Ar filesystem
245 Walks existing data in a filesystem,
246 writing additional copies of any degraded data.
247 .El
248 .Sh Commands for encryption
249 .Bl -tag -width Ds
250 .It Nm Ic unlock Ar device
251 Unlock an encrypted filesystem prior to running/mounting.
252 .It Nm Ic set-passphrase Ar devices\ ...
253 Change passphrase on an existing (unmounted) filesystem.
254 .It Nm Ic remove-passphrase Ar devices\ ...
255 Remove passphrase on an existing (unmounted) filesystem.
256 .El
257 .Sh Commands for migration
258 .Bl -tag -width Ds
259 .It Nm Ic migrate Oo Ar options Oc Ar device
260 Migrate an existing filesystem to bcachefs
261 .Bl -tag -width Ds
262 .It Fl f Ar fs
263 Root of filesystem to migrate
264 .It Fl -encrypted
265 Enable whole filesystem encryption (chacha20/poly1305)
266 .It Fl -no_passphrase
267 Don't encrypt master encryption key
268 .It Fl F
269 Force, even if metadata file already exists
270 .El
271 .It Nm Ic migrate-superblock Oo Ar options Oc Ar device
272 Create default superblock after migrating
273 .Bl -tag -width Ds
274 .It Fl d Ar device
275 Device to create superblock for
276 .It Fl o Ar offset
277 Offset of existing superblock
278 .El
279 .El
280 .Sh Commands for debugging
281 These commands work on offline, unmounted filesystems.
282 .Bl -tag -width Ds
283 .It Nm Ic dump Oo Ar options Oc Ar device
284 Dump filesystem metadata
285 .Bl -tag -width Ds
286 .It Fl o Ar output
287 Required flag: Output qcow2 image(s)
288 .It Fl f
289 Force; overwrite when needed
290 .El
291 .It Nm Ic list Oo Ar options Oc Ar devices\ ...
292 List filesystem metadata to stdout
293 .Bl -tag -width Ds
294 .It Fl b ( Cm extents | inodes | dirents | xattrs )
295 Btree to list from
296 .It Fl s Ar inode Ns Cm \&: Ns Ar offset
297 Start position to list from
298 .It Fl e Ar inode Ns Cm \&: Ns Ar offset
299 End position
300 .It Fl i Ar inode
301 List keys for a given inode number
302 .It Fl m ( Cm keys | formats )
303 .It Fl f
304 Force fsck
305 .It Fl v
306 Verbose mode
307 List mode
308 .El
309 .El
310 .Sh Miscellaneous commands
311 .Bl -tag -width Ds
312 .It Nm Ic version
313 Display the version of the invoked bcachefs tool
314 .El
315 .Sh EXIT STATUS
316 .Ex -std