js 调试重定向终端输出

mount raw disk in VirtualBox

Craynic posted @ 2017年9月08日 20:55 in 未分类 , 4064 阅读

先贴结论

vboxmanage internalcommands createrawvmdk -filename "c:\physical.vmdk" -rawdisk "\\.\PhysicalDrive2"
RAW host disk access VMDK file c:\physical.vmdk created successfully. 

起因很简单,我装了一个 portable 的 Archlinux,打算可以即插即用。但是后来发现,一个是新买的本子屏幕太差了(浪费钱),另一个是 PC 机性能严重过剩,同时多系统之间交互也很麻烦,想想还是虚拟机大法好。但是可怜的硬盘空间没剩多少了,装个系统二十个 G 就没了,如果能直接从 U 盘启动就好了。

搜了一下发现是可行的。可以用前面贴的命令生成一个执行裸硬盘的 vmdk 文件,然后在虚拟机里加载就可以了。照着示例找到了磁盘名称,发现是这样的:。这是什么鬼嘛,就算我不大懂 Windows 也明白一个设备是不会在同一个目录有两个名字的。

最后通过各种神奇的办法找到一个方法:wmic diskdrive list brief

Caption                              DeviceID            Model                                Partitions  Size

Samsung SSD 850 EVO 250GB            \\.\PHYSICALDRIVE0  Samsung SSD 850 EVO 250GB            4           250056737280
JetDrive Transcend SCSI Disk Device  \\.\PHYSICALDRIVE1  JetDrive Transcend SCSI Disk Device  7           250994419200
Cenda C5 USB Device                  \\.\PHYSICALDRIVE2  Cenda C5 USB Device                  3           250056737280

可以很明确的找到设备的名称了。

然后塞到前面的命令行里面。

C:\Program Files\Oracle\VirtualBox>vboxmanage internalcommands createrawvmdk -filename "c:\physical.vmdk" -rawdisk "\\.\PhysicalDrive2"
VBoxManage.exe: error: Cannot open the raw disk '\\.\PhysicalDrive2': VERR_ACCESS_DENIED
VBoxManage.exe: error: The raw disk vmdk file was not created

纳尼?是我姿势不对吗?然后我就放弃了。

后来某一天又想起来。试了一下用管理员身份运行。

RAW host disk access VMDK file c:\physical1.vmdk created successfully.

就搞定了……然后还有要注意的是在 VirtualBox Manager 里面打开的时候也要用管理员身份。

再一次败给了 Windows 的奇怪设定。

现在还有一个问题,就是 Windows 启动的时候先看见那块硬盘是不固定的,也就是说这回的 PhysicalDrive2 到了下一回可能就是 PhysicalDrive1 了,我还得重新生成这个 vmdk 文件。目前没找到什么方法能更明确地指定一块驱动器,不过还好我也不经常重启。

  • 无匹配
Avatar_small
move In & move out c 说:
2021年11月08日 23:31

It's vital to have an office cleaning crew that you trust and that show up when they say they should. It's important to get referrals from friends, other business owners and even the Better Business Bureau. Going online and looking for reviews is another way to obtain feedback. Be sure to find a variety of information online, however, as anonymous posts can be misleading, especially if there are only one or two. Ask the cleaners for references and check up on them to ask about the quality of their total service. They should also be licensed, bonded, and insured in case anything goes wrong.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter