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