4.1. LVM 2 FAQ

4.1.1. I have LVM 1 installed and running on my system. How do I start using LVM 2?
4.1.2. I get errors about /dev/mapper/control when I try to use the LVM 2 tools. What's going on?
4.1.3. Which commands and types of logical volumes are currently supported in LVM 2?
4.1.4. Does LVM 2 use a different format from LVM 1 for it's ondisk representation of Volume Groups and Logical Volumes?
4.1.5. Does LVM 2 support VGs and LVs created with LVM 1?
4.1.6. Can I upgrade my LVM 1 based VGs and LVs to LVM 2 native format?
4.1.7. I've upgraded to LVM 2, but the tools keep failing with out of memory errors. What gives?

4.1.1. I have LVM 1 installed and running on my system. How do I start using LVM 2?

Here's the Quick Start instructions :)

  1. Start by removing any snapshot LVs on the system. These are not handled by LVM 2 and will prevent the origin from being activated when LVM 2 comes up.

  2. Make sure you have some way of booting the system other than from your standard boot partition. Have the LVM 1 tools, standard system tools (mount) and an LVM 1 compatible kernel on it in case you need to get back and fix some things.

  3. Grab the LVM 2 tools source and the device mapper source and compile them. You need to install the device mapper library using "make install" before compiling the LVM 2 tools. Also copy the dm/scripts/devmap_mknod.sh script into /sbin. I recommend only installing the 'lvm' binary for now so you have access to the LVM 1 tools if you need them. If you have access to packages for LVM 2 and device-mapper, you can install those instead, but beware of them overwriting your LVM 1 tool set.

  4. Get a device mapper compatible kernel, either built in or as a kernel module.

  5. Figure out where LVM 1 was activated in your startup scripts. Make sure the device-mapper module is loaded by that point (if you are using device mapper as a module) and add '/sbin/devmap_mknod.sh; lvm vgscan; lvm vgchange -ay' afterward.

  6. Install the kernel with device mapper support in it. Reboot. If all goes well, you should be running with lvm2.

4.1.2. I get errors about /dev/mapper/control when I try to use the LVM 2 tools. What's going on?

The primary cause of this is not having run the devmap_mknod.sh script after rebooting into a dm capable kernel. This script generates the control node for device mapper.

4.1.3. Which commands and types of logical volumes are currently supported in LVM 2?

If you are using the stable 2.4 device mapper patch from the lvm2 tarball, all the major functionality you'd expect using lvm1 is supported with the lvm2 tools. (You still need to remove snapshots before upgrading from lvm1 to lvm2)

If you are using the version of device mapper in 2.6.5 and below, the following commands and LV types are not supported:

  • pvmove

  • snapshots

The beginnings of support for these features is in the unstable device mapper patches maintained by Joe Thornber.

4.1.4. Does LVM 2 use a different format from LVM 1 for it's ondisk representation of Volume Groups and Logical Volumes?

Yes. LVM 2 uses lvm 2 format metadata. This format is much more flexible than the LVM 1 format metadata, removing or reducing most of the limitations LVM 1 had.

4.1.5. Does LVM 2 support VGs and LVs created with LVM 1?

Yes. LVM 2 will activate and operate on VG and LVs created with LVM 1. The exception to this is snapshots created with LVM 1 - these should be removed before upgrading. Snapshots that remain after upgrading will have to be removed before their origins can be activated by LVM 2.

4.1.6. Can I upgrade my LVM 1 based VGs and LVs to LVM 2 native format?

Yes. Use vgconvert to convert your VG and all LVs contained within it to the new lvm 2 format metadata. Be warned that it's not always possible to revert back to lvm 1 format metadata.

4.1.7. I've upgraded to LVM 2, but the tools keep failing with out of memory errors. What gives?

One possible cause of this is that some versions of LVM 1 (The user that reported this bug originally was using Mandrake 9.2, but it is not necessarily limited to that distribution) did not put a UUID into the PV and VG structures as they were supposed to. The most current versions of the LVM 2 tools automatically fill UUIDs in for the structures if they see they are missing, so you should grab a more current version and your problem should be solved. If not, post to the linux-lvm mailing list