linux批量新增自动分区挂载大于2T磁盘脚本#!/bin/bash#Used to fomat 11 datasPATH=/bin:/sbin:/usr/bin:/usr/sbinexport PATHi=1while [ $i -lt 11 ]doj=`echo $i|awk ‘{printf “%c”,97+$i}’`parted /dev/sd$jmkpart primary 0 -1ignorequitESXUecho “/n/n******/dev/sd${j} __was Fdataed! Waiting For 10 Second*****/n/n”sleep 1smkfs.ext4 /dev/sd${j}1if [ “$?” = “0” ];thenecho “/n/n*****sd${j}1 _________________was Formated, Waiting For 5 Second****/n/n”filet i+=1sleep 1sdonetouch /test2mkdir /data1mkdir /data2mkdir /data3mkdir /data4mkdir /data5mkdir /data6mkdir /data7mkdir /data8mkdir /data9mkdir /data10cat /test2/dev/sdb1 /data1 ext4 defaults 0 0/dev/sdc1 /data2 ext4 defaults 0 0/dev/sdd1 /data3 ext4 defaults 0 0/dev/sde1 /data4 ext4 defaults 0 0/dev/sdf1 /data5 ext4 defaults 0 0/dev/sdg1 /data6 ext4 defaults 0 0/dev/sdh1 /data7 ext4 defaults 0 0/dev/sdi1 /data8 ext4 defaults 0 0/dev/sdj1 /data9 ext4 defaults 0 0/dev/sdk1 /data10 ext4 defaults 0 0ESXUcat /test2 >> /etc/fstabmount -achmod -R 777 /data*rm -rf /test2本文出自张佃栋de博客,转载时请注明出处及相应链接。本文永久链接: https://zhangdd.com/808.html
12-17 06:00