Replacing a Btrfs drive - best practices?

Rashkae ubuntu at tigershaunt.com
Tue Nov 7 05:15:29 UTC 2017


On 17-11-06 01:12 PM, Matthew Crews wrote:

>
> Method 1:
>
> 1.Use the built in Btrfs tools to convert Sdb into a Raid1
> 2. add Sdc and Sdd to the RAID
> 3. Sync data between all 3 drives
> 4. Remove Sdb from RAID once sync is complete.
>
>

This would be the proper way to do it.  However, since you are concerned 
that sdb might already be failing, and bad things can happen if sdb 
coughts up a hairball before it is cleanly mirrored. (BTRFS recovery 
tools are still a work in progress.....). I would advise having a backup 
first, before proceeding.

There would be no changes required to fstab.. the btrfs file system will 
find it's members automagically.

Step 3 needs a bit of explaining.  You would not sync the data between 
the 3 drives.  When you add the extra drives, and convert the filesystem 
to Raid 1, BTRFS will make exactly 1 redundant copy of all the data. 
When next you issue the command to remove sdb, the copy of the data 
residing on that drive will first be moved to other available spare drives.

Documentation is here: 
https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices#Conversion







More information about the ubuntu-users mailing list