[linux-lvm] lvm cache on debian 8, missing cache information

Manuel Bernal Llinares mbdebian at gmail.com
Mon Mar 21 13:30:58 UTC 2016

Hi guys,

I’m trying to set up lvmcache for a backup volume I use for time machine.

I’ve seen there is quite a lot of very good documentation about this, but also out of sync between different linux systems, e.g. I can’t get those cache* attributes when running lvs on debian 8.

As you can see under this lines, “tmachine” is a cached LVM volume
# lvs -a
  LV                     VG          Attr       LSize   Pool           Origin           Data%  Meta%  Move Log Cpy%Sync Convert
  backups                blackhole   -wi-ao----   5,00t                                                                       
  clasificador           blackhole   -wi-ao----   1,00t                                                                       
  [lvol0_pmspare]        blackhole   ewi------- 592,00m                                                                       
  nfs_home               blackhole   -wi-ao----   1,00t                                                                       
  tmachine               blackhole   Cwi-aoC---   3,00t tmachine_cache [tmachine_corig]                                       
  tmachine_cache         blackhole   Cwi---C--- 231,67g                                                                       
  [tmachine_cache_cdata] blackhole   Cwi-ao---- 231,67g                                                                       
[tmachine_cache_cmeta] blackhole   ewi-ao---- 592,00m                                                                       
  [tmachine_corig]       blackhole   owi-aoC---   3,00t                                                                       

Even with a couple of mac computers sending its time machine data for a while, the cache seems to not be working.

This are the parameters described by “dmsetup status” when run on that volume:

# dmsetup status /dev/blackhole/tmachine 
0 6442450944 cache 8 12849/151552 128 11886/3795648 17772 177033 2798405 1620326 0 3856 1 1 writeback 2 migration_threshold 2048 mq 10 random_threshold 4 sequential_threshold 512 discard_promote_adjustment 1 read_promote_adjustment 4 write_promote_adjustment 8

I’ve tested another cache alternative (flashcache) before, and the parameter "sequential_threshold” sounds familiar to me, I suspect it is the one making the cache flag the data transfer as “sequential”, passing it through to the backend (slow) device, instead of using the cache to absorb the writing traffic, and clean dirty blocks later, behavior I saw when using flashcache.

“sequential_threshold” is configured, by default, with a value of 512, but I haven’t been able to find what’s that 512, maybe extents, bytes, kb, mb? Unfortunately, I haven’t been able to find a way, at least in Debian, to change those parameters, neither creating the cache nor once it’s already been created.

Any ideas?

Thank you for your help guys!!!

Manuel Bernal Llinares
mbdebian at gmail.com
M.Sc. in Computer Science

More information about the linux-lvm mailing list