Home_greyopenFATE - openSUSE feature tracking > #313130
Dashboard | Search | Sign up | Login

Please login or register to be able to edit or vote this feature.

Support btrfs RAID1 mirrored partitions

Feature state

openSUSE Distribution


In release 12.1 openSUSE adds support for btrfs. The btrfs filesystem supports several RAID configurations on the filesystem level. This is great since now it is no longer necessary to use Multiple Devices or other mechanisms to support RAID filesystems. Mirrored filesystems are a means to increase data reliability and read speed. However, btrfs mirrored filesystems are currently not supported during installation nor in yast2. Since it is not trivial to add such a filesystem to a openSUSE 12.1 system this is a useful addition. In addition there should be integrated support in openSUSE to detect and recover from situations where one partition fails which is part of a btrfs RAID1 filesystem.


  • Duplicate of feature #316216:


It is far from trivial to accomplish integration of a RAID1 btrfs mirrored filesystem in the system. Such a filesystem can be created with:

mkfs.btrfs -L mylabel -m raid1 -d raid1 /dev/sda4 /dev/sdb4

This filesystem can then be mounted with:

mount /dev/sda4 /mnt

However, after reboot openSUSE 12.1 fails to mount this again with the identical command. As a response it gives the following two unclear messages in dmesg:

btrfs: failed to read the system array on sda4
btrfs: open_ctree failed

The trick is to specify both devices as:

mount -o device=/dev/sda4,device=/dev/sdb4 /dev/sda4 /mnt

The fstab entry should then become:

/dev/sda4 /mnt btrfs device=/dev/sda4,device=/dev/sdb4 1 2

Then after reboot the filesystem is mounted. Knowledge of these facts and integration of btrfs RAID options during installation and in yast2 would help.

There currently doesn't appear to be a way to convert a single partition root btrfs filesystem to RAID1. The only way to achieve a btrfs RAID1 root partition is therefore during installation.


icons/user_comment.png J. E. wrote: (5 years ago)

The trick is actually to run `btrfs device scan`. Then, either /dev/sda4 or /dev/sdb4 can be used for mounting, and you don't need that fugly devices= extra option.

icons/user_comment.png T. H. wrote: (5 years ago)

I thought I saw ``btrfs device scan`` as part of the boot up scripts when I was configuring the drive, but I believe this is the issue I ran into today.
(I did see this before but I ran fschk and then everything worked)
Unfortunately I'm not at home so I'm going to have to ask my dad to make the changes and then see if the issue is fixed. (I will update)

...Luckily my father introduced me to openSUSE and can manage fixing the config

icons/user_comment.png T. H. wrote: (5 years ago)

I can confirm adding the additional devices to fstab works as a fix, but ``btrfs device scan`` should really be run during the systemd ``local-fs.target``.

I was looking for where I saw the ``btrfs scan`` and the only thing I could easily find was in ``/lib/mkinitrd/scripts/boot-btrfs.sh``

icons/user_comment.png N. J. wrote: (3 years ago)

Easy creation of BTRFS RAID with YaST would be appreciated by me, too. I can remember that usage of built-in RAID functions of BTRFS was discouraged in the past, but on LinuxCon 2014 in Chicago RAID 0 and 1 were stated to be as stable as other basic functions.

Last change: 12 months ago
Score: 4
  • Negative: 0
  • Neutral: 1
  • Positive: 4
Feature Export
Application-xmlXML   Text-x-logPlaintext   PrinterPrint