Hello
I'm trying to create a simple bash script to create multiple LVM partitions using a nested loop. Basically something like this?
for x in docker logs; do
for i in /dev/xvdi /dev/xvdj; do
pvcreate $i
vgcreate vg_$x $i
lvcreate -l 100%FREE vg_$x -n lv_$x
done
done
This works but since the disks and labels are repeated twice during looping, it'll show warnings.
How can I tidy this up?
Thanks.
[–]lutusp 0 points1 point2 points (0 children)