Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I set up a btrfs partition using two 3 TB drives in RAID 1:

$ mkfs.btrfs -m raid1 -d raid1 /dev/sdd /dev/sde

$ mount /dev/sdd /media/media

Copied a bunch of data onto the partition, with the result:

$ du -hs /media/media
2.5T    /media/media

$ btrfs filesystem show
Label: none  uuid: 9c2dd511-33bf-454e-9169-594cd84bee05
        Total devices 2 FS bytes used 2.41TB
        devid    2 size 2.73TB used 2.41TB path /dev/sde
        devid    1 size 2.73TB used 2.41TB path /dev/sdd
## I'm spoofing this a bit as I don't have a log of the response at this point

Next, I added another 3 TB drive and a 4 TB drive:

$ btrfs device add /dev/sdb /dev/sdc /media/media

$ btrfs filesystem balance
Done, had to relocate 2538 out of 2538 chunks

$ btrfs filesystem show
Label: none  uuid: 9c2dd511-33bf-454e-9169-594cd84bee05
        Total devices 4 FS bytes used 2.41TB
        devid    2 size 2.73TB used 945.03GB path /dev/sde
        devid    1 size 2.73TB used 944.04GB path /dev/sdd
        devid    4 size 2.73TB used 1.24TB path /dev/sdc
        devid    3 size 3.64TB used 1.84TB path /dev/sdb
## actual output this time

$ root@leviathan:/media# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1        95G   82G  8.7G  91% /
## SNIP
/dev/sdd         12T  4.9T  6.8T  42% /media/media

Now, the output from btrfs fi sh sums to 4.92 TB, double the amount of disk space reported by du -hs, not 4x as I'd expect from a RAID 1 array using four disks. I had planned to convert the RAID1 to RAID10 using btrfs balance start -dconvert=raid10 -mconvert=raid10 /media/media, but the output seems to indicate that it's already behaving as RAID 10. Am I off base here? Do I not need to convert? Or have I screwed something else up?

Additional information, if it matters:

# btrfs version
Btrfs v0.20-rc1

# uname -a
Linux leviathan 3.11.0-18-generic #32-Ubuntu SMP Tue Feb 18 21:11:14 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 13.10
Release:        13.10
Codename:       saucy
share|improve this question

1 Answer 1

up vote 1 down vote accepted

No, you still have a raid1, and the total size is as expected: half of the sum total. You seem to be thinking of a 4 way raid1 ( 4 copies instead of 2 ), which you can't do with btrfs.

share|improve this answer
    
Thanks for the response. I'm now having another problem with the conversion, but as it's not directly related to the question, I won't post it here. –  Mikkel Mar 25 at 16:53
    
"btrfs RAID1 is is defined currently as "2 copies of all the data on different devices" (<--- link to source in the Btrfs Wiki) –  ignis Mar 31 at 7:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.