As announced in the previous post, I bought 4 used disks from eBay and inserted them into the machine. This is the synopsis of creating a RAID5 volume, put it into an LVM volume group, and assign that VG to libvirt. Libvirt can then create logical volumes in that VG, and attach them the virtual machines.
A Debian configuration guide I followed:
https://debian-handbook.info/browse/stable/advanced-administration.html#sect.raid-and-lvm
Checking the presence of the new SATA disks in the system:
root@PANICLOUD:/home/nicky# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
fd0 2:0 1 4K 0 disk
sda 8:0 0 232.9G 0 disk
└─sda1 8:1 0 232.9G 0 part
└─md0 9:0 0 465.5G 0 raid0
├─md0p1 259:0 0 243.1M 0 md /boot
├─md0p2 259:1 0 1K 0 md
└─md0p5 259:2 0 465.3G 0 md
├─PANICLOUD--vg-root 253:0 0 9.3G 0 lvm /
├─PANICLOUD--vg-swap_1 253:1 0 18.1G 0 lvm [SWAP]
├─PANICLOUD--vg-home 253:2 0 100G 0 lvm /home
├─PANICLOUD--vg-images 253:3 0 100G 0 lvm /opt/images
└─PANICLOUD--vg-instances 253:4 0 100G 0 lvm /opt/instances
sdb 8:16 0 232.9G 0 disk
└─sdb1 8:17 0 232.9G 0 part
└─md0 9:0 0 465.5G 0 raid0
├─md0p1 259:0 0 243.1M 0 md /boot
├─md0p2 259:1 0 1K 0 md
└─md0p5 259:2 0 465.3G 0 md
├─PANICLOUD--vg-root 253:0 0 9.3G 0 lvm /
├─PANICLOUD--vg-swap_1 253:1 0 18.1G 0 lvm [SWAP]
├─PANICLOUD--vg-home 253:2 0 100G 0 lvm /home
├─PANICLOUD--vg-images 253:3 0 100G 0 lvm /opt/images
└─PANICLOUD--vg-instances 253:4 0 100G 0 lvm /opt/instances
sdg 8:96 0 931.5G 0 disk
sdh 8:112 0 931.5G 0 disk
sdi 8:128 0 931.5G 0 disk
sdj 8:144 0 931.5G 0 disk
Creating the RAID5 volume:
root@PANICLOUD:/home/nicky# mdadm --create /dev/md1 --level=5 --raid-devices=4 /dev/sdg /dev/sdh /dev/sdi /dev/sdj
Creating the LVM phyiscal volume:
root@PANICLOUD:/home/nicky# pvcreate /dev/md1
Physical volume "/dev/md1" successfully created
root@PANICLOUD:/home/nicky# pvdisplay
--- Physical volume ---
PV Name /dev/md0p5
VG Name PANICLOUD-vg
PV Size 465.28 GiB / not usable 2.02 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 119110
Free PE 35298
Allocated PE 83812
PV UUID UdCEwD-mlv1-EuIw-L0jc-lrgK-QGjX-RM1AdD
“/dev/md1” is a new physical volume of “2.73 TiB”
— NEW Physical volume —
PV Name /dev/md1
VG Name
PV Size 2.73 TiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID FRsRMz-6HNs-S6d6-QXOw-beOf-DbB8-MGuLu1
Creating the volume group:
root@PANICLOUD:/home/nicky# vgcreate PANICLOUD_STORAGE-vg /dev/md1
Volume group "PANICLOUD_STORAGE-vg" successfully created
root@PANICLOUD:/home/nicky# vgdisplay
--- Volume group ---
VG Name PANICLOUD-vg
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 9
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 5
Open LV 5
Max PV 0
Cur PV 1
Act PV 1
VG Size 465.27 GiB
PE Size 4.00 MiB
Total PE 119110
Alloc PE / Size 83812 / 327.39 GiB
Free PE / Size 35298 / 137.88 GiB
VG UUID nWgVHx-Xuq9-AGAh-iI6g-4DoR-HcIn-Nq1WhR
— Volume group —
VG Name PANICLOUD_STORAGE-vg
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 2.73 TiB
PE Size 4.00 MiB
Total PE 715305
Alloc PE / Size 0 / 0
Free PE / Size 715305 / 2.73 TiB
VG UUID AmZ7Yx-4p37-ZgLy-wIvC-1pOU-wdwP-JK64m1
Make sure that afterwards you run “updateinitramfs -u” so that the RAID array is assembled again after a reboot of the machine.
This guide summarizes the process to assign the volume group to libvirt with virt-manager.