#!/bin/sh #Comentarios y reclamos en: jorge.garcia.gonzalez@gmail.com NVAR=$# if [ "$NVAR" = "0" ]; then echo "You need 2 parameters at least" echo "Usage : #mkraw " #exit 1 echo '###################################################' echo 'raw name: ' read LV LV=`echo $LV| tr '[:upper:]' '[:lower:]' | sed 's/\/dev\/r//'` echo "Volume Group name:" read VG else LV=`echo $1 | tr '[:upper:]' '[:lower:]' | sed 's/\/dev\/r//'` VG=$2 fi if [ -e "/dev/r${LV}" ] ; then echo "Error : /dev/r${LV} ya existe " exit 1 fi SIZEtmp=`echo $LV|sed "s/^aw\([0-9]*\)\([gm]\)_[0-9]*$/\1/"` SIZEtype=`echo $LV|sed "s/^aw\([0-9]*\)\([gm]\)_[0-9]*$/\2/"` PPSIZE=`lsvg $VG | grep "PP SIZE:"| tr -s " " " " | cut -d" " -f6 ` if [ "$SIZEtype" = "m" ]; then SIZE=`echo "$SIZEtmp / $PPSIZE"|bc` elif [ "$SIZEtype" = "g" ]; then SIZE=`echo "($SIZEtmp * 1024) / $PPSIZE"|bc` fi if [ "$#" = "2" ]; then mklv -y $LV $VG $SIZE elif [ "$#" = "3" ]; then DISK=$3 mklv -y $LV $VG $SIZE $DISK fi