2

I'm attempting to create an LVM volume on a bcache device, but getting "device not found or recognized", despite lsblk clearly showing the device, and bcache state showing "clean".

OS is Ubuntu 13.10 using a default kernel and bcache-tools come from https://launchpad.net/~g2p/+archive/storage/

My partition layout us as follows:

sda       8:0    0 223.6G  0 disk  
├─sda1    8:1    0   499M  0 part  
│ └─md1   9:1    0   499M  0 raid1 /boot
├─sda2    8:2    0    20G  0 part  
│ └─md2   9:2    0    20G  0 raid1 /
├─sda3    8:3    0  11.7G  0 part  
│ └─md3   9:3    0  11.6G  0 raid1 
└─sda4    8:4    0 191.5G  0 part  
└─md4   9:4    0 191.3G  0 raid1 
sdb       8:16   0 223.6G  0 disk  
├─sdb1    8:17   0   499M  0 part  
│ └─md1   9:1    0   499M  0 raid1 /boot
├─sdb2    8:18   0    20G  0 part  
│ └─md2   9:2    0    20G  0 raid1 /
├─sdb3    8:19   0  11.7G  0 part  
│ └─md3   9:3    0  11.6G  0 raid1 
└─sdb4    8:20   0 191.5G  0 part  
 └─md4   9:4    0 191.3G  0 raid1 
sdc       8:32   0   1.8T  0 disk  
└─sdc1    8:33   0   1.8T  0 part  
  └─md5   9:5    0   1.8T  0 raid1 
sdd       8:48   0   1.8T  0 disk  
└─sdd1    8:49   0   1.8T  0 part  
  └─md5   9:5    0   1.8T  0 raid1

I intend to use /dev/md5 as my backing device, and /dev/md4 as my cache device.

To create the backing device, I've done the following:

make-bcache -B /dev/md5
UUID:           4264d526-cd5e-43d9-a969-3eb2bf81aa91
Set UUID:       e4bee610-da76-49ff-8636-08b80005a826
version:        1
block_size:     1
data_offset:        16

Similarly, to create the caching device:

make-bcache -C /dev/md4
UUID:           8c425d36-c4a9-4e0b-9c78-a633afabf359
Set UUID:       5f807648-f510-4315-8665-e650773accf1
version:        0
nbuckets:       391811
block_size:     1
bucket_size:        1024
nr_in_set:      1
nr_this_dev:        0
first_bucket:       1

Attach the backing device:

echo 5f807648-f510-4315-8665-e650773accf1 > /sys/block/bcache0/bcache/attach

Confirm the bcache0 device appears in lsblk (it does), and check the bcache state:

cat /sys/block/bcache0/bcache/state
clean

Set writeback mode:

echo writeback > /sys/block/bcache0/bcache/cache_mode

Create LVM physical volume:

pvcreate /dev/bcache0
Device /dev/bcache0 not found (or ignored by filtering).

Even after a reboot to force a re-read, I still get this same error. Anybody see what I'm doing wrong?

1 Answers1

3

I had a similar problem. The answer I found over here was useful:

http://comments.gmane.org/gmane.linux.kernel.bcache.devel/235

In short, edit your lvm.conf to add the line:

types = [ "bcache", 16 ]

This will allow LVM to recognise bcache as an "acceptable" block device. See the manpage on lvm.conf for more information:

http://manpages.ubuntu.com/manpages/trusty/man5/lvm.conf.5.html

run2000
  • 46