2、自动挂载分区--创建小型linux
#!/bin/bash
# function:Automatically mount partition
source /scripts/rmdisk.sh
M=/mnt/boot
N=/mnt/sysroot
MOUNT () {
# check has been mounted (/mnt/boot)
if [ -d $M ];then
mount |grep ${DISK}1
RETVL=$?
if [ $RETVL -ne 0 ];then
mount ${DISK}1 $M
else
fuser ${DISK}1; umount ${DISK}1; mount ${DISK}1 $M
fi
else
mkdir $M;mount ${DISK}1 $M
fi
#check has been mounted (/mnt/sysroot)
if [ -d $N ];then
mount |grep ${DISK}1
RETVL=$?
if [ $RETVL -ne 0 ];then
mount ${DISK}1 $N
else
fuser ${DISK}1; umount ${DISK}1; mount ${DISK}1 $N
fi
else
mkdir $N;mount ${DISK}1 $N
fi
}
MOUNT $M $N
注:写的有点啰嗦。不太好
本文出自 “fish” 博客,请务必保留此出处http://seeds.blog.51cto.com/1501815/1395574
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。