btrfs-progs: doc: add missing newline in btrfs-convert
[platform/upstream/btrfs-progs.git] / Documentation / btrfs-convert.asciidoc
1 btrfs-convert(8)
2 ================
3
4 NAME
5 ----
6 btrfs-convert - convert from ext2/3/4 filesystem to btrfs
7
8 SYNOPSIS
9 --------
10 *btrfs-convert* [options] <device>
11
12 DESCRIPTION
13 -----------
14 *btrfs-convert* is used to convert existing ext2/3/4 filesystem image to a
15 btrfs filesystem in-place.  The original filesystem image is accessible
16 subvolume named 'ext2_saved' as file 'image'.
17
18 WARNING: If you are going to perform rollback to ext2/3/4, you should not
19 execute *btrfs balance* command on the converted filesystem. This will change
20 the extent layout and make *btrfs-convert* unable to rollback.
21
22 The conversion utilizes free space of the original filesystem. The exact
23 estimate of the required space cannot be foretold. The final btrfs metadata
24 might occupy several gigabytes on a hundreds-gigabyte filesystem.
25
26 If you decide not to rollback anymore, it is recommended to perform a few more
27 steps to transform the btrfs filesystem to a more compact layout. The
28 conversion inherits the original data block fragmentation and the metadata
29 blocks are bound to the original free space layout.
30
31 **REMOVE THE ORIGINAL FILESYSTEM METADATA**
32
33 By removing the 'ext2_saved' subvolume, all metadata of the original filesystem
34 will be removed:
35
36    # btrfs subvolume delete /mnt/ext2_saved
37
38 At this point it's not possible to do rollback. The filesystem is usable but may
39 be impacted by the fragmentation.
40
41 **MAKE FILE DATA MORE CONTIGUOUS**
42
43 An optional but recommended step is to run defragmentation on the entire
44 filesystem. This will attempt to make file extents more contiguous.
45
46    # btrfs filesystem defrag -v -r -f -t 32M /mnt/btrfs
47
48 Verbose recursive defragmentation ('-v', '-r'), flush data per-file ('-f') with target
49 extent size 32M ('-t').
50
51 **ATTEMPT TO MAKE BTRFS METADATA MORE COMPACT**
52
53 Optional but recommended step.
54
55 The metadata block groups after conversion may be smaller than the default size
56 (256MiB or 1GiB). Running a balance will attempt to merge the block groups.
57 This depends on the free space layout (and fragmentation) and may fail. This is
58 a soft error leaving the filesystem usable but the block group layout may
59 remain unchanged.
60
61 Note that balance operation takes a lot of time.
62
63    # btrfs balance start -m /mnt/btrfs
64
65 OPTIONS
66 -------
67 -d|--no-datasum::
68 disable data checksum calculations and set NODATASUM file flag, this can speed
69 up the conversion
70 -i|--no-xattr::
71 ignore xattrs and ACLs of files
72 -n|--no-inline::
73 disable inlining of small files to metadata blocks, this will decrease the metadata
74 consumption and may help to convert a filesystem with low free space
75 -N|--nodesize <SIZE>::
76 set filesystem nodesize, the tree block size in which btrfs stores its metadata.
77 The default value is 16KB (16384) or the page size, whichever is bigger.
78 Must be a multiple of the sectorsize, but not larger than 65536. See
79 `mkfs.btrfs`(8) for more details.
80 -r|--rollback::
81 rollback to the original ext2/3/4 filesystem if possible
82 -l|--label <LABEL>::
83 set filesystem label during conversion
84 -L|--copy-label::
85 use label from the converted filesystem
86 -O|--features <feature1>[,<feature2>...]::
87 A list of filesystem features turned on at btrfs-convert time. Not all features
88 are supported by old kernels. To disable a feature, prefix it with '^'.
89 +
90 To see all available features that btrfs-convert supports run:
91 +
92 +btrfs-convert -O list-all+
93 +
94 -p|--progress::
95 show progress of conversion, on by default
96 --no-progress::
97 disable detailed progress and show only the main phases of conversion
98
99 EXIT STATUS
100 -----------
101 *btrfs-convert* will return 0 if no error happened.
102 If any problems happened, 1 will be returned.
103
104 SEE ALSO
105 --------
106 `mkfs.btrfs`(8)