Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removal of the Driveletter C not working when bound to Cardreader #15

Open
marcohald opened this issue Aug 5, 2021 · 3 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@marcohald
Copy link

Describe the bug
The Driveletter C was assigned to the empty Card reader and was not deletable via the line

Get-Partition -DriveLetter 'C' | Set-Partition -NewDriveLetter (Get-LastAvailableDriveLetter)

The Problem is that the Get-Volume CMDlet return a Object but it can't be consummed by the Get-Partition CMDlet
The Partition for the OS was not created via Start-OSDCloud -ImageFileUrl $imageUrl -ZTI and the Recovery Partition was the Size of the Remaining Space

I tried to change the Driveletter via WMI but that didn't work either

$drive = Get-WmiObject -Class win32_volume -Filter “DriveLetter = ‘c:'”
Set-WmiInstance -input $drive -Arguments @{DriveLetter=”Q:”}

Expected behavior
clear the letter assignment

Additional context
As a workaround I have added the Line &mountvol C: /D to my script

@OSDeploy
Copy link
Owner

Thanks, I'll see how I can add a check for a C: Drive and remove it like I am doing with the USB Drive Letters. Can you run a Get-Volume for the Card Reader?

@OSDeploy OSDeploy self-assigned this Dec 22, 2021
@OSDeploy OSDeploy added the bug Something isn't working label Dec 22, 2021
@marcohald
Copy link
Author

At the moment i don't have access to a device with this problematic card reader.
But as written before
The Problem is that the Get-Volume CMDlet return a Object but it can't be consummed by the Get-Partition CMDlet
As far as I can remember the mountvol.exe was the only way that can handle the cardreader without an inserted card

@Vexxer1
Copy link

Vexxer1 commented Mar 18, 2024

This issue has been around for ages in different OS deployment scenarios. :) Especially when the HDD/SSD is not partitioned.
I just recently started trying out OSDCloud and just wanted to add my 2 cents on how we approached this:
Get your hands on the 64-Bit Version of Devcon (might be a bit harder to find, but can be googled) and add:
devcon.exe disable USBSTOR*
and possibly
devcon.exe disable CDROM
To just disable the devices that can "steal" the C-Drive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants