Linux RAID Smackdown: Crush RAID 5 with RAID 10 - Page 2
Create LVM Group and Volumes
Now we'll put a LVM group and volumes on /dev/md1. I use vg- for volume group names and lv- for the logical volumes in the volume groups. Using descriptive names, like lv-home, will save your sanity later when you're creating filesystems and mountpoints. The -L option specifies the size of the volume:
# pvcreate /dev/md1
# vgcreate vg-server1 /dev/md1
# lvcreate -L4g -nlv-home vg-server1
# lvcreate -L2g -nlv-var vg-server1
# lvcreate -L1g -nlv-tmp vg-server1
You'll get confirmations for every command, and you can use vgdisplay and lvdisplay to see the fruits of your labors. Use vgdisplay to see how much space is left.
- Select "Configure Software RAID".
- The next screen says it needs to format the swap partitions, and then configure RAID. Say Yes.
- The next screen is the Multidisk (MD) and software RAID configuration menu. Select "Finish."
- Now you're back at the main partitioning screen, with both of your RAID arrays visible. They are both labeled as RAID 1, but don't worry, the second one is really RAID 10. Now select "Configure the Logical Volume Manager".
- The next screen tells you that the partition table for RAID 1 device #1 has changed, write the changes to disks and configure LVM? Say Yes.
- The next screen warns you that the kernel cannot read the partition table on /dev/md1. This is not a problem—select "Continue".
- The next screen informs you that "1 existing volume groups have been found. Activate existing volume groups?" Yes indeedy!
- The next screen gives you a summary of your LVM setup, and there are options for viewing configuration details and your logical volumes. Select "Finish" when you're done looking.
- You'll be returned to the main partitioning screen, which now shows all of your RAID arrays and LVM volumes. Select them one at a time, and put filesystems and mountpoints on them. The partitioning/formatting screen defaults to "Use as: do not use". Select this, select the filesystem you want to use, say yes to formatting it, and select the mountpoint.
- Once you're finished with formatting and mountpoints, the installation continues in the normal fashion.
Next week we'll go into detail on monitoring and managing RAID and LVM. If you need to do-over, see the LVM Howto to learn how to delete LVM volumes. Use mdadm --zero-superblock /dev/[partition name] to erase RAID volumes.