View previous topic :: View next topic |
Author |
Message |
Cyker Veteran

Joined: 15 Jun 2006 Posts: 1746
|
Posted: Sat Feb 28, 2015 1:37 am Post subject: btrfs - Add new drives and switch to RAID6 |
|
|
Hey all,
I'm about to add some new drives to my btrfs now that the RAID is actually working in some useful fashion
Currently it is a 3-disk RAID5 system.
I am about to add 3 more disks and wish to turn it into a RAID6 system.
I was just going to "mkfs.btrfs" the 3 new disks, "btrfs device add" them to the array then rebalance it to RAID6.
Is that about right, or is there a better way of doing it?
My main concern is how long I might have to wait between adding all the disks and the rebalance (Or can I fire off all the commands right away and trust it to sort itself out sensibly and without taking a year to execute...?) |
|
Back to top |
|
 |
BlueFusion Guru

Joined: 08 Mar 2006 Posts: 371
|
Posted: Sat Feb 28, 2015 3:27 am Post subject: |
|
|
Do not do the mkfs.btrfs step. When adding to the existing Btrfs array, it will format over anything currently on it (including another Btrfs filesystem).
Assuming the new drives are sdd, sde, sdf and array is mounted at /mnt/btrfs:
Quote: | # btrfs dev add /dev/sdd /dev/sde /dev/sdf /mnt/btrfs
# btrfs balance start -dconvert=raid6 -mconvert=raid6 /mnt/btrfs |
You can monitor the balance/conversion with
Quote: | # btrfs balance stat /mnt/btrfs |
|
|
Back to top |
|
 |
Cyker Veteran

Joined: 15 Jun 2006 Posts: 1746
|
Posted: Sun Mar 01, 2015 11:21 am Post subject: |
|
|
Ahh, nice
Thanks for the tips, worked a treat!
Really liking btrfs now; The whole operation was two commands and took just under a day to complete.
Last time I did something like this with mdadm it took a lot longer!! |
|
Back to top |
|
 |
happosai n00b

Joined: 17 Aug 2005 Posts: 43
|
Posted: Fri Mar 06, 2015 8:56 am Post subject: |
|
|
It is a little bit unfair to compare Btrfs with Mdadm/Mdtools. Btrfs is an unfinished, unstable product, with features still getting in and stabilized with every kernel release, while Mdadm has been stable and well tested since years.
Mdadm needs to be file system agnostic, Btrfs of course is not, it is a layering violation. When you create a new RAID array, Mdadm does by default a parity check/calculation on all HDDs of that array; Btrfs does not, because it can do this on write. There's a parameter named "--assume-clean" which can do the same for Mdadm, but when creating a new RAID this is really a bad idea to do so.
Especially RAID6 is right now on Btrfs heavy work in progress, experimental and unstable. Expect it to break.
Of course you can make an array this way:
mkfs.btrfs -d RAID6 -m RAID6 /dev/... /dev/.. /dev/... [...] |
|
Back to top |
|
 |
|