summaryrefslogtreecommitdiff
path: root/Documentation/btrfs-device.asciidoc
diff options
context:
space:
mode:
authorDimitri John Ledkov <xnox@ubuntu.com>2018-01-11 15:44:55 +0000
committerDimitri John Ledkov <xnox@ubuntu.com>2018-01-11 15:44:55 +0000
commitd78d642bffff6ea49d62c19f26052ed6d3dcc467 (patch)
treedb0f470018ee6f4b93fb8fd601401fa157e5dbe3 /Documentation/btrfs-device.asciidoc
parentb309a4dfbe8130b9fef087df59dd18a487a9c18e (diff)
New upstream release.
Diffstat (limited to 'Documentation/btrfs-device.asciidoc')
-rw-r--r--Documentation/btrfs-device.asciidoc35
1 files changed, 29 insertions, 6 deletions
diff --git a/Documentation/btrfs-device.asciidoc b/Documentation/btrfs-device.asciidoc
index 88822ece..223ade5c 100644
--- a/Documentation/btrfs-device.asciidoc
+++ b/Documentation/btrfs-device.asciidoc
@@ -68,13 +68,23 @@ Remove device(s) from a filesystem identified by <path>
Device removal must satisfy the profile constraints, otherwise the command
fails. The filesystem must be converted to profile(s) that would allow the
removal. This can typically happen when going down from 2 devices to 1 and
-using the RAID1 profile. See the example section below.
+using the RAID1 profile. See the *TYPICAL USECASES* section below.
+
The operation can take long as it needs to move all data from the device.
+
It is possible to delete the device that was used to mount the filesystem. The
-device entry in mount table will be replaced by another device name with the
-lowest device id.
+device entry in the mount table will be replaced by another device name with
+the lowest device id.
++
+If the filesystem is mounted in degraded mode (-o degraded), special term
+'missing' can be used for 'device'. In that case, the first device that is
+described by the filesystem metadata, but not present at the mount time will be
+removed.
++
+NOTE: In most cases, there is only one missing device in degraded mode,
+otherwise mount fails. If there are two or more devices missing (e.g. possible
+in RAID6), you need specify 'missing' as many times as the number of missing
+devices to remove all of them.
*delete* <device>|<devid> [<device>|<devid>...] <path>::
Alias of remove kept for backward compatibility
@@ -114,7 +124,7 @@ statistics and the meaning.
Print the stats and reset the values to zero afterwards.
-c|--check::::
-Check if the stats are all zeros and return 0 it it is so. Set bit 6 of the
+Check if the stats are all zeros and return 0 it this is so. Set bit 6 of the
return code if any of the statistics is no-zero. The error values is 65 if
reading stats from at least one device failed, otherwise it's 64.
@@ -180,8 +190,8 @@ there's enough workspace for the conversion process, we can do:
$ btrfs balance start -mconvert=raid1 /mnt
-This operation can take a while as the metadata have to be moved and all block
-pointers updated. Depending on the physical locations of the old and new
+This operation can take a while, because al metadata have to be moved and all
+block pointers updated. Depending on the physical locations of the old and new
blocks, the disk seeking is the key factor affecting performance.
You'll note that the system block group has been also converted to RAID1, this
@@ -206,6 +216,19 @@ data or the block groups occupy the whole first device.
The device size of '/dev/sdb' as seen by the filesystem remains unchanged, but
the logical space from 50-100GiB will be unused.
+==== REMOVE DEVICE ====
+
+Device removal must satisfy the profile constraints, otherwise the command
+fails. For example:
+
+ $ btrfs device remove /dev/sda /mnt
+ ERROR: error removing device '/dev/sda': unable to go below two devices on raid1
+
+In order to remove a device, you need to convert the profile in this case:
+
+ $ btrfs balance start -mconvert=dup -dconvert=single /mnt
+ $ btrfs device remove /dev/sda /mnt
+
DEVICE STATS
------------