</span><spanstyle=color:#ffb964>btrfs</span><span> device add /dev/sdA1 /mnt/raid1 </span><spanstyle=color:#888># add the first device
</span><spanstyle=color:#ffb964>btrfs</span><span> device add /dev/sdB1 /mnt/raid1 </span><spanstyle=color:#888># add the second device
</span></code></pre><li>Setting up RAID1 when you already have a disk with some data on it and want to add another:<preclass=language-bashdata-lang=bashstyle=color:#e8e8d3;background-color:#151515><codeclass=language-bashdata-lang=bash><spanstyle=color:#ffb964>btrfs</span><span> device add /dev/sdB1 /mnt/raid1 </span><spanstyle=color:#888># add the second device
</span><spanstyle=color:#ffb964>btrfs</span><span> balance start</span><spanstyle=color:#ffb964> -dconvert</span><span>=raid1</span><spanstyle=color:#ffb964> -mconvert</span><span>=raid1 /mnt/raid1 </span><spanstyle=color:#888># distribute data to get the array set up
</span></code></pre></ul><h2id=raid0>RAID0<aaria-label="Anchor link for: raid0"class=zola-anchorhref=#raid0>#</a></h2><ul><li>Setting up RAID0 with two disks - exactly the same as with RAID1:<preclass=language-bashdata-lang=bashstyle=color:#e8e8d3;background-color:#151515><codeclass=language-bashdata-lang=bash><spanstyle=color:#ffb964>mkdir</span><span> /mnt/raid1 </span><spanstyle=color:#888># make the RAID1 pool
</span><spanstyle=color:#ffb964>btrfs</span><span> device add /dev/sdA1 /mnt/raid0 </span><spanstyle=color:#888># add the first device
</span><spanstyle=color:#ffb964>btrfs</span><span> device add /dev/sdB1 /mnt/raid0 </span><spanstyle=color:#888># add the second device
</span></code></pre> You can also continue to add more devices. The total storage available at the end of the process is the sum of the storage available on each drive:<preclass=language-bashdata-lang=bashstyle=color:#e8e8d3;background-color:#151515><codeclass=language-bashdata-lang=bash><spanstyle=color:#ffb964>btrfs</span><span> device add /dev/sdC1 /mnt/raid0 </span><spanstyle=color:#888># add the third device
</span><spanstyle=color:#ffb964>btrfs</span><span> device add /dev/sdD1 /mnt/raid0 </span><spanstyle=color:#888># add the fourth device
</span><spanstyle=color:#888># and so on...
</span></code></pre><li>Setting up RAID0 when you already have a disk with some data on it and want to add another:<preclass=language-bashdata-lang=bashstyle=color:#e8e8d3;background-color:#151515><codeclass=language-bashdata-lang=bash><spanstyle=color:#ffb964>btrfs</span><span> device add /dev/sdA1 /mnt/raid0 </span><spanstyle=color:#888># add the second device
</span><spanstyle=color:#ffb964>btrfs</span><span> balance start</span><spanstyle=color:#ffb964> -dconvert</span><span>=raid0 /mnt/raid0 </span><spanstyle=color:#888># distribute data to get the array set up
</span></code></pre></ul><h2id=nested-raid-levels>Nested RAID levels<aaria-label="Anchor link for: nested-raid-levels"class=zola-anchorhref=#nested-raid-levels>#</a></h2><p>Btrfs also supports RAID10 (or RAID1+0) which is a combination of RAID1 and RAID0 as demonstrated by the following image: <imgalt="Image demonstrating how RAID10 looks"src=https://devraza.giize.com/img/raid10.png><p>However, as you can see, RAID10 requires <em>n</em> disks where <em>n</em> is an even number greater than or equal to 4. Furthermore, if you tried using devices of varying sizes, space would likely be wasted. So what would you do if you had 3 devices, with, for example, sizes of 1TB, 500GB, and 500GB?<p>A possible solution here would be to split the 1TB drive into two equal partitions of 500GB, and pass them to btrfs as independant drives.<p>Theoretically, you could also combine the two 500GB drives into a RAID0 partition and combine them through RAID1 with the 1TB drive (creating a nested RAID01/RAID0+1 array), but this seems to be unsupported by btrfs.<p>In general, setting up a RAID10 array with btrfs looks like this:<preclass=language-bashdata-lang=bashstyle=color:#e8e8d3;background-color:#151515><codeclass=language-bashdata-lang=bash><spanstyle=color:#ffb964>mkdir</span><span> /mnt/raid10 </span><spanstyle=color:#888># make the RAID10 pool
</span><spanstyle=color:#ffb964>btrfs</span><span> balance start</span><spanstyle=color:#ffb964> -dconvert</span><span>=raid10</span><spanstyle=color:#ffb964> -mconvert</span><span>=raid10 /mnt/raid10 </span><spanstyle=color:#888># distribute data to get the array set up