shell (3) 磁盘挂载
#!/bin/sh
disk=`df -h |grep /dev/sd|awk '{print $1}'`
echo $disk
for d in $disk
do
echo $d
uuid=`blkid $d |awk {'print $2'}|awk -F "\"" '{print $2}'`
echo $uuid
dir=`df -h|grep $d|awk '{print $6}'`
echo $dir
echo "UUID=$uuid $dir ext4 default 1 2" >> /root/test1
done
欢迎评论交流