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