[draft]PVE 上建立 bcache 方式

  • PVE 版本 : 6.3-3
  • 使用 /dev/mmcblk1 當 cache 碟來加速 /dev/sdc
  • apt-get install bcache-tools
    wipefs /dev/mmcblk1
    wipefs -a /dev/mmcblk1
    wipefs /dev/sdc
    wipefs -a /dev/sdc

  • make-bcache -B /dev/sdc -C /dev/mmcblk1
    bcache-super-show /dev/mmcblk1

  • 應該要出現類似以下訊息:

    [email protected]:~# bcache-super-show /dev/mmcblk1
    sb.magic                ok
    sb.first_sector         8 [match]
    sb.csum                 ADD0A846D489C6D0 [match]
    sb.version              0 [cache device]
    
    dev.label               (empty)
    dev.uuid                f33fe947-d4bc-43b3-9fe2-c6b45b791f0b
    dev.sectors_per_block   1
    dev.sectors_per_bucket  1024
    dev.cache.first_sector  1024
    dev.cache.cache_sectors 122141696
    dev.cache.total_sectors 122142720
    dev.cache.ordered       no
    dev.cache.discard       no
    dev.cache.pos           0
    dev.cache.replacement   0 [lru]
    
    cset.uuid               4db271ee-b057-4ae7-a727-a7f90dc700d7

  • 將 cset.uuid 設定到 /sys/block/bcache0/bcache/attach

    echo "4db271ee-b057-4ae7-a727-a7f90dc700d7" > /sys/block/bcache0/bcache/attach

  • tech/pve_bcache.txt
  • 上一次變更: 2021/01/17 00:05
  • jonathan