Replacing a Btrfs drive - best practices?

Matthew Crews mailinglists at mattcrews.com
Mon Nov 6 18:12:13 UTC 2017


I'm looking to replace a near-failing hard drive, currently mounted as /home with Btrfs, with a pair of replacements in a Raid1 configuration. I was wondering about the pros and cons of using these two methods for doing so.

(For brevity, I will be referring to my drives as sda, sdb, etc)

Current setup:

/dev/sda mounted as /
/dev/sdb mounted as a Btrfs /home

Desired setup

/dev/sda mounted as / (no change)
/dev/sdb removed from system
/dev/sdc(d) in a Raid1 configuration mounted as Btrfs /home

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 seems like the simple solution, and can be done on a live system. But are the btrfs tools smart enough to mirror my data directly? Will I need to go and edit fstab afterwards? Will it just work(tm)?

Method 2:

1. Boot to a rescue disk.
2. Format Sdc and Sdd as a btrfs Raid1
3. Rsync data from Sdb to Sdc(d) array.
4. Manually edit fstab to point to my new drive
5. Reboot to live system

In theory this seems like it should just work, but obviously involves system downtime (I'm sure a similar method could work on a running system, but I can take the downtime hit). Will this also copy relevant snapshots? Do I need to do anything special to fstab besides change the UUID?

Finally, which is the preferred method, or is there a better method than the ones I've listed?

-Matt

Sent from [ProtonMail](https://protonmail.com), Swiss-based encrypted email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20171106/360c103b/attachment.html>


More information about the ubuntu-users mailing list