#!/bin/bash # pvcreate /dev/sdb /dev/sdc /dev/sdd # vgcreate lvmraid /dev/sdb /dev/sdc /dev/sdd # lvcreate -n raid5 --type raid5 -i 2 -L 30G lvmraid /dev/sdb /dev/sdc /dev/sdd # lvconvert --raidintegrity y lvmraid/raid5 # mkfs.ext4 /dev/lvmraid/raid5 # mount /dev/lvmraid/raid5 /mnt/hd/ # lvm2-monitor.service On RHEL8 (CentOS8) you can add the VG activation to /etc/systemd/system/sysinit.target.wants/lvm2-monitor.service [Unit] Description=Monitoring of LVM2 mirrors, snapshots etc. using dmeventd or progress polling Documentation=man:dmeventd(8) man:lvcreate(8) man:lvchange(8) man:vgchange(8) Requires=dm-event.socket After=dm-event.socket dm-event.service lvm2-activation.service Before=local-fs-pre.target shutdown.target DefaultDependencies=no Conflicts=shutdown.target [Service] Type=oneshot Environment=LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES=1 ExecStart=/usr/sbin/lvm vgchange -ay ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ExecStart=/usr/sbin/lvm vgchange --monitor y ExecStop=/usr/sbin/lvm vgchange --monitor n RemainAfterExit=yes [Install] WantedBy=sysinit.target