#!/bin/bash #罗列所有已挂在和待挂载磁盘 fdisk -l echo "请输入所挂盘目标地址:" read -p "地址:" all echo "请输入所挂地址:" read -p "地址:" ll mkdir $ll echo "n p 1 w "|fdisk -u $all kk="${all}1" mkfs.ext4 $kk mount $kk $ll echo `blkid $kk | awk ‘{print $2}‘ | sed ‘s/\"//g‘` $ll ext4 defaults 0 0 >> /etc/fstab df -h echo "已实现永久挂载!!!"