Package: fai-setup-storage Version: 5.8.4 Severity: normal Tags: upstream TLDR: setup-storage fails to remove existing RAID device if a LVM volume is active on it. I have a machine with 2 hard drives (vda and vdb) I use the following setup-storage configuration file: disk_config disk1 bootable:1 disklabel:gpt-bios primary - 0- - - disk_config disk2 sameas:disk1 # disk_config raid fstabkey:label raid1 - disk1.1,disk2.1 - - # disk_config lvm fstabkey:label vg vg0 md0 # vg0-root / 0- xfs rw createopts="-f -L SYSTEM" which create a raid device using both drives and create a LVM root partition. and it works well on blank drives: Starting setup-storage 2.2 Using config file: raid+lvm.conf Parted could not read a disk label (new disk?) Executing: parted -s /dev/vda mklabel gpt Parted could not read a disk label (new disk?) Executing: parted -s /dev/vdb mklabel gpt No volume groups found. Executing: parted -s /dev/vdb mklabel gpt Executing: parted -s /dev/vdb mkpart primary "" 2097152B 8588869119B Executing: parted -s /dev/vdb set 1 boot on Executing: parted -s /dev/vdb mkpart primary "" 1048576B 2097151B Executing: parted -s /dev/vdb set 2 bios_grub on Executing: parted -s /dev/vda mklabel gpt Executing: parted -s /dev/vda mkpart primary "" 2097152B 8588869119B Executing: parted -s /dev/vda set 1 boot on Executing: parted -s /dev/vda mkpart primary "" 1048576B 2097151B Executing: parted -s /dev/vda set 2 bios_grub on Executing: parted -s /dev/vdb set 1 raid on Executing: parted -s /dev/vda set 1 raid on Executing: yes | mdadm --create /dev/md0 --level=raid1 --force --run --raid-devices=2 /dev/vdb1 /dev/vda1 Executing: pvcreate -ff -y /dev/md0 Executing: vgcreate vg0 /dev/md0 Executing: vgchange -a y vg0 Executing: lvcreate --yes -n root -L 8107.09404785156 vg0 Executing: mkfs.xfs -f -L SYSTEM /dev/vg0/root /dev/vg0/root UUID=b954ef19-8691-4884-9bcc-b34f1a0ca37b /dev/vg0/root LABEL=SYSTEM Now if for some reason I have to re-run the script I have: Starting setup-storage 2.2 Using config file: raid+lvm.conf Executing: wipefs -af /dev/vda2 Executing: wipefs -af /dev/vdb2 Executing: mdadm --stop --scan (STDERR) mdadm: Cannot get exclusive access to /dev/md0:Perhaps a running process, mounted filesystem or active volume group? Command had non-zero exit code The only way to get rid of this error is to run: dmsetup --noheadings info -C -o name | xargs --no-run-if-empty dmsetup remove mdadm --stop --scan /usr/lib/fai/fai-disk-info | sed 's,^,/dev/,' | xargs wipefs -af /usr/lib/fai/fai-disk-info | sed 's,^,of=/dev/,' | xargs -n1 dd if=/dev/zero bs=1k count=10240 partprobe -s
Did I miss something? TIA