6.4. Creating RAID logical volumes
You can create RAID1 arrays with multiple numbers of copies, according to the value you specify for the -m argument. Similarly, you can specify the number of stripes for a RAID 0, 4, 5, 6, and 10 logical volume with the -i argument. You can also specify the stripe size with the -I argument. The following procedure describes different ways to create different types of RAID logical volume.
Procédure
Create a 2-way RAID. The following command creates a 2-way RAID1 array, named my_lv, in the volume group my_vg, that is 1G in size:
lvcreate --type raid1 -m 1 -L 1G -n my_lv my_vg
# lvcreate --type raid1 -m 1 -L 1G -n my_lv my_vg Logical volume "my_lv" created.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a RAID5 array with stripes. The following command creates a RAID5 array with three stripes and one implicit parity drive, named my_lv, in the volume group my_vg, that is 1G in size. Note that you can specify the number of stripes similar to an LVM striped volume. The correct number of parity drives is added automatically.
lvcreate --type raid5 -i 3 -L 1G -n my_lv my_vg
# lvcreate --type raid5 -i 3 -L 1G -n my_lv my_vgCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a RAID6 array with stripes. The following command creates a RAID6 array with three 3 stripes and two implicit parity drives, named my_lv, in the volume group my_vg, that is 1G one gigabyte in size:
lvcreate --type raid6 -i 3 -L 1G -n my_lv my_vg
# lvcreate --type raid6 -i 3 -L 1G -n my_lv my_vgCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Vérification
- Display the LVM device my_vg/my_lv, which is a 2-way RAID1 array: