命令1:
wmic diskdrive list brief 可得到: \\.\PHYSICALDRIVE0
命令2:VBoxManage internalcommands listpartitions -rawdisk \\.\PhysicalDrive0
可查看到各分区情况,编号等
如下命令是使用整盘硬盘的,不建议
VBoxManage internalcommands createrawvmdk -filename D:\VMS\SZ-CentOS7-0318\disk_e.vmdk -rawdisk \\.\PHYSICALDRIVE0
此命令使用的是指定分区的,可通过命令2得到分区编号
VBoxManage internalcommands createrawvmdk -filename D:\VMS\SZ-CentOS7-0318\disk_e.vmdk -rawdisk \\.\\PHYSICALDRIVE0 -partitions 3
按以上步骤生成的 vmdk 文件,然后在虚拟机中引入此硬盘文件就可以看到了
问题1,参考 问题3:
[root@localhost ~]# mount -t ntfs-3g /dev/sdc4 /disk_e/ The disk contains an unclean file system (0, 0). The file system wasn't safely closed on Windows. Fixing.
问题2:
无法识别NTFS格式,安装 ntfs-3g
./configure make make install
问题3 与问题1,其实是同一个问题:
给虚拟机添加了刚才的硬盘后,使用 mount -t ntfs-3g /dev/sdc3 /disk_e ,机子直接挂了,报错信息如下:
The I/O cache encountered an error while updating data in medium "ahci-0-2" (rc=VERR_ACCESS_DENIED). Make sure there is enough free space on the disk and that the disk is working properly. Operation can be resumed afterwards.
解决:权限不足,要使用管理员权限运行!即启动【Oracle VM VirtualBox】的时候,使用管理员权限运行,如果还是报错的话,请按如下设置 :
按以上操作之后,再执行挂载:
[root@localhost ~]# mount.ntfs-3g /dev/sdc3 /disk_e
The disk contains an unclean file system (0, 1).
The file system wasn't safely closed on Windows. Fixing.
就会进入修复,然后等吧!
参考:https://stackoverflow.com/questions/24564644/virtualbox-returning-errorid-blkcache-ioerr#