自动分区挂载脚本阿里云ucloud
作者:互联网
#!/bin/bash r1=`df -h |grep "/dev/vdb1"|wc -l ` r2=`fdisk -l|grep vdb1|wc -l ` if [ ${r1} -eq 1 ];then echo 1 exit fi if [ ${r2} -eq 1 ];then echo 2 exit fi echo "n p 1 w " | fdisk /dev/vdb && mkfs.ext4 /dev/vdb1 && mount /dev/vdb1 /data && echo "/dev/vdb1 /data ext4 defaults 0 0" >>/etc/fstab
标签:ucloud,ext4,vdb1,分区,dev,echo,&&,挂载,eq 来源: https://blog.51cto.com/wsxxsl/2420947