如何判断 Windows 用于启动哪个磁盘 [英] How to tell which disk Windows Used to Boot

查看:40
本文介绍了如何判断 Windows 用于启动哪个磁盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要找到一种方法来以编程方式确定 Windows 用于启动的磁盘驱动器.换句话说,我需要从 Windows 中确定 BIOS 使用哪个驱动器来引导整个系统的方法.

I'm need to find a method to programmatically determine which disk drive Windows is using to boot. In other words, I need a way from Windows to determine which drive the BIOS is using to boot the whole system.

Windows 是否公开了一个接口来发现这一点?考虑到 Windows API 有多大,我希望里面有一些东西可以解决问题.

Does Windows expose an interface to discover this? With how big the Windows API is, I'm hoping there is something buried in there that might do the trick.

特里

附言仅仅读取硬盘的第一个扇区并没有带来任何惊喜.在我的开发箱上,我有两个硬盘,当我查看其中一个硬盘上前几个扇区的内容时,我有一个标准的样板 MBR.

p.s. Just reading the first sectors of the hard disk isn't reveling anything. On my dev box I have two hard disks, and when I look at the contents of the first couple of sectors on either of the hard disks I have a standard boiler plate MBR.

编辑以澄清一些事情.我想识别设备的方式是使用一个字符串来识别物理磁盘驱动器(而不是逻辑磁盘驱动器).物理磁盘驱动器的格式为\\.\PHYSICALDRIVEx",其中 x 是一个数字.另一方面,逻辑驱动器由\\.\x"形式的字符串标识,其中 x 是驱动器号.

Edit to clarify a few things. The way I want to identify the device is with a string which will identify a physical disk drive (as opposed to a logical disk drive). Physical disk drives are of the form "\\.\PHYSICALDRIVEx" where x is a number. On the other hand, a logical drive is identified by a string of the form, "\\.\x" where x is a drive letter.

编辑讨论一些被抛弃的想法.知道 Windows 用来引导哪个逻辑卷在这里对我没有帮助.这是原因.假设 C: 正在使用镜像 RAID 设置.现在,这意味着我们至少有两个物理驱动器.现在,我获得了从逻辑驱动器到物理驱动器的映射,我发现该卷使用了两个物理驱动器.Windows 使用哪一个启动?当然,这是假设用于引导 Windows 的物理驱动器与包含 MBR 的物理驱动器相同.

Edit to discuss a few of the ideas that were thrown out. Knowing which logical volume Windows used to boot doesn't help me here. Here is the reason. Assume that C: is using a mirrored RAID setup. Now, that means we have at least two physical drives. Now, I get the mapping from Logical Drive to Physical Drive and I discover that there are two physical drives used by that volume. Which one did Windows use to boot? Of course, this is assuming that the physical drive Windows used to boot is the same physical drive that contains the MBR.

推荐答案

  1. 进入控制面板
  2. 系统和安全
  3. 管理工具
  4. 启动系统配置工具

如果您安装了多个 Windows 副本,则启动时使用的副本将命名为:

If you have multiple copies of Windows installed, the one you are booted with will be named such as:

Windows 7 (F:\Windows)
Windows 7 (C:\Windows) : Current OS, Default OS

这篇关于如何判断 Windows 用于启动哪个磁盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆