btrfs-progs: docs: fix typo in btrfs-scrub manual page
[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 in-place
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 Due to different constraints, it's possible to convert only filesystem that
32 have supported data block size (ie. the same that would be valid for
33 'mkfs.btrfs'). This is typically the system page size (4KiB on x86_64
34 machines).
35
36 NOTE: The source filesystem should be clean, you are encouraged to run the
37 'fsck' tool if you're not sure.
38
39 **REMOVE THE ORIGINAL FILESYSTEM METADATA**
40
41 By removing the 'ext2_saved' subvolume, all metadata of the original filesystem
42 will be removed:
43
44    # btrfs subvolume delete /mnt/ext2_saved
45
46 At this point it's not possible to do rollback. The filesystem is usable but may
47 be impacted by the fragmentation inherited from the original filesystem.
48
49 **MAKE FILE DATA MORE CONTIGUOUS**
50
51 An optional but recommended step is to run defragmentation on the entire
52 filesystem. This will attempt to make file extents more contiguous.
53
54    # btrfs filesystem defrag -v -r -f -t 32M /mnt/btrfs
55
56 Verbose recursive defragmentation ('-v', '-r'), flush data per-file ('-f') with
57 target extent size 32MiB ('-t').
58
59 **ATTEMPT TO MAKE BTRFS METADATA MORE COMPACT**
60
61 Optional but recommended step.
62
63 The metadata block groups after conversion may be smaller than the default size
64 (256MiB or 1GiB). Running a balance will attempt to merge the block groups.
65 This depends on the free space layout (and fragmentation) and may fail due to
66 lack of enough work space. This is a soft error leaving the filesystem usable
67 but the block group layout may remain unchanged.
68
69 Note that balance operation takes a lot of time, please see also
70 `btrfs-balance`(8).
71
72    # btrfs balance start -m /mnt/btrfs
73
74 OPTIONS
75 -------
76 -d|--no-datasum::
77 disable data checksum calculations and set the NODATASUM file flag, this can speed
78 up the conversion
79 -i|--no-xattr::
80 ignore xattrs and ACLs of files
81 -n|--no-inline::
82 disable inlining of small files to metadata blocks, this will decrease the metadata
83 consumption and may help to convert a filesystem with low free space
84 -N|--nodesize <SIZE>::
85 set filesystem nodesize, the tree block size in which btrfs stores its metadata.
86 The default value is 16KB (16384) or the page size, whichever is bigger.
87 Must be a multiple of the sectorsize, but not larger than 65536. See
88 `mkfs.btrfs`(8) for more details.
89 -r|--rollback::
90 rollback to the original ext2/3/4 filesystem if possible
91 -l|--label <LABEL>::
92 set filesystem label during conversion
93 -L|--copy-label::
94 use label from the converted filesystem
95 -O|--features <feature1>[,<feature2>...]::
96 A list of filesystem features turned on at conversion time. Not all features
97 are supported by old kernels. To disable a feature, prefix it with '^'.
98 Description of the features is in section 'FILESYSTEM FEATURES' of
99 `mkfs.btrfs`(8).
100 +
101 To see all available features that btrfs-convert supports run:
102 +
103 +btrfs-convert -O list-all+
104 +
105 -p|--progress::
106 show progress of conversion (a heartbeat indicator and number of inodes
107 processed), on by default
108 --no-progress::
109 disable progress and show only the main phases of conversion
110
111 EXIT STATUS
112 -----------
113 *btrfs-convert* will return 0 if no error happened.
114 If any problems happened, 1 will be returned.
115
116 SEE ALSO
117 --------
118 `mkfs.btrfs`(8)