From 9328d38b07d1e12df34e6638cc61722a45a199a1 Mon Sep 17 00:00:00 2001 From: Peter Rival Date: Mon, 1 Nov 2021 22:02:18 -0400 Subject: [PATCH] Add wipefs -a to clear out partition tables If there is a partition table on the drive, pvcreate will fail and then everything after gets very confused. Use 'wipefs -a' to wipeout any existing partitions. --- lvm_create | 1 + 1 file changed, 1 insertion(+) diff --git a/lvm_create b/lvm_create index f0d5dab..c312358 100755 --- a/lvm_create +++ b/lvm_create @@ -106,6 +106,7 @@ seper="" for i in $devices_to_use; do lv_disks=${i}${seper}${lv_disks} size=`fdisk -l $i | grep bytes | grep Disk | cut -d' ' -f 5` + wipefs -a ${i} gb=`echo "$size/(1024*1024*1024)" | bc` let "lv_total_size=$lv_total_size+$gb" let "lv_disk_count=$lv_disk_count+1"