我有 3 个 HDD 和 1 个 SSD,我已成功将所有驱动器安装到 bcache。
pavs@VAS:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 132G 35G 90G 28% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 3.9G 8.0K 3.9G 1% /dev
tmpfs 786M 2.3M 784M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 3.9G 152K 3.9G 1% /run/shm
none 100M 52K 100M 1% /run/user
/dev/bcache1 2.7T 2.1T 508G 81% /var/www/html/directlink/FTP1
/dev/bcache2 1.8T 614G 1.2T 36% /var/www/html/directlink/FTP2
/dev/bcache0 1.8T 188G 1.6T 11% /var/www/html/directlink/FTP3
/dev/sdf1 367G 284G 65G 82% /media/pavs/e93284df-e52e-4a5d-a9e1-323a388b332f
但根据 bcache 统计数据,两个驱动器正在进行缓存,但第三个驱动器没有(bcache1)
bcache0
pavs@VAS:~$ tail /sys/block/bcache0/bcache/stats_total/*
==> /sys/block/bcache0/bcache/stats_total/bypassed <==
161G
==> /sys/block/bcache0/bcache/stats_total/cache_bypass_hits <==
4440257
==> /sys/block/bcache0/bcache/stats_total/cache_bypass_misses <==
0
==> /sys/block/bcache0/bcache/stats_total/cache_hit_ratio <==
69
==> /sys/block/bcache0/bcache/stats_total/cache_hits <==
1360041
==> /sys/block/bcache0/bcache/stats_total/cache_miss_collisions <==
426
==> /sys/block/bcache0/bcache/stats_total/cache_misses <==
587356
==> /sys/block/bcache0/bcache/stats_total/cache_readaheads <==
0
bcache1
pavs@VAS:~$ tail /sys/block/bcache1/bcache/stats_total/*
==> /sys/block/bcache1/bcache/stats_total/bypassed <==
0
==> /sys/block/bcache1/bcache/stats_total/cache_bypass_hits <==
0
==> /sys/block/bcache1/bcache/stats_total/cache_bypass_misses <==
0
==> /sys/block/bcache1/bcache/stats_total/cache_hit_ratio <==
0
==> /sys/block/bcache1/bcache/stats_total/cache_hits <==
0
==> /sys/block/bcache1/bcache/stats_total/cache_miss_collisions <==
0
==> /sys/block/bcache1/bcache/stats_total/cache_misses <==
0
==> /sys/block/bcache1/bcache/stats_total/cache_readaheads <==
0
bcache2
pavs@VAS:~$ tail /sys/block/bcache2/bcache/stats_total/*
==> /sys/block/bcache2/bcache/stats_total/bypassed <==
193G
==> /sys/block/bcache2/bcache/stats_total/cache_bypass_hits <==
4329693
==> /sys/block/bcache2/bcache/stats_total/cache_bypass_misses <==
0
==> /sys/block/bcache2/bcache/stats_total/cache_hit_ratio <==
74
==> /sys/block/bcache2/bcache/stats_total/cache_hits <==
1859198
==> /sys/block/bcache2/bcache/stats_total/cache_miss_collisions <==
232
==> /sys/block/bcache2/bcache/stats_total/cache_misses <==
650958
==> /sys/block/bcache2/bcache/stats_total/cache_readaheads <==
0
我是 bcache 的新手,所以我显然错过了一些东西,我错过了什么,请帮我找到解决方案。如果您需要更多信息,请告诉我。
答案1
找到了解决方案,显然我忘了像这样连接缓存设备:
echo UUID > /sys/block/bcache1/bcache/attach
现在它的缓存很好:
pavs@VAS:/home/pavs$ tail /sys/block/bcache1/bcache/stats_total/*
==> /sys/block/bcache1/bcache/stats_total/bypassed <==
106M
==> /sys/block/bcache1/bcache/stats_total/cache_bypass_hits <==
1624
==> /sys/block/bcache1/bcache/stats_total/cache_bypass_misses <==
0
==> /sys/block/bcache1/bcache/stats_total/cache_hit_ratio <==
0
==> /sys/block/bcache1/bcache/stats_total/cache_hits <==
0
==> /sys/block/bcache1/bcache/stats_total/cache_miss_collisions <==
0
==> /sys/block/bcache1/bcache/stats_total/cache_misses <==
345
==> /sys/block/bcache1/bcache/stats_total/cache_readaheads <==
0