Commit ff0d5028 authored by David Johnson's avatar David Johnson

Prefer the compute node vgcreate strategy on ctl over mkextrafs.

parent 687d4e28
......@@ -57,6 +57,26 @@ if [ $? -eq 0 ]; then
echo "LVM=1" >> $LOCALSETTINGS
elif [ -z "$LVM" ] ; then
LVM=1
DONE=0
#
# See if we can try to use an LVM instead of just the 4th partition.
#
lsblk -n -P -o NAME,FSTYPE,MOUNTPOINT,PARTTYPE,PARTUUID,TYPE,PKNAME | perl -e 'my %devs = (); while (<STDIN>) { $_ =~ s/([A-Z0-9a-z]+=)/;\$$1/g; eval "$_"; if (!($TYPE eq "disk" || $TYPE eq "part")) { next; }; if (exists($devs{$PKNAME})) { delete $devs{$PKNAME}; } if ($FSTYPE eq "" && $MOUNTPOINT eq "" && ($PARTTYPE eq "" || $PARTTYPE eq "0x0")) { $devs{$NAME} = "/dev/$NAME"; } }; print join(" ",values(%devs))."\n"' > /tmp/devs
DEVS=`cat /tmp/devs`
if [ -n "$DEVS" ]; then
pvcreate $DEVS && vgcreate $VGNAME $DEVS
if [ ! $? -eq 0 ]; then
echo "ERROR: failed to create PV/VG with '$DEVS'; falling back to mkextrafs.pl"
vgremove $VGNAME
pvremove $DEVS
DONE=0
else
DONE=1
fi
fi
if [ $DONE -eq 0 ]; then
MKEXTRAFS_ARGS="-l -v ${VGNAME} -m util -z 1024"
# On Cloudlab ARM machines, there is no second disk nor extra disk space
# Well, now there's a new partition layout; try it.
......@@ -94,6 +114,8 @@ elif [ -z "$LVM" ] ; then
LVM=0
fi
fi
fi
# Get integer total space (G) available.
VGTOTAL=`vgs -o vg_size --noheadings --units G $VGNAME | sed -ne 's/ *\([0-9]*\)[0-9\.]*G/\1/p'`
echo "VGNAME=${VGNAME}" >> $LOCALSETTINGS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment