#! /bin/bash re="y" echo “Start disk expansion!!” # echo $lvm_name while [ "$re" == "y" ] do lvs read -p "(Enter, inturn, the LVM system to be scaled up and the added size G:)" lvm_name size_add vg_name=$(lvs|grep "$lvm_name "|awk '{print $2}') echo $vg_name if [ "$vg_name" == "" ]; then echo "The logical volume was not found, please check and reenter:" continue fi # echo $vg_name free_size=$(vgs --units G|grep "$vg_name "|awk '{print $7}') echo $vg_name"excess surplus value "$free_size free_size=$(echo $free_size | sed 's/[a-zA-Z]//' | awk -F '.' '{print $1}') echo $free_size $size_add if [ $size_add -le $free_size ]; then lvextend -L +$size_add'G' /dev/$vg_name/$lvm_name else echo "vg Insufficient space!!" continue fi re="n" done lvs
字数占位符!字数占位符!字数占位符!字数占位符!字数占位符!字数占位符!字数占位符!字数占位符!
字数占位符!字数占位符!