'\" t .\" Title: btrfs-convert .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 09/22/2016 .\" Manual: Btrfs Manual .\" Source: Btrfs v4.7.3 .\" Language: English .\" .TH "BTRFS\-CONVERT" "8" "09/22/2016" "Btrfs v4\&.7\&.3" "Btrfs Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" btrfs-convert \- convert from ext2/3/4 filesystem to btrfs in\-place .SH "SYNOPSIS" .sp \fBbtrfs\-convert\fR [options] \fI\fR .SH "DESCRIPTION" .sp \fBbtrfs\-convert\fR is used to convert existing ext2/3/4 filesystem image to a btrfs filesystem in\-place\&. The original filesystem image is accessible subvolume named \fIext2_saved\fR as file \fIimage\fR\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBWarning\fR .ps -1 .br .sp If you are going to perform rollback to ext2/3/4, you should not execute \fBbtrfs balance\fR command on the converted filesystem\&. This will change the extent layout and make \fBbtrfs\-convert\fR unable to rollback\&. .sp .5v .RE .sp The conversion utilizes free space of the original filesystem\&. The exact estimate of the required space cannot be foretold\&. The final btrfs metadata might occupy several gigabytes on a hundreds\-gigabyte filesystem\&. .sp If you decide not to rollback anymore, it is recommended to perform a few more steps to transform the btrfs filesystem to a more compact layout\&. The conversion inherits the original data block fragmentation and the metadata blocks are bound to the original free space layout\&. .sp Due to different constraints, it\(cqs possible to convert only filesystem that have supported data block size (ie\&. the same that would be valid for \fImkfs\&.btrfs\fR)\&. This is typically the system page size (4KiB on x86_64 machines)\&. .sp \fBREMOVE THE ORIGINAL FILESYSTEM METADATA\fR .sp By removing the \fIext2_saved\fR subvolume, all metadata of the original filesystem will be removed: .sp .if n \{\ .RS 4 .\} .nf # btrfs subvolume delete /mnt/ext2_saved .fi .if n \{\ .RE .\} .sp At this point it\(cqs not possible to do rollback\&. The filesystem is usable but may be impacted by the fragmentation inherited from the original filesystem\&. .sp \fBMAKE FILE DATA MORE CONTIGUOUS\fR .sp An optional but recommended step is to run defragmentation on the entire filesystem\&. This will attempt to make file extents more contiguous\&. .sp .if n \{\ .RS 4 .\} .nf # btrfs filesystem defrag \-v \-r \-f \-t 32M /mnt/btrfs .fi .if n \{\ .RE .\} .sp Verbose recursive defragmentation (\fI\-v\fR, \fI\-r\fR), flush data per\-file (\fI\-f\fR) with target extent size 32MiB (\fI\-t\fR)\&. .sp \fBATTEMPT TO MAKE BTRFS METADATA MORE COMPACT\fR .sp Optional but recommended step\&. .sp The metadata block groups after conversion may be smaller than the default size (256MiB or 1GiB)\&. Running a balance will attempt to merge the block groups\&. This depends on the free space layout (and fragmentation) and may fail due to lack of enough work space\&. This is a soft error leaving the filesystem usable but the block group layout may remain unchanged\&. .sp Note that balance operation takes a lot of time, please see also \fBbtrfs\-balance\fR(8)\&. .sp .if n \{\ .RS 4 .\} .nf # btrfs balance start \-m /mnt/btrfs .fi .if n \{\ .RE .\} .SH "OPTIONS" .PP \-d|\-\-no\-datasum .RS 4 disable data checksum calculations and set the NODATASUM file flag, this can speed up the conversion .RE .PP \-i|\-\-no\-xattr .RS 4 ignore xattrs and ACLs of files .RE .PP \-n|\-\-no\-inline .RS 4 disable inlining of small files to metadata blocks, this will decrease the metadata consumption and may help to convert a filesystem with low free space .RE .PP \-N|\-\-nodesize \fI\fR .RS 4 set filesystem nodesize, the tree block size in which btrfs stores its metadata\&. The default value is 16KB (16384) or the page size, whichever is bigger\&. Must be a multiple of the sectorsize, but not larger than 65536\&. See \fBmkfs\&.btrfs\fR(8) for more details\&. .RE .PP \-r|\-\-rollback .RS 4 rollback to the original ext2/3/4 filesystem if possible .RE .PP \-l|\-\-label \fI