#!/bin/bash
:<<NNNNNNN
‘
HISTORY: 2013-01-05 11:17 FRI
FUNCTION: Oracle VM VirtualBox中挂在所在Windows的各个分区
SYNOPSIS: mnt.v.windows.hardisk [C | D | E | ....]
-> Optiplex380的Windows分区为C,D,E.
-> ./mntvwh C 挂载C盘
-> ./mntvwh D 挂载D盘
-> ./mntvwh E 挂载E盘
-> ./mntvwh H 挂载移动硬盘
-> 查找移动硬盘具体的位置
-> sudo fdisk -l
-> VM中配置的文件夹命名为: 盘符_ip最后一位
-> eg: E_138 [ip]
->
DESCRIPTION: On x86_64
->
->
NSVERSION: v7.1.9.8.2013-mon-x86_64
BUGS:
-> 执行脚本时,若是报出以下错误: [/sbin/mount.vboxsf: mounting failed with the error: No such device]
-> 解决方法如下:
-> cd /media/VBOXADDITIONS_4.2.12_84980/
-> sudo ./VBoxLinuxAdditions.run
->
‘
NNNNNNN
mntDIR=~/Music/$1/
function mntWindowsDisc() {
sudo mount -t vboxsf -o iocharset=utf8,uid=${USER},gid=${USER},umask=077 $1_138 ${mntDIR}
}
#mount移动硬盘时需要先判断硬盘的位置
#需手动,自动以后完成
#/dev/sda2
#/dev/sdb1
#/dev/sdb2
#/dev/sdc1
function mntHardisk(){
sudo mount -t ntfs /dev/sda2 ${mntDIR} -o uid=${USER},gid=${USER},umask=022,force
# sudo chown -R ${USER}:${USER} ${mntDIR}
# sudo chmod -R 755 ${mntDIR}
}
case $1 in
"C") mntWindowsDisc C ;;
"D") mntWindowsDisc D ;;
"E") mntWindowsDisc E ;;
"H") mntHardisk H ;;
*) echo "Not Support, You Input is Not Correct.." ;;
esac
#if [ $1 == "E" ]; then
# mount_windows_folder E
#elif [ $1 == "D" ]; then
# mount_windows_folder D
#elif [ $1 == "C" ]; then
## mount_windows_folder C
#elif [ $1 == "H" ]; then
# mount_hardisk
#else
# echo "Not Support, You Input is Not Correct.."
#fi