How to create btrfs RAID-1 filesystem (assertion error in mkfs.btrfs)?

Posted by amcnabb on Server Fault See other posts from Server Fault or by amcnabb
Published on 2012-03-24T21:44:35Z Indexed on 2012/03/24 23:31 UTC
Read the original article Hit count: 342

Filed under:
|
|

I tried to make a btrfs RAID-1 filesystem in "degraded mode" by following the btrfs UseCases instructions but hit a fatal assertion error. Why is this failing, and is there any workaround?

The instructions I followed are at:

https://btrfs.wiki.kernel.org/articles/u/s/e/UseCases_8bd8.html

The output of the mkfs.btrfs and btrfs filesystem show commands is:

# mkfs.btrfs -m raid1 -d raid1 /dev/sdd1 /dev/loop1

WARNING! - Btrfs Btrfs v0.19 IS EXPERIMENTAL
WARNING! - see http://btrfs.wiki.kernel.org before using

failed to read /dev/sr0
adding device /dev/loop1 id 2
mkfs.btrfs: volumes.c:802: btrfs_alloc_chunk: Assertion `!(ret)' failed.
zsh: abort (core dumped)  mkfs.btrfs -m raid1 -d raid1 /dev/sdd1 /dev/loop1
# btrfs filesystem show
failed to read /dev/sr0
Label: none  uuid: 773908b8-acca-4c30-85c5-6642b06de22b
        Total devices 1 FS bytes used 28.00KB
        devid    1 size 223.13GB used 2.04GB path /dev/sda5

Label: none  uuid: 0f06f1a8-5f5f-4b92-a55c-b827bcbcc840
        Total devices 2 FS bytes used 24.00KB
        devid    2 size 2.00GB used 0.00 path /dev/loop1
        devid    1 size 1.36TB used 20.00MB path /dev/sdd1

Btrfs Btrfs v0.19
#

EDIT:

It turns out that the filesystem isn't mountable:

# mount /dev/sdd1 /mnt/big2
mount: wrong fs type, bad option, bad superblock on /dev/sdd1,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so
#

So, why did the mkfs fail, and is there any workaround?

© Server Fault or respective owner

Related posts about filesystems

Related posts about btrfs