2014-04-02 08:29:16 +00:00
|
|
|
btrfs-device(8)
|
|
|
|
===============
|
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
|
|
|
btrfs-device - control btrfs devices
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
2014-05-19 15:49:35 +00:00
|
|
|
*btrfs device* <subcommand> <args>
|
2014-04-02 08:29:16 +00:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
2014-05-19 15:49:35 +00:00
|
|
|
*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.
|
2014-04-02 08:29:16 +00:00
|
|
|
|
2014-04-11 02:43:52 +00:00
|
|
|
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
|
2014-04-15 07:04:51 +00:00
|
|
|
mechanism. +
|
|
|
|
Profiles like RAID level can be assigned to data and metadata separately.
|
2014-04-11 02:43:52 +00:00
|
|
|
+
|
|
|
|
See `mkfs.btrfs`(8) for more details.
|
|
|
|
|
|
|
|
RAID level::
|
2014-04-15 07:04:51 +00:00
|
|
|
Btrfs filesystem supports most of the standard RAID level: 0/1/5/6/10. +
|
2014-04-11 02:43:52 +00:00
|
|
|
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.
|
2014-04-15 07:04:51 +00:00
|
|
|
+
|
|
|
|
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: +
|
|
|
|
https://btrfs.wiki.kernel.org/index.php/RAID56
|
2014-04-11 02:43:52 +00:00
|
|
|
|
|
|
|
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-replace`(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) and this man page for more details.
|
|
|
|
|
2014-04-02 08:29:16 +00:00
|
|
|
SUBCOMMAND
|
|
|
|
----------
|
2014-05-19 15:49:35 +00:00
|
|
|
*add* [-Kf] <dev> [<dev>...] <path>::
|
2014-04-02 08:29:16 +00:00
|
|
|
Add device(s) to the filesystem identified by <path>.
|
|
|
|
+
|
|
|
|
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)
|
|
|
|
|
2014-05-19 15:49:35 +00:00
|
|
|
*delete* <dev> [<dev>...] <path>::
|
2014-04-02 08:29:16 +00:00
|
|
|
Remove device(s) from a filesystem identified by <path>.
|
|
|
|
|
2014-05-19 15:49:35 +00:00
|
|
|
*scan* [(--all-devices|-d)|<device> [<device>...]]::
|
2014-04-02 08:29:16 +00:00
|
|
|
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, if '--all-devices' or '-d' is passed, all the devices under /dev are
|
|
|
|
scanned.
|
|
|
|
|
2014-05-19 15:49:35 +00:00
|
|
|
*ready* <device>::
|
2014-04-02 08:29:16 +00:00
|
|
|
Check device to see if it has all of it's devices in cache for mounting.
|
|
|
|
|
2014-05-19 15:49:35 +00:00
|
|
|
*stats* [-z] <path>|<device>::
|
2014-04-02 08:29:16 +00:00
|
|
|
Read and print the device IO stats for all devices of the filesystem
|
|
|
|
identified by <path> or for a single <device>.
|
|
|
|
+
|
|
|
|
`Options`
|
|
|
|
+
|
|
|
|
-z::::
|
|
|
|
Reset stats to zero after reading them.
|
|
|
|
|
2014-12-18 14:23:08 +00:00
|
|
|
*usage* [options] <path> [<path>...]::
|
|
|
|
Show detailed information about internal allocations in devices.
|
|
|
|
+
|
|
|
|
`Options`
|
|
|
|
+
|
|
|
|
-b|--raw::::
|
|
|
|
raw numbers in bytes, without the 'B' suffix
|
|
|
|
-h::::
|
|
|
|
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.
|
|
|
|
|
2014-04-02 08:29:16 +00:00
|
|
|
EXIT STATUS
|
|
|
|
-----------
|
2014-09-19 01:49:59 +00:00
|
|
|
*btrfs device* returns a zero exit status if it succeeds. Non zero is
|
2014-04-02 08:29:16 +00:00
|
|
|
returned in case of failure.
|
|
|
|
|
|
|
|
AVAILABILITY
|
|
|
|
------------
|
2014-05-19 16:04:26 +00:00
|
|
|
*btrfs* is part of btrfs-progs.
|
2014-04-02 08:29:16 +00:00
|
|
|
Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for
|
|
|
|
further details.
|
|
|
|
|
|
|
|
SEE ALSO
|
|
|
|
--------
|
|
|
|
`mkfs.btrfs`(8),
|
2014-04-11 02:43:52 +00:00
|
|
|
`btrfs-replace`(8),
|
|
|
|
`btrfs-balance`(8)
|