You are hereUsing lvm only on specific drives (Reading all physical volumes. This may take a while...)

Using lvm only on specific drives (Reading all physical volumes. This may take a while...)


By thomas - Posted on 01 July 2009

On our kvm hypervisor we have several vm's using fibre channel for storage. The hypervisor has to see all the devices, but each device has it's own lvm so when the hypervisor boots, it tries to read all of them.

To fix this i restricted lvm to only use sda (documented in lvm.conf). If you are stuck at the vgscan stage
Reading all physical volumes. This may take a while...
Then you probably need to do something similar to this. devices { dir = "/dev" scan = [ "/dev" ] preferred_names = [ ] filter = [ "a|/dev/sda.*|", "r|.*|" ] } The filter line is the important one. After that you'll need to rebuild initrd to pickup the modified lvm.conf. I usually cheat and use the kernel's method for that. [root@server0 lvm]# rpm -q kernel --scripts |grep mkinitrd /sbin/new-kernel-pkg --package kernel --mkinitrd --depmod --install 2.6.18-128.1.16.el5 || exit $? [root@server0 lvm]# Hope that helps.

Our systems are RedHat/Fedora/Centos based, the vgscan is issued from the initrd on our distro, so it should be in the initramfs on yours. This is because the system needs to do the vgscan to find the lvm's and mount '/' before it can read '/etc/init.d/lvm2'. On our system the /etc/lvm/lvm.conf is picked up by the call to mkinitrd, I assume something similar will happen on debian (I don't know much about debian, sorry), maybe check how the system updates itself after a kernel upgrade.

Hi!

I am using Debian ... it looks like the vgscan is issued in /etc/init.d/lvm2. Do you have any idea if I also have to update the initramfs?

Alex

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options