1

I am trying to setup Bcache on my existing system(Its risky,but we are not worried about losing any data ) . So my make and make install works proper but when I run the command make-bcache i receive the below error .The same error I received when I try to setup dm-cache .Can any one please suggest any solutions ,are we doing any mistake here

[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

Below is config of my disk

[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

My SSD is present at /dev/sdb .

0

You have LVM set up on /dev/sda2, so you need to run make-bcache on the logical volumes (LVs) instead of the raw partition. If you want to use both the centos-root and centos-home LVs as backing devices and the entire SSD as a cache device, you can set this up with

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

See make-bcache --help for more options.

You will need to update your initramfs and fstab to boot succesfully.

I highly recommend reading the kernel documentation for bcache.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.