Personal tools
You are here: Home Linux I/O Manually creating a MD device (Linux software RAID array) and using LVM to allocate volumes
 

Manually creating a MD device (Linux software RAID array) and using LVM to allocate volumes

Creating an array for VM's with 6 disks.

 

Partition the physical disk drives with a single partition of type 'Linux raid autodetect' (0xfd). Using 'whole devices' (i.e. without a partition table) leads to subtle problems, including the MD device not being assembled during boot (which might be a problem if the disk is required during booting).

Create a md device (/dev/md2 in this case, because I already had md0 and md1)

# mdadm --create /dev/md2 --level=6 --raid-devices=6 /dev/sd[o-t]1

Put LVM on top of the RAID 6 MD device, and create a volume group just for that phyisical volume. I called the volume group '1TBx6r6'.

# pvcreate /dev/md2
  Physical volume "/dev/md2" successfully created
# vgcreate 1TBx6r6 /dev/md2
  Volume group "1TBx6r6" successfully created
# vgchange -a y 1TBx6r6
  0 logical volume(s) in volume group "1TBx6r6" now active

Add logical volumes as required until the space runs out.

# lvcreate -n <name> -L <size> 1TBx6r6

 

Outstanding

No consideration has been taken into account about stripe sizes on the MD/RAID device (mdadm --chunk option), at the LVM level, and the interaction between them. If absolute performance is important then this should be researched.

Links

 

Document Actions