I am regarding to question: Improving IO with FlashCache

I have setup a RAID1 (/dev/md0) LVM (/dev/vg_xen) and executed following command:

flashcache_create -p thru flashcache0 /dev/sdc /dev/md0

Then I started a XEN PV guest, which uses /dev/vg_xen/vm0 as hard disk. After using it a while

cat /proc/flashcache/sdc\+md0/flashcache_stats

shows me

reads=0 writes=0

So, it does not work. What did I do wrong?


You should make sure that your LVM is using the /dev/mapper/flashcache0 device as its physical volume instead of using /dev/md0 directly (in the latter case flashcache would not be involved in the I/O code path at all).

See http://sf-alpha.bjgang.org/wordpress/2012/11/flashcache-initscripts/ for a handy script on how to set this up, if you have not done so yet. The basic outline would be:

  1. exclude /dev/md0 from being detected through LVM by adding filter = [ "r|/dev/md0|" ] and commenting out or removing filter = [ "a/.*/" ] (if present) from the devices{} section of your /etc/lvm/lvm.conf
  2. use the flashcache_create (or flashcache_load if using write-back caching mode) command to create your flashcache-backed device
  3. run vgscan to discover your volume group and activate it by issuing vgchange -ay vg_xen

For details on flashcache configuration, refer to the admin guide which came with your flashcache download.

  • flashcache_load : Load an existing writeback cache volume., but I am not using a writeback cache volume. – user1091344 May 31 '13 at 12:38
  • @JuanHynix My fault. It appears you have not reconfigured your LVM to be backed by the flashcache-created device, could you check that? – the-wabbit May 31 '13 at 13:19
  • Yes. You are right. I did not reconfigured it. I will try your new advice. – user1091344 May 31 '13 at 13:42
  • I did it again today. Now it works like you said. Thanks. – user1091344 Jun 7 '13 at 14:57

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.