我正在尝试在我现有的系统上设置Bcache (这很危险,但我们并不担心丢失任何数据)。因此,我的make和make安装工作正常,但是当我运行命令make-bcache时,我收到以下错误.The,与我尝试设置dm-cache .Can时收到的错误相同--请提出解决方案,我们在这里做错了吗?
[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。
发布于 2016-04-20 02:02:28
在/dev/sda2上设置了LVM,因此需要在逻辑卷(LV)上运行make-bcache,而不是在原始分区上运行。如果您希望同时使用centos-root和centos-home LV作为支持设备,而使用整个SSD作为缓存设备,则可以使用
make-bcache --bdev /dev/mapper/centos-root /dev/mapper/centos-home --cache /dev/sdb有关更多选项,请参见make-bcache --help。
您需要更新initramfs和and才能成功地启动。
我强烈建议阅读bcache的内核文档。
https://unix.stackexchange.com/questions/277676
复制相似问题