2017-05-19 2 views
1

Hintergrund:Windows-Volume ohne Partition

Ich arbeite an einem Powershell-Skript, um die Installation von einem USB-Stick über WinPE zu automatisieren. Da auf den Zielsystemen mehrere Laufwerke vorhanden sind, von denen jedes möglicherweise über mehrere Partitionen verfügt, sind Windows die Laufwerkbuchstaben nicht mehr schnell genug. Ein Teil meines Skripts hebt alle Laufwerksbuchstaben auf und weist dann nur die erforderlichen Festplatten neu zu. Im Moment weise ich bestimmten Partitionen fest codierte Buchstaben zu, aber ich habe ein Problem mit einem nicht zugewiesenen Buchstaben.

Das Problem ist, dass ich irgendwie ein Volumen mit einem zugeordneten Laufwerksbuchstaben haben, doch gibt es offenbar keine zugrunde liegende Partition, und da Remove-PartitionAccessPath eine Objekt-Partition erfordert, gibt es keine Möglichkeit, es von Powershell zu tun (ohne zu diskpart zurückgreifen).

Hier ist die Ausgabe von diskpart - Sie die ausgewählten Festplatte keine Partitionen haben sehen können, doch irgendwie hat ein Volumen:

Microsoft DiskPart version 10.0.15063.0 

Copyright (C) Microsoft Corporation. 
On computer: MININT-6GI0UNM 

DISKPART> list disk 

    Disk ### Status   Size  Free  Dyn Gpt 
    -------- ------------- ------- ------- --- --- 
    Disk 0 Online   5589 GB  0 B  * 
    Disk 1 Online   5589 GB  0 B  * 
    Disk 2 Online   5589 GB  0 B  * 
    Disk 3 Online   5589 GB  0 B  * 
    Disk 4 Online   5589 GB  0 B  * 
    Disk 5 Online   5589 GB  0 B  * 
    Disk 6 Online   5589 GB  0 B  * 
    Disk 7 Online   5589 GB  0 B  * 
    Disk 8 Online   5589 GB  0 B  * 
    Disk 9 Online   5589 GB  0 B  * 
    Disk 10 Online   5589 GB  0 B  * 
    Disk 11 Online   5589 GB  0 B  * 
    Disk 12 Online   447 GB  0 B  * 
    Disk 13 Online   447 GB  0 B  * 
    Disk 14 Online   232 GB  0 B  * 
    Disk 15 Online   29 GB 29 GB 
    Disk 16 Online   28 GB  0 B  * 

DISKPART> sel disk 15 

Disk 15 is now the selected disk. 

DISKPART> list part 

There are no partitions on this disk to show. 

DISKPART> detail disk 

ATA Hypervisor USB Device 
Disk ID: E0623CE6 
Type : USB 
Status : Online 
Path : 0 
Target : 0 
LUN ID : 0 
Location Path : UNAVAILABLE 
Current Read-only State : No 
Read-only : No 
Boot Disk : No 
Pagefile Disk : No 
Hibernation File Disk : No 
Crashdump Disk : No 
Clustered Disk : No 

    Volume ### Ltr Label  Fs  Type  Size  Status  Info 
    ---------- --- ----------- ----- ---------- ------- --------- -------- 
    Volume 20 E      Removable  0 B Unusable 

DISKPART> 

Hier ist, was passiert, wenn ich versuche, den Brief von Powershell zu entfernen:

PS X:\sources> Get-Volume -DriveLetter E | Remove-PartitionAccessPath -AccessPath "E:" 
Remove-PartitionAccessPath : The input object cannot be bound to any parameters for the command either because the 
command does not take pipeline input or the input and its properties do not match any of the parameters that take 
pipeline input. 
At line:1 char:29 
+ ... t-Volume -DriveLetter E | Remove-PartitionAccessPath -AccessPath "E:" 
+        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : InvalidArgument: (MSFT_Volume (Ob...rosoft/Wind...):PSObject) [Remove-PartitionAccessPat 
    h], ParameterBindingException 
    + FullyQualifiedErrorId : InputObjectNotBound,Remove-PartitionAccessPath 

PS X:\sources> Get-Volume -DriveLetter E | fl * 


OperationalStatus  : Unknown 
HealthStatus   : Healthy 
DriveType    : Removable 
FileSystemType  : Unknown 
DedupMode    : NotAvailable 
ObjectId    : {1}\\MININT-6GI0UNM\root/Microsoft/Windows/Storage/Providers_v2\WSP_Volume.ObjectId="{63585070- 
         3cd2-11e7-b877-806e6f6e6963}:VO:\\?\Volume{635850c4-3cd2-11e7-b877-806e6f6e6963}\" 
PassThroughClass  : 
PassThroughIds  : 
PassThroughNamespace : 
PassThroughServer  : 
UniqueId    : \\?\Volume{635850c4-3cd2-11e7-b877-806e6f6e6963}\ 
AllocationUnitSize : 0 
DriveLetter   : E 
FileSystem   : 
FileSystemLabel  : 
Path     : \\?\Volume{635850c4-3cd2-11e7-b877-806e6f6e6963}\ 
Size     : 0 
SizeRemaining   : 0 
PSComputerName  : 
CimClass    : ROOT/Microsoft/Windows/Storage:MSFT_Volume 
CimInstanceProperties : {ObjectId, PassThroughClass, PassThroughIds, PassThroughNamespace...} 
CimSystemProperties : Microsoft.Management.Infrastructure.CimSystemProperties 



PS X:\sources> Get-Volume -DriveLetter E | Get-Partition 
PS X:\sources> $null -eq (Get-Volume -DriveLetter E | Get-Partition) 
True 

Powershell Version Tabelle:

PS X:\sources> $PSVersionTable 

Name       Value 
----       ----- 
PSVersion      5.1.15063.0 
PSEdition      Desktop 
PSCompatibleVersions   {1.0, 2.0, 3.0, 4.0...} 
BuildVersion     10.0.15063.0 
CLRVersion      4.0.30319.42000 
WSManStackVersion    3.0 
PSRemotingProtocolVersion  2.3 
SerializationVersion   1.1.0.1 

I kann versuchen, bei Bedarf mehr Details über den Inhalt der betreffenden Diskette zu erhalten.

Was könnte das verursachen? Gibt es eine Powershell-Problemumgehung?

Hinweis: Mir ist klar, dass es wahrscheinlich besser wäre, wenn Windows Laufwerksbuchstaben wählt, anstatt sie hart zu codieren, aber ich bin immer noch neugierig auf das mysteriöse Volumen.

+0

aussieht (warum auch immer) die gesamte Vorrichtung als ein einziges Volumen behandelt wird und nicht als eine Festplatte, die aufgeteilt werden soll. Einige Wechseldatenträger sind traditionell nicht partitioniert, z. B. DVDs und Disketten. Gibt es eine Chance, dass es sich um ein Blu-ray-Laufwerk oder ein ähnliches Gerät handelt? (Ich denke, USB-Laufwerke können auch als ein einziges Volume formatiert werden, aber wenn dies der Fall wäre, sollte es als belegter Speicherplatz und nicht als freier Speicherplatz angezeigt werden.) –

+0

Mögliche Hardware-Probleme? Da Sie es nur auf diesem einen USB-Laufwerk sehen. –

Antwort