I'm running Ubuntu 12.04 and have just added 2 new hard drives into my server. The idea being that I would create a volume group that would include them and create a bunch of logical volumes on them that would be mirrored.I've partitioned the 2 drives to have a a primary partition on each of type 8E (LVM):/dev/sdc1            2048  3907029167  1953513560   8e  Linux LVM/dev/sdd1            2048  3907029167  1953513560   8e  Linux LVMThen added them as physical devices, created a volume group and added the to the volume group:--- Volume group ---VG Name               vmdataSystem ID             Format                lvm2Metadata Areas        2Metadata Sequence No  8VG Access             read/writeVG Status             resizableMAX LV                0Cur LV                0Open LV               0Max PV                0Cur PV                2Act PV                2VG Size               3.64 TiBPE Size               4.00 MiBTotal PE              953862Alloc PE / Size       0 / 0   Free  PE / Size       953862 / 3.64 TiBVG UUID               2zdfc7-1fj2-kMdy-7OUq-eadi-AsF2-Sujbes--- Physical volumes ---PV Name               /dev/sdc1     PV UUID               kAU93m-4S5V-MD1V-EkTA-m0u7-bmQn-3pyVmkPV Status             allocatableTotal PE / Free PE    476931 / 476931PV Name               /dev/sdd1     PV UUID               erVnaJ-vp5S-0LHW-oRSx-joer-VXPX-KG0uDbPV Status             allocatableTotal PE / Free PE    476931 / 476931When I try to create a new logical volume of type RAID 1 it fails:$ lvcreate --type raid1 -m 1 -L 64G -n fred vmdataWARNING: Unrecognised segment type raid1Insufficient suitable allocatable extents for logical volume : 16384 more requiredUnable to allocate extents for mirror(s).When I try to create it as a plain mirror it also fails:$ lvcreate -m 1 -L 64G -n fred vmdataInsufficient suitable allocatable extents for logical volume : 16384 more requiredUnable to allocate extents for mirror(s).What am I missing?
Why can't I create an LVM RAID1 or mirror volume?
ubuntu;lvm;mirror
Make sure that the RAID array is in an active state.Example$ lvscan  inactive          '/dev/kodak_vg/lvm0' [149.00 GB] inheritSo I ran this command to activate it:$ vgchange -ay  1 logical volume(s) in volume group kodak_vg now activeRe-running lvscan showed the LV as active now:$ lvscan  ACTIVE            '/dev/kodak_vg/lvm0' [149.00 GB] inheritValid segment typesBased on the error it sounds like perhaps something is amiss with your segment types.WARNING: Unrecognised segment type raid1You can use this command to find out what segment types are valid.$ sudo lvm segtypes  striped  zero  error  free  snapshot  mirror  raid1  raid10  raid4  raid5  raid5_la  raid5_ra  raid5_ls  raid5_rs  raid6  raid6_zr  raid6_nr  raid6_nc  thin-pool  thinUbuntu 12.04's version of LVM?The ability to create RAID's within LVM is a fairly new-ish feature, so I would suspect that 12.04's version of LVM just doesn't support this segment type.What to do?If this is the issue all is not lost. You can simply setup the LVM VG (Volume Group) on top of a MD (mdadm) RAID1.without LVM, just MDTutorial: mdadm Software RAID on Ubuntu / Debian Systemswith LVM + MDHow To Set Up Software RAID1 On A Running LVM System (Incl. GRUB2 Configuration) (Ubuntu 11.10)ReferencesWhat steps can I use to recover a RAID 1 array with LVM and EXT3 on it?4.4.15. RAID Logical VolumesRAID5 over LVM on Ubuntu Server 12.04.3