1BTRFS-IMAGE(8) BTRFS 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
14 for 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 Restore metadump image. By default, this fixes super's chunk
24 tree, by using 1 stripe pointing to primary device, so that file
25 system can be restored by running tree log reply if possible. To
26 restore without changing number of stripes in chunk tree check
27 -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
34 or restore.
35
36 -o Use the old restore method, this does not fixup the chunk tree
37 so the restored file system will not be able to be mounted.
38
39 -s Sanitize the file names when generating the image. One -s means
40 just generate random garbage, which means that the directory in‐
41 dexes won't match up since the hashes won't match with the
42 garbage filenames. Using -ss will calculate a collision for the
43 filename so that the hashes match, and if it can't calculate a
44 collision then it will just generate garbage. The collision
45 calculator is very time and CPU intensive so only use it if you
46 are having problems with your file system tree and need to have
47 it mostly working.
48
49 -w Walk all the trees manually and copy any blocks that are refer‐
50 enced. Use this option if your extent tree is corrupted to make
51 sure that all of the metadata is captured.
52
53 -m Restore for multiple devices, more than 1 device should be pro‐
54 vided.
55
57 btrfs-image will return 0 if no error happened. If any problems hap‐
58 pened, 1 will be returned.
59
61 mkfs.btrfs(8)
62
64 2022
65
66
67
68
695.18 May 25, 2022 BTRFS-IMAGE(8)