From 7e08a9116d9d692e0e298197de55b6b5505373bf Mon Sep 17 00:00:00 2001 From: Stefan Behrens Date: Mon, 7 May 2012 14:00:20 +0200 Subject: Btrfs-progs: add support for device replace procedure This is the user mode part of the device replace patch series. The command group "btrfs replace" is added with three commands: - btrfs replace start srcdev|srcdevid targetdev [-Bfr] mount_point - btrfs replace status mount_point [-1] - btrfs replace cancel mount_point Signed-off-by: Stefan Behrens --- man/btrfs.8.in | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) (limited to 'man') diff --git a/man/btrfs.8.in b/man/btrfs.8.in index 460592eb..5f017f8a 100644 --- a/man/btrfs.8.in +++ b/man/btrfs.8.in @@ -39,6 +39,12 @@ btrfs \- control a btrfs filesystem .PP \fBbtrfs\fP \fBdevice delete\fP\fI [...] \fP .PP +\fBbtrfs\fP \fBreplace start\fP \fI[-Bfr] | \fP +.PP +\fBbtrfs\fP \fBreplace status\fP \fI[-1] \fP +.PP +\fBbtrfs\fP \fBreplace cancel\fP \fI\fP +.PP \fBbtrfs\fP \fBscrub start\fP [-Bdqru] {\fI\fP|\fI\fP} .PP \fBbtrfs\fP \fBscrub cancel\fP {\fI\fP|\fI\fP} @@ -282,6 +288,54 @@ Finally, if \fB--all-devices\fP is passed, all the devices under /dev are scanned. .TP +\fBreplace start\fR \fI[-Bfr] | \fR +Replace device of a btrfs filesystem. +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 \fB-r\fR 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 \fIsrcdev\fR is a numerical value, it is assumed to be the device id +of the filesystem which is mounted at mount_point, otherwise is is +the path to the source device. If the source device is disconnected, +from the system, you have to use the \fIdevid\fR parameter format. +The targetdev needs to be same size or larger than the \fIsrcdev\fR. + +.RS +\fIOptions\fR +.TP +.B -r +only read from \fIsrcdev\fR if no other zero-defect mirror exists (enable +this if your drive has lots of read errors, the access would be very slow) +.TP +.B -f +force using and overwriting \fItargetdev\fR even if it looks like +containing a valid btrfs filesystem. A valid filesystem is +assumed if a btrfs superblock is found which contains a +correct checksum. Devices which are currently mounted are +never allowed to be used as the \fItargetdev\fR +.TP +.B -B +do not background +.RE +.TP + +\fBreplace status\fR \fI[-1] \fR +Print status and progress information of a running device replace operation. + +.RS +\fIOptions\fR +.TP +.B -1 +print once instead of print continously until the replace +operation finishes (or is canceled) +.RE +.TP + +\fBreplace cancel\fR \fI\fR +Cancel a running device replace operation. +.TP + \fBscrub start\fP [-Bdqru] {\fI\fP|\fI\fP} Start a scrub on all devices of the filesystem identified by \fI\fR or on a single \fI\fR. Without options, scrub is started as a background -- cgit v1.2.3