linux 挂载IOS文件 挂载光盘
时间:2016-03-29 23:04 来源:linux.it.net.cn 作者:IT
man mount
1.挂载ISO镜像:mount -o loop xxx.iso /media/mountdir
2. 挂载光盘:mount -t iso9660 /dev/cdrom /mnt/cdrom
自动挂载和卸载ISO镜像脚本:
-
#!/bin/bash
-
-
usage(){
-
cat <<EOF
-
`basename $0` USAGE:
-
-m
-
mount CentOS-IOS on /media/os;
-
-u
-
umount CentOS-IOS on /media/os;
-
EOF
-
}
-
if (($#<1))
-
then
-
usage;
-
fi
-
-
while getopts :mu opt
-
do
-
case $opt in
-
m) mount -o loop /data/Cent-IOS/CentOS-6.2-i386-bin-DVD1.iso /media/os;
-
echo "mount success";
-
df -a;
-
exit 0 ;;
-
u) { umount /media/os;echo "umount success";df -a;exit 0; };;
-
-
\?) { echo "uknown option"; usage;exit 1; };;
-
-
*) { usage;exit 1; };;
-
esac
-
done
(责任编辑:IT)
man mount
1.挂载ISO镜像:mount -o loop xxx.iso /media/mountdir
2. 挂载光盘:mount -t iso9660 /dev/cdrom /mnt/cdrom
自动挂载和卸载ISO镜像脚本:
(责任编辑:IT) |