
On Sat, Feb 23, 2019 at 03:42:57PM +1100, Andrew Greig wrote:
Now I need to plug in my old SATA drive and copy my data to one of my data drives.
Small thing, when I was setting the partitions the system did not like /data on two separate drives so for the moment one is /data0 and the othe is /data1. If I load one of the drives with my data, as soon as RAID is setup will that data copy across to the other drive?
And the next step is RAID
Well, kind of. Not if you're talking about using mdadm for RAID-1. btrfs does its own raid. and volume management. There's no need for mdadm or lvm or anything else. If you've used btrfs for those drives then what you need to do is: 1. unmount both of them 2. remount ONE of them (say, data0) as /data (and edit /etc/fstab so that it gets mounted as /data on every reboot. also delete the line in fstab that mounts data1). 3. destroy the partition table on the data1 drive, and recreate it (again, one big partition for the entire disk[1]) 4. add that drive to the existing btrfs array on /data e.g. *IF* /data1 was sdc1, you'd do something like: sudo btrfs device add -f /dev/sdc1 /data sudo btrfs balance start -dconvert=raid1 -mconvert=raid1 /data The earlier you do this (i.e. the less data is already on it), the faster this conversion to raid1 will be. Nearly instant if there's little or no data. Much longer if there's a lot of data that needs to be synced to the other drive. i.e. best to do it before copying the data from your old drive. [1] technically, you don't need a partition, btrfs can use the entire disk. but IMO a partition table is useful for clearly identifying that a disk is in use and what it is being used for. It doesn't hurt in any way to have one and the space used by the partition table is trivial - at most, a sector for the partition table itself and another 2047 sectors[2] to ensure that the first sector of the first (and only) partition is aligned at a 4K sector boundary. i.e. 1MB out of your 2TB drive. [2] it's not uncommon on disks with GPT partition tables (instead of the old style ms-dos partition tables) to create a tiny partition in that area with type EF02 for grub, especially if they're ever going to be used to boot grub. craig -- craig sanders <cas@taz.net.au>