您的位置:首页 > 其它

目标板设置nfs文件开机挂载及脚本挂卸载

2012-02-20 20:39 225 查看
一、脚本设置nfs文件挂卸载,脚本内容如下:
#programe:

#mount or umount Ubuntu10.10 nfs folder /work

#History

#2012.02.17  klutz first release

PATH=/sbin:/usr/sbin:/bin:/usr/bin

export PATH

read -p "mount or umount (m/u):" mu

if [ "$mu" == "M" ] || [ "$mu" == "m" ]; then

mount -t nfs -o intr,nolock,rsize=1024,wsize=1024 192.168.12.2:/work /mnt/ubuntu_share

elif [ "$mu" == "U" ] || [ "$mu" == "u" ]; then

umount /mnt/ubuntu_share

fi

将脚本放入环境变量下,执行时,输入m挂载,输入u卸载。

二、自动挂载:

     在/etc/init.d下的rcS文件末尾加上

mount -t nfs -o intr,nolock,rsize=1024,wsize=1024 192.168.12.2:/work /mnt/ubuntu_share

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  脚本 ubuntu