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