centOS에 Bcache를 설치하는 중에 오류가 발생했습니다.

centOS에 Bcache를 설치하는 중에 오류가 발생했습니다.

기존 시스템에 Bcache를 설정하려고 합니다(위험하지만 데이터 손실에 대해 걱정하지 않습니다). 따라서 make 및 make install은 제대로 작동하지만 make-bcache 명령을 실행하면 다음 오류가 발생합니다. dm-cache를 설정하려고 하면 동일한 오류가 발생합니다. 누구든지 해결책을 제안할 수 있나요? 여기서 우리가 실수한 걸까요?

[root@x130-65-157-206 bcache-tools]# make-bcache -B /dev/sda2
Can't open dev /dev/sda2: Device or resource busy 

[root@x130-65-157-206 bcache-tools]# make-bcache -B /dev/sda
Can't open dev /dev/sda: Device or resource busy

아래는 내 디스크 구성입니다

[root@x130-65-157-206 bcache-tools]# fdisk -l

Disk /dev/sda: 498.8 GB, 498753077248 bytes, 974127104 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
Disk label type: dos
Disk identifier: 0x00036dc2

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048   974127103   486550528   8e  Linux LVM

Disk /dev/mapper/centos-root: 53.7 GB, 53687091200 bytes, 104857600 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


Disk /dev/mapper/centos-swap: 8455 MB, 8455716864 bytes, 16515072 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


Disk /dev/mapper/centos-home: 436.0 GB, 436014678016 bytes, 851591168 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


Disk /dev/sdb: 31.4 GB, 31376707072 bytes, 61282631 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

내 SSD는 /dev/sdb에 있습니다.

답변1

에 LVM이 설정되어 있으므로 원시 파티션이 아닌 LV(논리 볼륨)에서 실행 /dev/sda2해야 합니다 . LV를 백업 장치로 사용 하고 SSD 전체를 캐시 장치로 make-bcache사용하려면 다음 명령을 사용하여 설정할 수 있습니다.centos-rootcentos-home

make-bcache --bdev /dev/mapper/centos-root /dev/mapper/centos-home --cache /dev/sdb

추가 옵션 은 리소스를 참조하세요 make-bcache --help.

성공적인 부팅을 위해서는 initramfs 및 fstab을 업데이트해야 합니다.

나는 독서를 적극 권장합니다bcache에 대한 커널 문서.

관련 정보