Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Issue with PE swapping Drives

Featured Replies

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.

You could run a hardware detection scan, and when on that hardware, have your script dismount the unwanted drive using mountvol.exe or some such.

Not sure that will work, but I don't see why not.

  • Author

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

  • Author

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.

  • Author

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

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.