0

So while digging into an existing script, I noticed there is a difference between how Windows lists partitions and volumes. Can someone explain to me what I am seeing? Is it just the difference between diskpart and WMI? How would linux see these?

C:\WINDOWS\system32>wmic /namespace:\\root\cimv2 path Win32_OperatingSystem get SystemDevice

SystemDevice
\Device\HarddiskVolume1

<>

DISKPART> list volume

Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
----------  ---  -----------  -----  ----------  -------  --------- ------
Volume 0     E   Backup       NTFS   Mirror       148 GB  Healthy
Volume 1     D                       DVD-ROM         0 B  No Media
Volume 2     L                       DVD-ROM         0 B  No Media
Volume 3     C   OS           NTFS   Partition    223 GB  Healthy   System
Volume 4     G                       Removable       0 B  No Media
Volume 5     H                       Removable       0 B  No Media
Volume 6     I                       Removable       0 B  No Media
Volume 7     J                       Removable       0 B  No Media
DISKPART>

Thanks!

semtex41
  • 249
  • 1
  • 7

1 Answers1

1

diskpart is listing ALL of the drive letters assigned on the system. SystemDevice is literally just asking windows for which drive that Windows itself is installed on - e.g. the boot device (aka "C:")

Linux would see the system device as /, and the rest would probably show up in mount output, if they are mounted.

Marc B
  • 356,200
  • 43
  • 426
  • 500
  • Thanks for the fast reply. So I ran the same commands on a different laptop and the WMI is showing \device\harddiskvolume4 where as dispart is showing the c: drive as volume 1. Are you saying just think about them as values and try not to correlate them? – semtex41 May 26 '15 at 20:57
  • yeah, volume = partition, basically. – Marc B May 26 '15 at 20:57
  • 2
    @semtex41, the volume is `\Device\HarddiskVolume4`. The name `C:` is a symbolic link to the latter that's defined in the Win32 global `DosDevices` namespace, i.e. `\Global??\C:` `=>` `\Device\HarddiskVolume4`. Another symbolic link maps from the disk and partition number to the volume device, e.g. `\Device\Harddisk1\Partition2` `=>` `\Device\HarddiskVolume4`. Recently (maybe only Windows 10; haven't checked 8), there's also a Win32 namespace link for the disk/partition number such as `Harddisk1Partition2`. Use Sysinternals WinObj to inspect this if you're curious. – Eryk Sun May 27 '15 at 08:53