mount -t ntfs -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000" /dev/sdb1 /media/xyq/opt
mount -t ntfs -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000" /dev/sdb2 /media/xyq/tools
# 修复
sudo ntfsfix /dev/sdb2
sudo ntfsfix /dev/sdb1
虚拟机下加载目录的脚本
cat mount.sh
#!/bin/bash
serial=(1 2)
select opt in "卸载(umount)" "挂载Downloads目录(mount)"
do
if ! echo ${serial[@]} | grep -q $REPLY; then
echo "please enter [1-2]."
continue
fi
if [[ $REPLY -eq 1 ]]; then
sudo umount -f ~/Downloads
else
sudo mount -t vboxsf -o uid=$UID,gid=$(id -g) Downloads ~/Downloads
fi
N=$(ls -hl ~/Downloads | grep -v "total 0" | wc -l )
echo "Downloads下的文件数:$N"
break
done