MD devices are not wiped if LVM exists

Jerry Steele ticktockhouse at gmail.com
Mon Jul 1 15:40:51 CEST 2019


This is my disk_config:

disk_config disk1
primary - 350 - -
primary swap 2G swap sw,pri=1
primary - 0- - -

disk_config disk2 sameas:disk1

disk_config raid fstabkey:uuid
raid1 /boot disk1.1,disk2.1 ext4 rw,noatime,errors=remount-ro
raid1 - disk1.3,disk2.3 - -

disk_config lvm fstabkey:uuid
vg vg_system md1
vg_system-root / 8G ext4 rw,noatime
vg_system-var /var 8G- ext4 rw,noatime

If FAI is run against this machine again after its 1st install, I get the
following error:

Using config file: /var/lib/fai/config/disk_config/LVMRAID1
  WARNING: Failed to connect to lvmetad. Falling back to device scanning.
    Creating directory "/run/lock/lvm"
    No volume groups found.
Executing: mdadm --stop --scan
Executing: mdadm --assemble --scan --config=/tmp/fai/mdadm-from-examine.conf
Executing: mdadm -W --stop /dev/md0
Executing: mdadm -W --stop /dev/md1
(STDERR) mdadm: Cannot get exclusive access to /dev/md1:Perhaps a running
process, mounted filesystem or active volume group?
Command had non-zero exit code

It's enough to do:

# vgremove -y  vg_system

...which removes the LVM metadata and on the next install, FAI is able to
partition the disks as needed. Is there a way to run this command before
the disk_config stuff is run? Obviously the custom scripts are run well
after this point. Or is there something built into FAI to completely wipe
LVM data before attempting to wipe the MD devices?

Thanks in advance

-- 
---

Jerry Steele
Telephone: +44 (0)7492 910225
GPG: 43A3A8C6
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.uni-koeln.de/pipermail/linux-fai/attachments/20190701/8a4d8772/attachment.html>


More information about the linux-fai mailing list