I was setting up for some dm-cache testing this weekend (using 3.9.0-rc7 x86_64) and ran into the following:
# dmsetup create cache --table '0 41943040 cache /dev/mapper/metadata /dev/mapper/ssd /dev/mapper/origin 512 1 writeback default 0'
device-mapper: reload ioctl on cache failed: Block device required
After this error, /var/log/messages contains:
[75376.089354] device-mapper: cache metadata: sb_check failed: blocknr 18446744073709551615: wanted 0
[75376.089362] device-mapper: block manager: superblock validator check failed for block 0
[75376.089364] device-mapper: cache metadata: couldn't read lock superblock
[75376.095173] device-mapper: table: 253:5: cache: Error creating metadata object
[75376.095180] device-mapper: ioctl: error adding target to table
This comes from sb_check() in drivers/md/dm-cache-metadata.c and drivers/md/dm-thin-metadata.c, and it motivated me to try:
# dd if=/dev/zero of=/dev/mapper/metadata bs=4k conv=notrunc
Afterwards, I tried “dmsetup create cache” again and it worked fine.