'\" t .\" Title: btrfs-device .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.76.1 .\" Date: 06/20/2015 .\" Manual: Btrfs Manual .\" Source: Btrfs v3.17 .\" Language: English .\" .TH "BTRFS\-DEVICE" "8" "06/20/2015" "Btrfs v3\&.17" "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-device \- control btrfs devices .SH "SYNOPSIS" .sp \fBbtrfs device\fR \fI\fR \fI\fR .SH "DESCRIPTION" .sp \fBbtrfs device\fR is used to control the btrfs devices, since btrfs can be used across several devices, \fBbtrfs device\fR is used for multiple device management\&. .SH "DEVICE MANAGEMENT" .sp Btrfs filesystem is capable to manage multiple devices\&. .sp Btrfs filesystem uses different profiles to manage different RAID level, and use balance to rebuild chunks, also devices can be added/removed/replace online\&. .PP Profile .RS 4 Btrfs filesystem uses data/metadata profiles to manage allocation/duplication mechanism\&. Profiles like RAID level can be assigned to data and metadata separately\&. .sp See \fBmkfs\&.btrfs\fR(8) for more details\&. .RE .PP RAID level .RS 4 Btrfs filesystem supports most of the standard RAID level: 0/1/5/6/10\&. RAID levels can be assigned at mkfs time or online\&. .sp See \fBmkfs\&.btrfs\fR(8) for mkfs time RAID level assign and \fBbtrfs\-balance\fR(8) for online RAID level assign\&. .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 Since btrfs is under heavy development especially the RAID5/6 support, it is \fBhighly\fR recommended to read the follow btrfs wiki page to get more updated details on RAID5/6: \m[blue]\fBhttps://btrfs\&.wiki\&.kernel\&.org/index\&.php/RAID56\fR\m[] .sp .5v .RE .RE .PP Balance .RS 4 \fBbtrfs\-balance\fR(8) subcommand can be used to balance or rebuild chunks to the desired profile\&. .sp Due to the fact that balance can rebuild/recovery chunks according to its RAID duplication if possible, so when using RAID1/5/6/10 with some devices failed and you just added a new device to btrfs using \fBbtrfs\-device\fR(8), you should run \fBbtrfs\-balance\fR(8) to rebuild the chunks\&. .sp See \fBbtrfs\-balance\fR(8) for more details\&. .RE .PP Device add/remove/replace .RS 4 Device can be added/removed using \fBbtrfs\-replace\fR(8) subcommand and replaced using \fBbtrfs\-replace\fR(8)\&. .sp When device is removed or replaced, btrfs will do the chunk rebuild if needed\&. .sp See \fBbtrfs\-replace\fR(8) and this man page for more details\&. .RE .SH "SUBCOMMAND" .PP \fBadd\fR [\-Kf] \fI\fR [\fI\fR\&...] \fI\fR .RS 4 Add device(s) to the filesystem identified by \fI\fR\&. .sp If applicable, a whole device discard (TRIM) operation is performed\&. .sp \fBOptions\fR .PP \-K|\-\-nodiscard .RS 4 do not perform discard by default .RE .PP \-f|\-\-force .RS 4 force overwrite of existing filesystem on the given disk(s) .RE .RE .PP \fBdelete\fR \fI\fR [\fI\fR\&...] \fI\fR .RS 4 Remove device(s) from a filesystem identified by \fI\fR\&. .RE .PP \fBscan\fR [(\-\-all\-devices|\-d)|\fI\fR [\fI\fR\&...]] .RS 4 Scan devices for a btrfs filesystem\&. .sp If one or more devices are passed, these are scanned for a btrfs filesystem\&. If no devices are passed, btrfs uses block devices containing btrfs filesystem as listed by blkid\&. Finally, if \fI\-\-all\-devices\fR or \fI\-d\fR is passed, all the devices under /dev are scanned\&. .RE .PP \fBready\fR \fI\fR .RS 4 Check device to see if it has all of it\(cqs devices in cache for mounting\&. .RE .PP \fBstats\fR [\-z] \fI\fR|\fI\fR .RS 4 Read and print the device IO stats for all devices of the filesystem identified by \fI\fR or for a single \fI\fR\&. .sp \fBOptions\fR .PP \-z .RS 4 Reset stats to zero after reading them\&. .RE .RE .SH "EXIT STATUS" .sp \fBbtrfs device\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\-replace\fR(8), \fBbtrfs\-balance\fR(8)