On 2017/10/16 18:22, Nikolay Borisov wrote:
> 
> 
> On 16.10.2017 07:56, Misono, Tomohiro wrote:
>> 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.
>> (https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices)
>>
>> 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 <misono.tomoh...@jp.fujitsu.com>
>> Reviewed-by: Satoru Takeuchi <satoru.takeu...@gmail.com>
>> ---
>>  Documentation/btrfs-device.asciidoc | 19 ++++++++++++++++++-
>>  cmds-device.c                       |  8 ++++++++
>>  2 files changed, 26 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/btrfs-device.asciidoc 
>> b/Documentation/btrfs-device.asciidoc
>> index 88822ec..dd60415 100644
>> --- a/Documentation/btrfs-device.asciidoc
>> +++ b/Documentation/btrfs-device.asciidoc
>> @@ -68,13 +68,17 @@ 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.
>> ++
>> +If device is mounted as degraded mode (-o degraded), special term "missing"
>       ^ filesystem    ^ in
>> +can be used for <device>. In that case, the first device that is described 
>> by> +the filesystem metadata, but not preseted at the mount time will be
> removed.
>                                       ^ present
> 
> Also, what happens if there are 2 or more devices missing, will those be
> deleted as well or just the first device? If all missing devices are
> handled then this needs to be reflected in the documentation.
> 

If there are 2 or more devices missing, only one device will be removed.
However, that case is rare. Previous discussion is in this thread: 
https://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg68734.html

I copied these lines from wiki[1], but it seems this needs more explanations.
How about adding a note in the end?:
===
 If 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 RAID 
6),
 you need specify "missing" as many times as the number of missing devices to 
 remove all of them.
===

Please let me know if there is more appropriate explanation.

Thanks,
Tomohiro

[1] https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to