Description of problem: [root@hayes-03 ~]# lvcreate --wipesignatures y -L 4G -n single writecache_sanity @slow Logical volume "single" created. [root@hayes-03 ~]# lvs -a -o +devices,segtype LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert Devices Type single writecache_sanity -wi-a----- 4.00g /dev/sde1(0) linear # I don't want to use all ~1860G [root@hayes-03 ~]# lvconvert --type writecache --cachedevice /dev/sdn1 --cachedevice /dev/sdm1 writecache_sanity/single Use all <930.76 GiB from /dev/sdn1 for cache? [y/n]: n Use --cachesize SizeMB to use a part of the cachedevice. Conversion aborted. [root@hayes-03 ~]# lvconvert --type writecache --cachedevice /dev/sdn1 --cachesize 2G --cachedevice /dev/sdm1 --cachesize 2G writecache_sanity/single Option --cachesize may not be repeated. Error during parsing of command line. # Using the entirety of the devices results in the process being killed due to bug 1855038, and you end up with unused "_cache" devices [root@hayes-03 ~]# lvconvert --type writecache --cachedevice /dev/sdn1 --cachedevice /dev/sdm1 --cachesize 1800G writecache_sanity/single Creating cachevol LV single_cache with size <1.76 TiB. Logical volume "single_cache" created. Using writecache block size 512 for unknown file system block size, logical block size 512, physical block size 4096. Killed [root@hayes-03 ~]# lvs -a -o +devices,segtype LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert Devices Type single writecache_sanity -wi-a----- 4.00g /dev/sde1(0) linear single_cache writecache_sanity -wi------- <1.76t /dev/sdn1(0) linear single_cache writecache_sanity -wi------- <1.76t /dev/sdm1(0) linear [root@hayes-03 ~]# lvremove -f writecache_sanity/single_cache Logical volume "single_cache" successfully removed [root@hayes-03 ~]# lvconvert --type writecache --cachedevice /dev/sdn1 --cachedevice /dev/sdm1 --cachesize 8G writecache_sanity/single Creating cachevol LV single_cache with size 8.00 GiB. Logical volume "single_cache" created. Using writecache block size 512 for unknown file system block size, logical block size 512, physical block size 4096. device-mapper: create ioctl on writecache_sanity-single_cache_cvol LVM-e3lLEZuDwfJugVxfuQk08fHYybd1YF9aH60NmP2roHij0T43mUIxZy0Oaoc09Nzw-cvol failed: Device or resource busy Failed to suspend logical volume writecache_sanity/single. # Reboot to get around the issues caused above... # Using less space than the first device has will result in dropping the second device on the floor [root@hayes-03 ~]# lvconvert --type writecache --cachedevice /dev/sdn1 --cachedevice /dev/sdm1 --cachesize 8G writecache_sanity/single Creating cachevol LV single_cache with size 8.00 GiB. Logical volume "single_cache" created. Using writecache block size 512 for unknown file system block size, logical block size 512, physical block size 4096. Logical volume writecache_sanity/single now has writecache. [root@hayes-03 ~]# lvs -a -o +devices LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert Devices single writecache_sanity Cwi-a-C--- 4.00g [single_cache_cvol] [single_wcorig] 0.00 single_wcorig(0) [single_cache_cvol] writecache_sanity Cwi-aoC--- 8.00g /dev/sdn1(0) [single_wcorig] writecache_sanity owi-aoC--- 4.00g /dev/sde1(0) Version-Release number of selected component (if applicable): kernel-4.18.0-221.el8 BUILT: Thu Jun 25 16:28:39 CDT 2020 lvm2-2.03.09-3.el8 BUILT: Mon Jun 29 13:50:23 CDT 2020 lvm2-libs-2.03.09-3.el8 BUILT: Mon Jun 29 13:50:23 CDT 2020 lvm2-dbusd-2.03.09-3.el8 BUILT: Mon Jun 29 13:53:38 CDT 2020 lvm2-lockd-2.03.09-3.el8 BUILT: Mon Jun 29 13:50:23 CDT 2020 boom-boot-1.2-2.el8 BUILT: Mon Jun 29 08:27:02 CDT 2020 device-mapper-1.02.171-3.el8 BUILT: Mon Jun 29 13:50:23 CDT 2020 device-mapper-libs-1.02.171-3.el8 BUILT: Mon Jun 29 13:50:23 CDT 2020 device-mapper-event-1.02.171-3.el8 BUILT: Mon Jun 29 13:50:23 CDT 2020 device-mapper-event-libs-1.02.171-3.el8 BUILT: Mon Jun 29 13:50:23 CDT 2020
--cachesize is the size of the cachevol to be created. --cachedevice's are the PVs that the cachevol can be allocated from.