Format

#!/bin/sh

#DEVICE_LIST=""
DEVICE_LIST="/dev/sdc /dev/sdd /dev/sde /dev/sdf /dev/sdg /dev/sdh"
for DEVICE in $DEVICE_LIST
do
  echo "+++++create partition for $DEVICE......"
  parted -s $DEVICE mklabel gpt mkpart gpt2t ext2 0% 100%
  PARTITION="$DEVICE""1"
  echo "+++++formatting $PARTITION......"
  mkfs.ext4 -T largefile $PARTITION
done

Mount

#!/bin/sh

#backup /etc/fstab
cp /etc/fstab /etc/fstab.bak
PARTITION_LIST="sdb1 sdd1 sde1 sdf1 sdg1 sdh1"

for PARTITION in $PARTITION_LIST
do
  UUID=`blkid "/dev/""$PARTITION" | awk '{print $2}' | sed 's/\"//g'`
  echo $UUID

  echo "add $PARTITION to /etc/fstab"
  MOUNTDIR="/mnt/""$PARTITION"
  echo "mkdir -p $MOUNTDIR"
  mkdir -p $MOUNTDIR

  echo "appending \"$UUID $MOUNTDIR ext4 defaults 0 0\" to /etc/fstab "
  echo "$UUID $MOUNTDIR ext4 defaults 0 0" >> /etc/fstab
  echo ""
done

#mount all partitions
mount -a

#show mounted partitions
df -h