3

I had a ~1.6TB BTRFS volume on a single partition, to which successfully I added another freshly created and formatted partition (on another device) of exact same size with the intent of mirroring them. The size of the volume now appears to be ~3.2TB. However, when I try to convert the volume (mounted to /mnt/mnt0) to a RAID-1 with

btrfs balance start -dconvert=raid1 -mconvert=raid1 /mnt/mnt0

(from here)

I get the following error:

ERROR: error during balancing '/mnt/mnt0' - Inappropriate ioctl for device
There may be more info in syslog - try dmesg | tail

dmesg output is pretty uninteresting (and none of this appears to have been produced by running the above command in any case):

root@Xeon:~# dmesg | tail
[26712.029432] device label Storage devid 1 transid 3760 /dev/sdb1
[26712.029464] device fsid 7c7bb4a7-f403-4dad-b7e3-92fa1a30c764 devid 1 transid 175588 /dev/sdb2
[26712.029494] device fsid 56a9e829-c964-4f16-a37f-3bde05fb22a0 devid 1 transid 172361 /dev/sdb3
[26712.029524] device fsid 29181083-c9d6-4d8a-bd3b-1f17b925bb21 devid 1 transid 70197 /dev/sdb4
[26712.029582] device fsid ff65812c-9515-465d-8536-e8d00cfb2193 devid 1 transid 3677 /dev/sda1
[26712.029641] device label Storage devid 2 transid 3760 /dev/sdc1
[26712.029886] device fsid 44c395d9-df4e-4ab2-8a41-5b06e584e854 devid 1 transid 4 /dev/sdc2
[26828.213983] device label Storage devid 1 transid 3760 /dev/sdb1
[26967.116350] device label Storage devid 1 transid 3760 /dev/sdb1
[27079.571213] device label Storage devid 2 transid 3763 /dev/sdc1

btrfs fi show gives (in case this is of relevance):

Label: 'Storage'  uuid: 77a43f33-908b-468b-9570-55964547d1a1
        Total devices 2 FS bytes used 744.68GB 
        devid    2 size 1.62TB used 0.00 path /dev/sdc1
        devid    1 size 1.62TB used 947.54GB path /dev/sdb1

Both partitions passed btrfs.fsck.

How would I make it work?

EDIT: This is on an up-to-date Debian Wheezy installation with a 3.2 kernel.

UPDATE: Strangely enough, btrfs balance start /mnt/mnt0 worked fine - however, btrfs balance cancel /mnt/mnt0 failed with the same error. After balancing, both volumes appear to have the same data on them, but the data is still in RAID0; btrfs fi show gives

Label: 'Storage'  uuid: 77a43f33-908b-468b-9570-55964547d1a1
        Total devices 2 FS bytes used 744.66GB
        devid    2 size 1.62TB used 901.01GB path /dev/sdc1
        devid    1 size 1.62TB used 901.01GB path /dev/sdb1

And btrfs fi df:

Data, RAID0: total=1.72TB, used=742.51GB
System, RAID1: total=8.00MB, used=144.00KB
System: total=4.00MB, used=0.00
Metadata, RAID1: total=19.00GB, used=2.15GB

1 Answers1

3

Solved by upgrading kernel to 3.8.4. Had to compile my own, but stock settings seem to be working fine (I built btrfs statically rather than as a module, though I'm unsure if this was necessary).

EDIT: I can't believe I missed this... according to the BTRFS wiki, changing raid levels after the filesystem has been created isn't supported for 3.2 series and older kernels. That must have been my problem.