![缺少 bcache0 支持设备](https://linux22.com/image/165797/%E7%BC%BA%E5%B0%91%20bcache0%20%E6%94%AF%E6%8C%81%E8%AE%BE%E5%A4%87.png)
在我新安装的 Fedora 31 中没有\dev\bcache0
.缓存设备是Raid 1:
# ls -d /dev/b*
/dev/block /dev/bsg /dev/btrfs-control /dev/bus
# bcache-super-show /dev/md127
sb.magic ok
sb.first_sector 8 [match]
sb.csum CDCAF0DD6B68FD24 [match]
sb.version 1 [backing device]
dev.label (empty)
dev.uuid b17ceaac-27ec-44d8-8bbb-235cfaa0c4a4
dev.sectors_per_block 1
dev.sectors_per_bucket 1024
dev.data.first_sector 16
dev.data.cache_mode 1 [writeback]
dev.data.cache_state 1 [clean]
cset.uuid de075a7c-af4e-43e9-b229-804322e3d263
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 223.6G 0 disk
├─sda1 8:1 0 700M 0 part /boot
├─sda2 8:2 0 700M 0 part /boot/efi
├─sda3 8:3 0 26G 0 part
│ └─luks-9793c78f-723c-4218-865f-83dbc4659192 253:1 0 26G 0 crypt [SWAP]
└─sda4 8:4 0 162G 0 part
└─luks-569b1153-2fab-4984-b1b6-c4a02ee206ef 253:0 0 162G 0 crypt /
sdb 8:16 0 111.8G 0 disk
├─sdb1 8:17 0 40G 0 part
└─sdb2 8:18 0 71.8G 0 part
sdc 8:32 0 1.8T 0 disk
└─sdc1 8:33 0 1.8T 0 part
└─md127 9:127 0 1.8T 0 raid1
sdd 8:48 0 1.8T 0 disk
└─sdd1 8:49 0 1.8T 0 part
└─md127 9:127 0 1.8T 0 raid1
sde 8:64 1 58.9G 0 disk
├─sde1 8:65 1 20G 0 part
└─sde2 8:66 1 38.9G 0 part
sr0 11:0 1 1024M 0 rom
# blkid | grep -E "md127|sdb1"
/dev/sdb1: UUID="057a2f23-c7b1-4264-a534-183ef9cad53b" TYPE="bcache" PARTLABEL="Linux filesystem" PARTUUID="505789f1-0523-4c62-bdb1-81bc0cc7bff1"
/dev/md127: UUID="b17ceaac-27ec-44d8-8bbb-235cfaa0c4a4" TYPE="bcache"
上述输出是否意味着设备正常且未损坏?
在这个新安装之后,我让它像之前安装的 Fedora 30 中一样工作。然后我调整了缓存设备分区 ( sdb1
) 的大小,现在我无法使支持设备显示为 bcache 设备。
我无法注册它:
# echo /dev/md127 > /sys/fs/bcache/register
-bash: echo: write error: Invalid argument
# echo de075a7c-af4e-43e9-b229-804322e3d263 > /sys/fs/bcache/register
-bash: echo: write error: Invalid argument
都不附加
# echo de075a7c-af4e-43e9-b229-804322e3d263 > /sys/block/md127/bcache/attach
-bash: echo: write error: No such file or directory
该文件退出:
# ll /sys/block/md127/bcache/attach
--w-------. 1 root root 4096 Jan 5 10:37 /sys/block/md127/bcache/attach
我缺少什么?
答案1
我设法做到了:
# echo 1 > /sys/block/md127/bcache/stop; echo 1 > /sys/block/md127/bcache/detach; sleep 2; echo /dev/md127 > /sys/fs/bcache/register
# echo 32dbab45-f8b3-4ef8-89e2-32007fc4970b > /sys/block/md127/bcache/attach
# ll /dev/bcache0
brw-rw----. 1 root disk 252, 0 Jan 5 12:56 /dev/bcache0