Manpage/btrfs-device

From btrfs Wiki
(Difference between revisions)
Jump to: navigation, search
(Update from git, v4.4)
(Update from git, v4.5.3)
Line 1: Line 1:
=btrfs-device(8) Manual Page=
+
=btrfs-device(8)=
 
{{GeneratedManpage
 
{{GeneratedManpage
 
|name=btrfs-device}}
 
|name=btrfs-device}}
  
 
==NAME==
 
==NAME==
 
 
btrfs-device - control btrfs devices
 
btrfs-device - control btrfs devices
  
 
==SYNOPSIS==
 
==SYNOPSIS==
  
'''btrfs device''' <subcommand> <args>
+
<p><b>btrfs device</b> <emphasis>&lt;subcommand&gt;</emphasis> <emphasis>&lt;args&gt;</emphasis></p>
 
+
 
==DESCRIPTION==
 
==DESCRIPTION==
  
'''btrfs device''' is used to control the btrfs devices, since btrfs can be used across several devices, '''btrfs device''' is used for multiple device management.
+
<p><b>btrfs device</b> is used to control the btrfs devices, since btrfs can be used
 
+
across several devices, <b>btrfs device</b> is used for multiple device management.</p>
 
==DEVICE MANAGEMENT==
 
==DEVICE MANAGEMENT==
  
Btrfs filesystem is capable to manage multiple devices.
+
<p>Btrfs filesystem is capable to manage multiple devices.</p>
 +
<p>Btrfs filesystem uses different profiles to manage different RAID level, and
 +
use balance to rebuild chunks, also devices can be added/removed/replace
 +
online.</p>
 +
<dl>
 +
<dt>
 +
Profile
 +
<dd>
 +
<p>
 +
Btrfs filesystem uses data/metadata profiles to manage allocation/duplication
 +
mechanism.<text:line-break/>
 +
Profiles like RAID level can be assigned to data and metadata separately.
 +
</p>
 +
<p>See [[Manpage/mkfs.btrfs|mkfs.btrfs(8)]] for more details.</p>
  
Btrfs filesystem uses different profiles to manage different RAID level, and use balance to rebuild chunks, also devices can be added/removed/replace online.
+
<dt>
 +
RAID level
 +
<dd>
 +
<p>
 +
Btrfs filesystem supports most of the standard RAID level: 0/1/5/6/10.<text:line-break/>
 +
RAID levels can be assigned at mkfs time or online.
 +
</p>
 +
<p>See [[Manpage/mkfs.btrfs|mkfs.btrfs(8)]] for mkfs time RAID level assign and [[Manpage/btrfs-balance|btrfs-balance(8)]] for
 +
online RAID level assign.</p>
 +
<blockquote><b>Note:</b>
 +
Since btrfs is under heavy development especially the RAID5/6 support,
 +
it is <b>highly</b> recommended to read the follow btrfs wiki page to get more
 +
updated details on RAID5/6:<text:line-break/>
 +
https://btrfs.wiki.kernel.org/index.php/RAID56</blockquote>
  
; Profile
+
<dt>
: Btrfs filesystem uses data/metadata profiles to manage allocation/duplication mechanism.<br /> Profiles like RAID level can be assigned to data and metadata separately. <br />See [[Manpage/mkfs.btrfs|mkfs.btrfs(8)]] for more details.
+
Balance
; RAID level
+
<dd>
: Btrfs filesystem supports most of the standard RAID level: 0/1/5/6/10.<br /> RAID levels can be assigned at mkfs time or online. <br />See [[Manpage/mkfs.btrfs|mkfs.btrfs(8)]] for mkfs time RAID level assign and [[Manpage/btrfs-balance|btrfs-balance(8)]] for online RAID level assign. <br />'''Note:''' Since btrfs is under heavy development especially the RAID5/6 support, it is '''highly''' recommended to read the follow btrfs wiki page to get more updated details on RAID5/6:<br />https://btrfs.wiki.kernel.org/index.php/RAID56
+
<p>
; Balance
+
[[Manpage/btrfs-balance|btrfs-balance(8)]] subcommand can be used to balance or rebuild chunks to the
: [[Manpage/btrfs-balance|btrfs-balance(8)]] subcommand can be used to balance or rebuild chunks to the desired profile. <br />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 [[Manpage/btrfs-device|btrfs-device(8)]], you should run [[Manpage/btrfs-balance|btrfs-balance(8)]] to rebuild the chunks. <br />See [[Manpage/btrfs-balance|btrfs-balance(8)]] for more details.
+
desired profile.
; Device add/remove/replace
+
</p>
: Device can be added/removed using [[Manpage/btrfs-device|btrfs-device(8)]] subcommand and replaced using [[Manpage/btrfs-replace|btrfs-replace(8)]]. <br />When device is removed or replaced, btrfs will do the chunk rebuild if needed. <br />See [[Manpage/btrfs-replace|btrfs-replace(8)]] man page for more details on device replace.
+
<p>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 [[Manpage/btrfs-device|btrfs-device(8)]], you should
 +
run [[Manpage/btrfs-balance|btrfs-balance(8)]] to rebuild the chunks.</p>
 +
<p>See [[Manpage/btrfs-balance|btrfs-balance(8)]] for more details.</p>
  
 +
<dt>
 +
Device add/remove/replace
 +
<dd>
 +
<p>
 +
Device can be added/removed using [[Manpage/btrfs-device|btrfs-device(8)]] subcommand and replaced
 +
using [[Manpage/btrfs-replace|btrfs-replace(8)]].
 +
</p>
 +
<p>When device is removed or replaced, btrfs will do the chunk rebuild if needed.</p>
 +
<p>See [[Manpage/btrfs-replace|btrfs-replace(8)]] man page for more details on device replace.</p>
 +
 +
</dl>
 
==SUBCOMMAND==
 
==SUBCOMMAND==
  
; '''add''' [-Kf] &lt;dev&gt; [&lt;dev&gt;] &lt;path&gt;
+
<dl>
: Add device(s) to the filesystem identified by &lt;path&gt;. <br />If applicable, a whole device discard (TRIM) operation is performed. <br /><code>Options</code> <br />
+
<dt>
:; -K|--nodiscard
+
<b>add</b> [-Kf] <emphasis>&lt;dev&gt;</emphasis> [<emphasis>&lt;dev&gt;</emphasis>&#8230;] <emphasis>&lt;path&gt;</emphasis>
:: do not perform discard by default
+
<dd>
:; -f|--force
+
<p>
:: force overwrite of existing filesystem on the given disk(s)
+
Add device(s) to the filesystem identified by <emphasis>&lt;path&gt;</emphasis>.
; '''remove''' &lt;dev&gt; [&lt;dev&gt;…] &lt;path&gt;
+
</p>
: Remove device(s) from a filesystem identified by &lt;path&gt;.
+
<p>If applicable, a whole device discard (TRIM) operation is performed.</p>
; '''delete''' &lt;dev&gt; [&lt;dev&gt;…] &lt;path&gt;
+
<p><tt>Options</tt></p>
: Alias of remove kept for backwards compatability
+
<dl>
; '''ready''' &lt;device&gt;
+
<dt>
: Check device to see if it has all of it’s devices in cache for mounting.
+
-K|--nodiscard
; '''scan''' [(--all-devices|-d)|&lt;device&gt; [&lt;device&gt;…]]
+
<dd>
: Scan devices for a btrfs filesystem. <br />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 '''--all-devices''' or '''-d''' is passed, all the devices under /dev are scanned.
+
<p>
; '''stats''' [-z] &lt;path&gt;|&lt;device&gt;
+
do not perform discard by default
: Read and print the device IO stats for all mounted devices of the filesystem identified by &lt;path&gt; or for a single &lt;device&gt;. <br /><code>Options</code> <br />
+
</p>
:; -z
+
:: Reset stats to zero after reading them.
+
; '''usage''' [options] &lt;path&gt; [&lt;path&gt;…]
+
: Show detailed information about internal allocations in devices. <br /><code>Options</code> <br />
+
:; -b|--raw
+
:: raw numbers in bytes, without the '''B''' suffix
+
:; -h|--human-readable
+
:: print human friendly numbers, base 1024, this is the default
+
:; -H
+
:: print human friendly numbers, base 1000
+
:; --iec
+
:: select the 1024 base for the following options, according to the IEC standard
+
:; --si
+
:: select the 1000 base for the following options, according to the SI standard
+
:; -k|--kbytes
+
:: show sizes in KiB, or kB with --si
+
:; -m|--mbytes
+
:: show sizes in MiB, or MB with --si
+
:; -g|--gbytes
+
:: show sizes in GiB, or GB with --si
+
:; -t|--tbytes
+
:: show sizes in TiB, or TB with --si
+
  
If conflicting options are passed, the last one takes precedence.
+
<dt>
 +
-f|--force
 +
<dd>
 +
<p>
 +
force overwrite of existing filesystem on the given disk(s)
 +
</p>
  
==EXIT STATUS==
+
</dl>
  
'''btrfs device''' returns a zero exit status if it succeeds. Non zero is returned in case of failure.
+
<dt>
 +
<b>remove</b> <emphasis>&lt;dev&gt;</emphasis>|<emphasis>&lt;devid&gt;</emphasis> [<emphasis>&lt;dev&gt;</emphasis>|<emphasis>&lt;devid&gt;</emphasis>&#8230;] <emphasis>&lt;path&gt;</emphasis>
 +
<dd>
 +
<p>
 +
Remove device(s) from a filesystem identified by <emphasis>&lt;path&gt;</emphasis>.
 +
</p>
  
==AVAILABILITY==
+
<dt>
 +
<b>delete</b> <emphasis>&lt;dev&gt;</emphasis>|<emphasis>&lt;devid&gt;</emphasis> [<emphasis>&lt;dev&gt;</emphasis>|<emphasis>&lt;devid&gt;</emphasis>&#8230;] <emphasis>&lt;path&gt;</emphasis>
 +
<dd>
 +
<p>
 +
Alias of remove kept for backward compatibility
 +
</p>
  
'''btrfs''' is part of btrfs-progs. Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for further details.
+
<dt>
 +
<b>ready</b> <emphasis>&lt;device&gt;</emphasis>
 +
<dd>
 +
<p>
 +
Check device to see if it has all of it&#8217;s devices in cache for mounting.
 +
</p>
  
==SEE ALSO==
+
<dt>
 +
<b>scan</b> [(--all-devices|-d)|<emphasis>&lt;device&gt;</emphasis> [<emphasis>&lt;device&gt;</emphasis>&#8230;]]
 +
<dd>
 +
<p>
 +
Scan devices for a btrfs filesystem.
 +
</p>
 +
<p>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, <em>--all-devices</em> or <em>-d</em> is the deprecated option. If it is passed,
 +
its behavior is the same as if no devices are passed.</p>
  
[[Manpage/mkfs.btrfs|mkfs.btrfs(8)]], [[Manpage/btrfs-replace|btrfs-replace(8)]], [[Manpage/btrfs-balance|btrfs-balance(8)]]
+
<dt>
 +
<b>stats</b> [-z] <emphasis>&lt;path&gt;</emphasis>|<emphasis>&lt;device&gt;</emphasis>
 +
<dd>
 +
<p>
 +
Read and print the device IO stats for all mounted devices of the filesystem
 +
identified by <emphasis>&lt;path&gt;</emphasis> or for a single <emphasis>&lt;device&gt;</emphasis>.
 +
</p>
 +
<p><tt>Options</tt></p>
 +
<dl>
 +
<dt>
 +
-z
 +
<dd>
 +
<p>
 +
Reset stats to zero after reading them.
 +
</p>
 +
 
 +
</dl>
 +
 
 +
<dt>
 +
<b>usage</b> [options] <emphasis>&lt;path&gt;</emphasis> [<emphasis>&lt;path&gt;</emphasis>&#8230;]
 +
<dd>
 +
<p>
 +
Show detailed information about internal allocations in devices.
 +
</p>
 +
<p><tt>Options</tt></p>
 +
<dl>
 +
<dt>
 +
-b|--raw
 +
<dd>
 +
<p>
 +
raw numbers in bytes, without the <em>B</em> suffix
 +
</p>
 +
 
 +
<dt>
 +
-h|--human-readable
 +
<dd>
 +
<p>
 +
print human friendly numbers, base 1024, this is the default
 +
</p>
 +
 
 +
<dt>
 +
-H
 +
<dd>
 +
<p>
 +
print human friendly numbers, base 1000
 +
</p>
 +
 
 +
<dt>
 +
--iec
 +
<dd>
 +
<p>
 +
select the 1024 base for the following options, according to the IEC standard
 +
</p>
 +
 
 +
<dt>
 +
--si
 +
<dd>
 +
<p>
 +
select the 1000 base for the following options, according to the SI standard
 +
</p>
 +
 
 +
<dt>
 +
-k|--kbytes
 +
<dd>
 +
<p>
 +
show sizes in KiB, or kB with --si
 +
</p>
 +
 
 +
<dt>
 +
-m|--mbytes
 +
<dd>
 +
<p>
 +
show sizes in MiB, or MB with --si
 +
</p>
 +
 
 +
<dt>
 +
-g|--gbytes
 +
<dd>
 +
<p>
 +
show sizes in GiB, or GB with --si
 +
</p>
 +
 
 +
<dt>
 +
-t|--tbytes
 +
<dd>
 +
<p>
 +
show sizes in TiB, or TB with --si
 +
</p>
 +
 
 +
</dl>
 +
 
 +
</dl>
 +
<p>If conflicting options are passed, the last one takes precedence.</p>
 +
==EXIT STATUS==
 +
 
 +
<p><b>btrfs device</b> returns a zero exit status if it succeeds. Non zero is
 +
returned in case of failure.</p>
 +
==AVAILABILITY==
 +
 
 +
<p><b>btrfs</b> is part of btrfs-progs.
 +
Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for
 +
further details.</p>
 +
==SEE ALSO==
  
 +
<p>[[Manpage/mkfs.btrfs|mkfs.btrfs(8)]],
 +
[[Manpage/btrfs-replace|btrfs-replace(8)]],
 +
[[Manpage/btrfs-balance|btrfs-balance(8)]]</p>
 
[[Category:Manpage]]
 
[[Category:Manpage]]

Revision as of 10:07, 20 May 2016

Contents

btrfs-device(8)

Note: manual pages are located at read-the-docs site, please update your links.



NAME

btrfs-device - control btrfs devices

SYNOPSIS

btrfs device <emphasis><subcommand></emphasis> <emphasis><args></emphasis>

DESCRIPTION

btrfs device is used to control the btrfs devices, since btrfs can be used across several devices, btrfs device is used for multiple device management.

DEVICE MANAGEMENT

Btrfs filesystem is capable to manage multiple devices.

Btrfs filesystem uses different profiles to manage different RAID level, and use balance to rebuild chunks, also devices can be added/removed/replace online.

Profile

Btrfs filesystem uses data/metadata profiles to manage allocation/duplication mechanism.<text:line-break/> Profiles like RAID level can be assigned to data and metadata separately.

See mkfs.btrfs(8) for more details.

RAID level

Btrfs filesystem supports most of the standard RAID level: 0/1/5/6/10.<text:line-break/> RAID levels can be assigned at mkfs time or online.

See mkfs.btrfs(8) for mkfs time RAID level assign and btrfs-balance(8) for online RAID level assign.

Note: Since btrfs is under heavy development especially the RAID5/6 support, it is highly recommended to read the follow btrfs wiki page to get more updated details on RAID5/6:<text:line-break/> https://btrfs.wiki.kernel.org/index.php/RAID56

Balance

btrfs-balance(8) subcommand can be used to balance or rebuild chunks to the desired profile.

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 btrfs-device(8), you should run btrfs-balance(8) to rebuild the chunks.

See btrfs-balance(8) for more details.

Device add/remove/replace

Device can be added/removed using btrfs-device(8) subcommand and replaced using btrfs-replace(8).

When device is removed or replaced, btrfs will do the chunk rebuild if needed.

See btrfs-replace(8) man page for more details on device replace.

SUBCOMMAND

add [-Kf] <emphasis><dev></emphasis> [<emphasis><dev></emphasis>…] <emphasis><path></emphasis>

Add device(s) to the filesystem identified by <emphasis><path></emphasis>.

If applicable, a whole device discard (TRIM) operation is performed.

Options

-K|--nodiscard

do not perform discard by default

-f|--force

force overwrite of existing filesystem on the given disk(s)

remove <emphasis><dev></emphasis>|<emphasis><devid></emphasis> [<emphasis><dev></emphasis>|<emphasis><devid></emphasis>…] <emphasis><path></emphasis>

Remove device(s) from a filesystem identified by <emphasis><path></emphasis>.

delete <emphasis><dev></emphasis>|<emphasis><devid></emphasis> [<emphasis><dev></emphasis>|<emphasis><devid></emphasis>…] <emphasis><path></emphasis>

Alias of remove kept for backward compatibility

ready <emphasis><device></emphasis>

Check device to see if it has all of it’s devices in cache for mounting.

scan [(--all-devices|-d)|<emphasis><device></emphasis> [<emphasis><device></emphasis>…]]

Scan devices for a btrfs filesystem.

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, --all-devices or -d is the deprecated option. If it is passed, its behavior is the same as if no devices are passed.

stats [-z] <emphasis><path></emphasis>|<emphasis><device></emphasis>

Read and print the device IO stats for all mounted devices of the filesystem identified by <emphasis><path></emphasis> or for a single <emphasis><device></emphasis>.

Options

-z

Reset stats to zero after reading them.

usage [options] <emphasis><path></emphasis> [<emphasis><path></emphasis>…]

Show detailed information about internal allocations in devices.

Options

-b|--raw

raw numbers in bytes, without the B suffix

-h|--human-readable

print human friendly numbers, base 1024, this is the default

-H

print human friendly numbers, base 1000

--iec

select the 1024 base for the following options, according to the IEC standard

--si

select the 1000 base for the following options, according to the SI standard

-k|--kbytes

show sizes in KiB, or kB with --si

-m|--mbytes

show sizes in MiB, or MB with --si

-g|--gbytes

show sizes in GiB, or GB with --si

-t|--tbytes

show sizes in TiB, or TB with --si

If conflicting options are passed, the last one takes precedence.

EXIT STATUS

btrfs device returns a zero exit status if it succeeds. Non zero is returned in case of failure.

AVAILABILITY

btrfs is part of btrfs-progs. Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for further details.

SEE ALSO

mkfs.btrfs(8), btrfs-replace(8), btrfs-balance(8)

Personal tools