path: root/Documentation
diff options
authorMisono, Tomohiro <>2017-10-20 10:43:05 +0900
committerDavid Sterba <>2017-11-14 15:59:00 +0100
commit2192bd5cfc344e6352ccba044c21195cca7ebe2d (patch)
treee1aecdea270cdf815a89c5ee89c38e00988a902b /Documentation
parent435145613ea3330267d95ac80ae8fb5ae1134373 (diff)
btrfs-progs: doc: add description of missing and example, of device remove
This patch updates help/document of "btrfs device remove" in two points: 1. Add explanation of 'missing' for 'device remove'. This is only written in wikipage currently. ( 2. Add example of device removal in the man document. This is because that explanation of "remove" says "See the example section below", but there is no example of removal currently. Signed-off-by: Tomohiro Misono <> Reviewed-by: Satoru Takeuchi <> [ move "" from the macro to help strings ] Signed-off-by: David Sterba <>
Diffstat (limited to 'Documentation')
1 files changed, 26 insertions, 3 deletions
diff --git a/Documentation/btrfs-device.asciidoc b/Documentation/btrfs-device.asciidoc
index 88822ece..ee42ed30 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
+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
@@ -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