磁盘挂载自动分区脚本
自动分区脚本:
cat a.sh
#!/bin/bash mkdir /data1 echo "n p 1 w " | fdisk /dev/vdc && mkfs -t ext4 /dev/vdc1
添加到自动挂载:
cat auto-mount.sh
echo "UUID=`ls -l /dev/disk/by-uuid |grep vdc1 |awk '{print $9}'` /data1 ext4 defaults 0 0" >>/etc/fstab mount -a rm -f a.sh