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