summaryrefslogtreecommitdiff
path: root/Documentation/btrfs-replace.8
blob: 95baf9c6fdcc3fe5155f3f053c5f734ffebca836 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
'\" t
.\"     Title: btrfs-replace
.\"    Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
.\"      Date: 12/05/2018
.\"    Manual: Btrfs Manual
.\"    Source: Btrfs v4.19.1
.\"  Language: English
.\"
.TH "BTRFS\-REPLACE" "8" "12/05/2018" "Btrfs v4\&.19\&.1" "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-replace \- replace devices managed by btrfs with other device\&.
.SH "SYNOPSIS"
.sp
\fBbtrfs replace\fR \fI<subcommand>\fR \fI<args>\fR
.SH "DESCRIPTION"
.sp
\fBbtrfs replace\fR is used to replace btrfs managed devices with other device\&.
.SH "SUBCOMMAND"
.PP
\fBcancel\fR \fI<mount_point>\fR
.RS 4
Cancel a running device replace operation\&.
.RE
.PP
\fBstart\fR [\-Bfr] \fI<srcdev>\fR|\fI<devid>\fR \fI<targetdev>\fR \fI<path>\fR
.RS 4
Replace device of a btrfs filesystem\&.
.sp
On a live filesystem, duplicate the data to the target device which is currently stored on the source device\&. If the source device is not available anymore, or if the \-r option is set, the data is built only using the RAID redundancy mechanisms\&. After completion of the operation, the source device is removed from the filesystem\&. If the
\fI<srcdev>\fR
is a numerical value, it is assumed to be the device id of the filesystem which is mounted at
\fI<path>\fR, otherwise it is the path to the source device\&. If the source device is disconnected, from the system, you have to use the devid parameter format\&. The
\fI<targetdev>\fR
needs to be same size or larger than the
\fI<srcdev>\fR\&.
.if n \{\
.sp
.\}
.RS 4
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBNote\fR
.ps -1
.br
the filesystem has to be resized to fully take advantage of a larger target device; this can be achieved with
\fBbtrfs filesystem resize <devid>:max /path\fR
.sp .5v
.RE
\fBOptions\fR
.PP
\-r
.RS 4
only read from
\fI<srcdev>\fR
if no other zero\-defect mirror exists\&. (enable this if your drive has lots of read errors, the access would be very slow)
.RE
.PP
\-f
.RS 4
force using and overwriting
\fI<targetdev>\fR
even if it looks like it contains a valid btrfs filesystem\&.
.sp
A valid filesystem is assumed if a btrfs superblock is found which contains a correct checksum\&. Devices that are currently mounted are never allowed to be used as the
\fI<targetdev>\fR\&.
.RE
.PP
\-B
.RS 4
no background replace\&.
.RE
.RE
.PP
\fBstatus\fR [\-1] \fI<mount_point>\fR
.RS 4
Print status and progress information of a running device replace operation\&.
.sp
\fBOptions\fR
.PP
\-1
.RS 4
print once instead of print continuously until the replace operation finishes (or is cancelled)
.RE
.RE
.SH "EXIT STATUS"
.sp
\fBbtrfs replace\fR returns a zero exit status if it succeeds\&. Non zero is returned in case of failure\&.
.SH "AVAILABILITY"
.sp
\fBbtrfs\fR is part of btrfs\-progs\&. Please refer to the btrfs wiki \m[blue]\fBhttp://btrfs\&.wiki\&.kernel\&.org\fR\m[] for further details\&.
.SH "SEE ALSO"
.sp
\fBmkfs\&.btrfs\fR(8), \fBbtrfs\-device\fR(8),