Jump to content

Issue with PE swapping Drives


mbouchard

Recommended Posts

Recently we have started seeing an issue on Systems (Dell Optiplex and Precision) that have the Intel Matrix Storage Manager HD Controller installed. Basically, the drives are swapped in PE from what they should be.

In the Bios, Vista, XP, and WinPE 1.6

Drive0 = WD 250GB C:\

Drive1 = ST 80GB D:\

In WinPE 2.1

Drive0 = ST 80GB C:\

Drive1 = WD 250GB D:\

Not sure why the drives are getting swapped. When this happens, my Windows setup attempts to install the OS to the 80GB drive. When the PC reboots after the PE portion is completed, it hangs as the 250GB drive is drive 0 once again.

If I disconnect the 80GB drive then there are no issues as the 250GB drive is once again Drive 0

I have tried changing the SATA operation in the BIOS but none have worked. The default is Raid Autodetect / ACHI.

Anyone have any ideas what I could try?

Thanks.

Link to comment
Share on other sites


Thank you for the reply. Any suggestions on the best way to programatically get the correct drive 0? So far the only thing I have seen that gives me the correct drive0 is WMI.

This will give me the correct info. But, I need to find out how to compare what I get in Diskpart to what I get in the script to make sure that I am unmounting the correct drive.

Additionally, once I used Mountvol to unmount the wrong Drive0 I get bluescreens. not sure what it is yet but I am trying to track that one down. Luckily this is a test system. While this may be a workaround it doesn't address he underlying issue of the wrong drive being reported as being Drive0.

On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_DiskPartition",,48)
For Each objItem in colItems
Wscript.Echo "Bootable: " & objItem.Bootable
Wscript.Echo "BootPartition: " & objItem.BootPartition
Wscript.Echo "DeviceID: " & objItem.DeviceID
Wscript.Echo "DiskIndex: " & objItem.DiskIndex
Wscript.Echo "Index: " & objItem.Index
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "PrimaryPartition: " & objItem.PrimaryPartition
Wscript.Echo "Size: " & ConvertSize(objItem.Size)
Next

Link to comment
Share on other sites

I just thought I would update this with a reason on why this is happening on WinPE. Per Microsoft:

-Windows does not assure disk order. When booting to an Installed OS, we maintain the order through symbios.sys. This assures that the OS drive will always be first.

-in WinPe, we list the disk in the order it is presented from the BIOS.

Not sure why this only happens on WinPE 2.1 and not 1.6. They are researching a way to script this so will post that if I ever get it.

Link to comment
Share on other sites

Welp, Microsoft gave me a script to determine if Drive C is on Disk 0.

  
Option Explicit
Dim sDrive


Dim iDisk : iDisk = 0'Disk 0
Dim iPart : iPart = 0'Partition 0

sDrive = lookForC(iDisk, iPart)

WScript.Echo "Drive" & iDisk & "/Partition" & iPart & " is mapped to drive " & sDrive

function lookForC(Disk, Part)
Dim sWQL, objWMIService, Partitions, oPartition, colDrives, oDrive
lookForC = "<none>"
sWQL = "SELECT * FROM Win32_DiskPartition where " & _
"DiskIndex=" & Disk & " and " & _
"Index=" & Part
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set Partitions = objWMIService.ExecQuery(sWQL)
For Each oPartition In Partitions
Set colDrives = objWMIService.ExecQuery _
("ASSOCIATORS OF {Win32_DiskPartition.DeviceID=""" & _
oPartition.DeviceID & """} WHERE AssocClass = " & _
"Win32_LogicalDiskToPartition")
For Each oDrive In colDrives
lookForC = oDrive.DeviceID
Next
Next
end function

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...