apt-get update && apt-get install gdisk -y

for i in $(fdisk -l |grep Disk | grep -v Disklabel |grep -v identifier |awk '{print $2}' |sed -e 's/://g'); do

echo "d
2
w
Y
Y" | gdisk $i

echo "n
2



w
Y" | gdisk $i

resize2fs "$i"2

done
