Re: [mdadm PATCH] bcache: add bcache superblock

From
Dan Williams <hidden>
Date
2012-05-15 16:59:20
Also in
linux-bcache
On Mon, May 14, 2012 at 5:04 PM, Mark Hills [off-list ref] wrote:
On Fri, 11 May 2012, Dan Williams wrote:
quoted
This is a hybrid proposal for supporting bcache as a md device.
Somewhat similar to the v1.x metadata format, where array assembly is
handled in userspace, but managed in the kernel.  In the bcache case it
is an "external" metadata format, but then the expectation is that the
kernel "bcache" personality takes over runtime maintenance of the
metadata.
I am having some trouble with this, can you clarify (perhaps by example)
how to create a pairing of a cache and backing device?

I tried creating directly:

 # mdadm --create /dev/md0 --level=11 --raid-devices=2 /dev/sdb /dev/sdc
 mdadm: unknown level 11

But as the code in Assemble.c is patched (and not Create.c), I had a hunch
to format the devices as before then assemble the array:
Yeah, "create" support is not there yet.
 # make-bcache -C /dev/sdb
 # make-bcache -B /dev/sdc
 # mdadm -A /dev/md0 /dev/sdb /dev/sdc
 mdadm: Cannot assemble mbr metadata on /dev/sdb
I should have been more explicit in the changelog.  This current patch
was only tested to assemble an existing bcache configuration.  I.e. it
assumes the backing device has been attached to the cache set at least
once.  By default make-bcache always creates a new cache-set id per
invocation.  So in the above example it won't find sdb and sdc belong
to the same md device because the cache-set id's differ.  You can
verify this with mdadm -E.

[..]
Maybe I missed something basic here, but I'm afraid can't see what? If
not, hopefully this information is useful.

I use bcache v13 patches and the MD conversion, and this patch to mdadm.
For reference:

[root@fedora-virt ~]# mdadm -E /dev/vd[bc]
/dev/vdb:
       Magic : <bcache>
     Version : 3
        Role : cache
    Set UUID : e8670bc3:974b489c:aeb68ea1:d1adf6d1
  Cache Devs : 1
 Device UUID : a1b25e26:5a4c4db6:2716c1aa:eba44ec7
       Flags : sync
      Policy : lru
       Label :
 Device Size : 16776192 (8.00 GiB 8.59 GB)
 Bucket Size : 1024
 Num Buckets : 16384
    this dev : 0
First Bucket : 1
    Checksum : 45fa97cda53b0b6 correct
/dev/vdc:
       Magic : <bcache>
     Version : 1
        Role : backing-device
    Set UUID : e8670bc3:974b489c:aeb68ea1:d1adf6d1
  Cache Devs : 1
 Device UUID : 7045ff87:aa4b13c4:670d8bb2:0b4ad628
       Flags : sync
       State : clean
        Mode : writeback
       Label :
 Device Size : 16776192 (8.00 GiB 8.59 GB)
 Bucket Size : 1024
 Num Buckets : 16384
    this dev : 0
First Bucket : 1
    Checksum : f36910e51451d91c correct
[root@fedora-virt ~]# mdadm -Avvv /dev/md/bcache /dev/vd[bc]
mdadm: looking for devices for /dev/md/bcache
mdadm: /dev/vdb is identified as a member of /dev/md/bcache, slot 0.
mdadm: /dev/vdc is identified as a member of /dev/md/bcache, slot 1.
mdadm: added /dev/vdb to /dev/md/bcache as 0
mdadm: added /dev/vdc to /dev/md/bcache as 1
mdadm: Container /dev/md/bcache has been assembled with 2 drives
[root@fedora-virt ~]# cat /proc/mdstat
Personalities : [bcache]
md126 : active bcache vdb[1] vdc[0]
      8388096 blocks super external:/md127/0 8388096k cache-blocks

md127 : inactive vdc[1](S) vdb[0](S)
      16 blocks super external:bcache

unused devices: <none>
Thread (1 message) 1 message, 1 author, last reply 2012-05-15
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help