0

I've added a 2 TB RAID1 SSD as a writeback cache to a 10 TB RAID1 HDD using LVM 2.03.11(2) (2021-01-08) like this:

lvcreate --type raid1 --mirrors 1 --nosync -l 100%FREE -n sshd sshd /dev/sdc /dev/sdd
lvcreate --type raid1 --mirrors 1 --nosync -l 100%FREE -n cache sshd /dev/nvme1n1 /dev/ssd_blend/ssd_blend
lvconvert --type cache --cachemode writeback --chunksize 2M --cachevol cache sshd/sshd

and the default behavior is slowly promoting new blocks. I want it to behave more like a writecache, where blocks are from the start written to the cache and later on moved to the slow disk. I want cached what was written last, regardless of the hit count.
I don't want to use writecache though, because I also want read cache.

Is there a way to do that?
I tried

lvchange --cachepolicy smq --cachesettings 'write_promote_adjustment=0' sshd

but doesn't do anything.

Chris
  • 260
  • 1
  • 4
  • 15
  • I believe what you are looking for is indeed LVM `writecache`. As I understand it, data that hasn't yet been evicted to the slow drive will be served directly from the cache during read operations. – mikabytes Jun 07 '22 at 19:43

0 Answers0