在 debian9 上安装 bcache

在 debian9 上安装 bcache

我正在我的 debian-9 机器上安装 bcache 工具

root@machine# uname -a
Linux singlefs-ssd-vm 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u3 (2017-08-06) x86_64 GNU/Linux

尝试过的命令:

make-bcache -B /dev/sdx1
make-bcache --block 4k --bucket 2M -C /dev/sdy2

echo cset.uuid > /sys/block/bcache0/bcache/attach

其中 cset.uuid 是

bcache-super-show /dev/sdy2 | grep cset.uuid | awk '{print $2}'

/var/log/syslog 中抛出错误

Oct  9 10:40:24 localhost kernel: [  110.511712] bcache: bch_cached_dev_attach() Couldn't attach sdb: block size less than set's block size
Oct  9 10:40:24 localhost kernel: [  110.513014] bcache: __cached_dev_store() Can't attach xxxx
Oct  9 10:40:24 localhost kernel: [  110.513014] : cache set not found

fdisk -l 给出

Disk /dev/sdx1: 1.5 TiB, 1610612736000 bytes, 3145728000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/bcache0: 1.5 TiB, 1610612727808 bytes, 3145727984 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

答案1

您还应该为支持设备指定“--block 4k”

make-bcache --block 4k -B /dev/sdx1

相关内容