Azure添加数据盘

  • A+
所属分类:Linux
vim disk.sh
#!/bin/bash
(echo n; echo p; echo 1; echo ; echo ; echo w) | sudo fdisk /dev/sdc
sudo mkfs -t ext4 /dev/sdc1
sudo mkdir /data && sudo mount /dev/sdc1 /data
D=$(sudo -i blkid | grep sdc |  awk '{print $2}'| awk -F "=" '{print $2}' | sed 's/\"//g')
echo UUID=$D      /data    ext4      defaults,nofail     1  2  >> /etc/fstab

 

avatar

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: