1BTRFS-IMAGE(8) Btrfs Manual BTRFS-IMAGE(8)
2
3
4
6 btrfs-image - create/restore an image of the filesystem
7
9 btrfs-image [options] <source> <target>
10
12 btrfs-image is used to create an image of a btrfs filesystem. All data
13 will be zeroed, but metadata and the like is preserved. Mainly used for
14 debugging purposes.
15
16 In the dump mode, source is the btrfs device/file and target is the
17 output file (use - for stdout).
18
19 In the restore mode (option -r), source is the dumped image and target
20 is the btrfs device/file.
21
23 -r
24 Restore metadump image. By default, this fixes super’s chunk tree,
25 by using 1 stripe pointing to primary device, so that file system
26 can be restored by running tree log reply if possible. To restore
27 without changing number of stripes in chunk tree check -o option.
28
29 -c <value>
30 Compression level (0 ~ 9).
31
32 -t <value>
33 Number of threads (1 ~ 32) to be used to process the image dump or
34 restore.
35
36 -o
37 Use the old restore method, this does not fixup the chunk tree so
38 the restored file system will not be able to be mounted.
39
40 -s
41 Sanitize the file names when generating the image. One -s means
42 just generate random garbage, which means that the directory
43 indexes won’t match up since the hashes won’t match with the
44 garbage filenames. Using -ss will calculate a collision for the
45 filename so that the hashes match, and if it can’t calculate a
46 collision then it will just generate garbage. The collision
47 calculator is very time and CPU intensive so only use it if you are
48 having problems with your file system tree and need to have it
49 mostly working.
50
51 -w
52 Walk all the trees manually and copy any blocks that are
53 referenced. Use this option if your extent tree is corrupted to
54 make sure that all of the metadata is captured.
55
56 -m
57 Restore for multiple devices, more than 1 device should be
58 provided.
59
61 btrfs-image will return 0 if no error happened. If any problems
62 happened, 1 will be returned.
63
65 mkfs.btrfs(8)
66
67
68
69Btrfs v5.10 01/18/2021 BTRFS-IMAGE(8)