Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
btrfs - Add new drives and switch to RAID6
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Cyker
Veteran
Veteran


Joined: 15 Jun 2006
Posts: 1746

PostPosted: Sat Feb 28, 2015 1:37 am    Post subject: btrfs - Add new drives and switch to RAID6 Reply with quote

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
View user's profile Send private message
BlueFusion
Guru
Guru


Joined: 08 Mar 2006
Posts: 371

PostPosted: Sat Feb 28, 2015 3:27 am    Post subject: Reply with quote

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
View user's profile Send private message
Cyker
Veteran
Veteran


Joined: 15 Jun 2006
Posts: 1746

PostPosted: Sun Mar 01, 2015 11:21 am    Post subject: Reply with quote

Ahh, nice :)

Thanks for the tips, worked a treat!:D

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
View user's profile Send private message
happosai
n00b
n00b


Joined: 17 Aug 2005
Posts: 33

PostPosted: Fri Mar 06, 2015 8:56 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum