Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
BTRFS: RAID-0 on drives of different size?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
BlueFusion
Guru
Guru


Joined: 08 Mar 2006
Posts: 371

PostPosted: Fri May 23, 2014 6:14 pm    Post subject: BTRFS: RAID-0 on drives of different size? Reply with quote

Hey folks,

I've been having great success with using btrfs for the past few years. I've been running it on my old ASUS laptop on top of dm_crypt with no problem for over a year. I bought a replacement ASUS laptop 2 months ago and did the same thing. The AES-NI instruction helped, but overall the laptop is just much faster :)

With the success of btrfs as the root filesystem on my laptops now for some time with no hiccups, I feel confident that it is ready for use as the rootfs on my desktop which stores many TB of data. Everything that is important is backed up on a seperate drive and the REALLY important stuff is backed up to an offsite server.

This morning I decided to do away with ext4 across several disks and go with a dm_crypt btrfs array. I set it up as a JBOD array (-d single) for now.

I recently read (and I can not find where I read it) that btrfs will try to utilize space efficiently if different sized disks are used.

Lucky me, I have a 1000GB drive and 2x 500GB drives. Does anybody here know if btrfs in RAID-0 will store the data in a way that data on the 500GB drives are striped with the 1TB drive so 2TB of data can be stored (less the RAID-1 metadata)?
_________________
i7-940 2.93Ghz | ASUS P6T Deluxe (v.1) | 24GB Triple Channel RAM | nVidia GTX660
4x 4TB Seagate NAS HDD (Btrfs raid5) | 2x 120GB Samsung 850 EVO SSD (Btrfs raid1)
Back to top
View user's profile Send private message
Randy Andy
Veteran
Veteran


Joined: 19 Jun 2007
Posts: 1148
Location: /dev/koelsch

PostPosted: Sat May 24, 2014 2:20 pm    Post subject: Re: BTRFS: RAID-0 on drives of different size? Reply with quote

Hi BlueFusion
BlueFusion wrote:

I recently read (and I can not find where I read it) that btrfs will try to utilize space efficiently if different sized disks are used.

Lucky me, I have a 1000GB drive and 2x 500GB drives. Does anybody here know if btrfs in RAID-0 will store the data in a way that data on the 500GB drives are striped with the 1TB drive so 2TB of data can be stored (less the RAID-1 metadata)?


AKAIK Btrfs should work in this way, you expect it would do.
Here is eventual one of the missed reference for you to read it yourself.

https://lwn.net/Articles/577961/

Regards, Andy.
_________________
If you want to see a Distro done right, compile it yourself!
Back to top
View user's profile Send private message
BlueFusion
Guru
Guru


Joined: 08 Mar 2006
Posts: 371

PostPosted: Sat May 24, 2014 2:44 pm    Post subject: Reply with quote

Thanks Andy,

I used my Google-fu yesterday and read some other articles from late 2013, early 2014 and they seemed to indicate that RAID-1 works in the way I explained, but RAID-0.....sort of but not quite. RAID-1 makes two copies of each bit of data and is smart enough to make maximum use of the space available. RAID-0, however, does not quite work in this way. Instead, it stripes the data between all available drives, as any normal RAID-0 would. This causes the last 500GB of the 1000GB drive to go mostly unused (metadata does occupy the space).

I decided that I would give it a test run with some loop devices. Sure enough, it performed as described above.

If there's a way to limit the maximum number of stripes to 2, then that should allow it to utilize all of the space, like RAID-1. I have scouring the internet and man pages for an option like this but I have not found one yet.
_________________
i7-940 2.93Ghz | ASUS P6T Deluxe (v.1) | 24GB Triple Channel RAM | nVidia GTX660
4x 4TB Seagate NAS HDD (Btrfs raid5) | 2x 120GB Samsung 850 EVO SSD (Btrfs raid1)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo 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