<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    So, I ended up with the following setup:<br>
    <br>
    <ul>
      <li>Modified /etc/init.d/lvm2 to explicitly deactivate logical
        volumes: <em>lvm lvchange -a n --select name=~.*</em></li>
      <ul>
        <li>Create<em> </em><em>/lvm2-clean-shutdown </em>if
          deactivation is successful.<em></em></li>
      </ul>
      <li>Turn off automatic LV activation by setting<em> </em><em>auto_activation_volume_list=[]</em>
        in <em>/etc/lvm/lvm.conf</em></li>
      <li>Try to activate LVs later in the boot only if<em> </em><em></em><em>/lvm2-clean-shutdown
        </em>exists.<em></em></li>
    </ul>
    <p>This way I have the chance to try manual activation of the
      volumes in the case of unclean shutdown, or eventually uncache and
      recreate caches if flush/refresh appears to take too much time.</p>
    <p>One strange thing is that while testing I forgot to set <em>auto_activation_volume_list=[]
      </em>and<em> </em>boot process got stuck at an very early stage –
      probably at udev activating lvm <i><em>(</em></i><em>/sbin/lvm
        pvscan --cache --activate ay</em> from <em>/lib/udev/rules.d/69-lvm-metad.rules).</em><em></em>
      I waited for about five minutes but it didn't look like it's going
      to finish anytime soon, and I had no tty (too early in the boot),
      so I did reboot with a rescue CD and turned off LV auto activation
      in lvm.conf. This time the system came up quickly and the odd
      thing is that manual <i>lvchange -ay</i> was pretty fast - less
      that a minute for all 12 × 60GB caches. So, maybe there's a bug in
      <i>udev/pvscan --activate</i>?</p>
    <p>Anyway, the above setup seems to work well for me, so I'm
      sticking with it for the time being.</p>
    <p>Best regards,<br>
      Teodor<br>
    </p>
  </body>
</html>