List every DeviceHarddiskvolume.?












5















I've tried Diskpart commands like "list" "volume" (no it's not that at all), "disk" and "partition"; but it still don't work.



DeviceHarddiskvolume0 seems to not be used, since DeviceHarddiskvolume1 means the first Windows' partition (aka "System Reserved") and DeviceHarddiskvolume2 is for C:.



So the question is: How to list every DeviceHarddiskvolume in Windows' 7 installation disk (for BCD editing) ?










share|improve this question





























    5















    I've tried Diskpart commands like "list" "volume" (no it's not that at all), "disk" and "partition"; but it still don't work.



    DeviceHarddiskvolume0 seems to not be used, since DeviceHarddiskvolume1 means the first Windows' partition (aka "System Reserved") and DeviceHarddiskvolume2 is for C:.



    So the question is: How to list every DeviceHarddiskvolume in Windows' 7 installation disk (for BCD editing) ?










    share|improve this question



























      5












      5








      5


      1






      I've tried Diskpart commands like "list" "volume" (no it's not that at all), "disk" and "partition"; but it still don't work.



      DeviceHarddiskvolume0 seems to not be used, since DeviceHarddiskvolume1 means the first Windows' partition (aka "System Reserved") and DeviceHarddiskvolume2 is for C:.



      So the question is: How to list every DeviceHarddiskvolume in Windows' 7 installation disk (for BCD editing) ?










      share|improve this question
















      I've tried Diskpart commands like "list" "volume" (no it's not that at all), "disk" and "partition"; but it still don't work.



      DeviceHarddiskvolume0 seems to not be used, since DeviceHarddiskvolume1 means the first Windows' partition (aka "System Reserved") and DeviceHarddiskvolume2 is for C:.



      So the question is: How to list every DeviceHarddiskvolume in Windows' 7 installation disk (for BCD editing) ?







      windows diskpart bcd






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 28 '16 at 14:50







      X.LINK

















      asked Mar 28 '16 at 14:11









      X.LINKX.LINK

      1,27931229




      1,27931229






















          5 Answers
          5






          active

          oldest

          votes


















          2














          How do I list every Harddiskvolume in Windows?



          This can be done using diskpart.



          Solution 1:




          1. Run diskpart.


          2. Type list volume to list all of the attached disk volumes


          3. Type exit



          Example output:



          F:test>diskpart

          Microsoft DiskPart version 6.1.7601
          Copyright (C) 1999-2008 Microsoft Corporation.
          On computer: HAL

          DISKPART> list volume

          Volume ### Ltr Label Fs Type Size Status Info
          ---------- --- ----------- ----- ---------- ------- --------- --------
          Volume 0 D DVD-ROM 0 B No Media
          Volume 1 System Rese NTFS Partition 100 MB Healthy System
          Volume 2 C NTFS Partition 449 GB Healthy Boot
          Volume 3 Recovery NTFS Partition 16 GB Healthy Hidden
          Volume 4 E SANDISK FAT32 Removable 59 GB Healthy
          Volume 5 F Expansion NTFS Partition 2794 GB Healthy

          DISKPART> exit

          Leaving DiskPart...

          F:test>


          Solution 2:




          1. Run diskpart.


          2. Type list disk to list all of the attached disks.


          3. Type select disk # where # is the number of the disk.


          4. Type detail disk


          5. Repeat steps 3 and 4 for each disk.


          6. Type exit



          The example output below shows that I currently have 3 disks with 5 volumes.



          Example output:



          F:test>diskpart

          Microsoft DiskPart version 6.1.7601
          Copyright (C) 1999-2008 Microsoft Corporation.
          On computer: HAL

          DISKPART> list disk

          Disk ### Status Size Free Dyn Gpt
          -------- ------------- ------- ------- --- ---
          Disk 0 Online 465 GB 0 B
          Disk 1 Online 59 GB 0 B
          Disk 2 Online 2794 GB 7168 KB

          DISKPART> select disk 0

          Disk 0 is now the selected disk.

          DISKPART> detail disk

          WDC WD5000LPVX-08V0TT5
          Disk ID: D831FAA5
          Type : ATA
          Status : Online
          Path : 0
          Target : 0
          LUN ID : 0
          Location Path : PCIROOT(0)#ATA(C00T00L00)
          Current Read-only State : No
          Read-only : No
          Boot Disk : Yes
          Pagefile Disk : Yes
          Hibernation File Disk : No
          Crashdump Disk : Yes
          Clustered Disk : No

          Volume ### Ltr Label Fs Type Size Status Info
          ---------- --- ----------- ----- ---------- ------- --------- --------
          Volume 1 System Rese NTFS Partition 100 MB Healthy System
          Volume 2 C NTFS Partition 449 GB Healthy Boot
          Volume 3 Recovery NTFS Partition 16 GB Healthy Hidden

          DISKPART> select disk 1

          Disk 1 is now the selected disk.

          DISKPART> detail disk

          SanDisk Cruzer USB Device
          Disk ID: 00000000
          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 4 E SANDISK FAT32 Removable 59 GB Healthy

          DISKPART> select disk 2

          Disk 2 is now the selected disk.

          DISKPART> detail disk

          Seagate Expansion Desk USB Device
          Disk ID: 75447009
          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 5 F Expansion NTFS Partition 2794 GB Healthy

          DISKPART> exit

          Leaving DiskPart...

          F:test>




          Further Reading





          • An A-Z Index of the Windows CMD command line - An excellent reference for all things Windows cmd line related.


          • diskpart - Disk Administration, Partition a disk.






          share|improve this answer





















          • 1





            Thanks for the detailed reply, but this still doesn't work since it has depsite correctly showing up the correct number of Windows' readable volumes from the correct disk; but didn't gave me the DeviceHarddiskVolume list. Is there any way to completely list the Device tree from Windows' 7 installation disk ?

            – X.LINK
            Mar 28 '16 at 14:50











          • It's the same thing named differently. Volume 0 == DeviceHarddiskvolume0, Volume 1 == DeviceHarddiskvolume1, etc

            – DavidPostill
            Mar 28 '16 at 14:59








          • 1





            I've found the solution. In fact, HarddiskVolume doesn't reflect the detected Windows' partitions, but every partitions (even non-windows) that are in the disk.

            – X.LINK
            Mar 28 '16 at 17:40






          • 2





            @DavidPostill Unfortunately the numbers shown by these diskpart commands do not necessarily match up with device numbers. For instance, in my system the first NTFS volume on Disk 0 is Volume 7 and \?DeviceHarddiskVolume4

            – rakslice
            Mar 25 '17 at 1:10



















          2














          Found a powershell script that lists the mounted volumes:



          # Biuild System Assembly in order to call Kernel32:QueryDosDevice. 
          $DynAssembly = New-Object System.Reflection.AssemblyName('SysUtils')
          $AssemblyBuilder = [AppDomain]::CurrentDomain.DefineDynamicAssembly($DynAssembly, [Reflection.Emit.AssemblyBuilderAccess]::Run)
          $ModuleBuilder = $AssemblyBuilder.DefineDynamicModule('SysUtils', $False)

          # Define [Kernel32]::QueryDosDevice method
          $TypeBuilder = $ModuleBuilder.DefineType('Kernel32', 'Public, Class')
          $PInvokeMethod = $TypeBuilder.DefinePInvokeMethod('QueryDosDevice', 'kernel32.dll', ([Reflection.MethodAttributes]::Public -bor [Reflection.MethodAttributes]::Static), [Reflection.CallingConventions]::Standard, [UInt32], [Type]@([String], [Text.StringBuilder], [UInt32]), [Runtime.InteropServices.CallingConvention]::Winapi, [Runtime.InteropServices.CharSet]::Auto)
          $DllImportConstructor = [Runtime.InteropServices.DllImportAttribute].GetConstructor(@([String]))
          $SetLastError = [Runtime.InteropServices.DllImportAttribute].GetField('SetLastError')
          $SetLastErrorCustomAttribute = New-Object Reflection.Emit.CustomAttributeBuilder($DllImportConstructor, @('kernel32.dll'), [Reflection.FieldInfo]@($SetLastError), @($true))
          $PInvokeMethod.SetCustomAttribute($SetLastErrorCustomAttribute)
          $Kernel32 = $TypeBuilder.CreateType()

          $Max = 65536
          $StringBuilder = New-Object System.Text.StringBuilder($Max)

          Get-WmiObject Win32_Volume | ? { $_.DriveLetter } | % {
          $ReturnLength = $Kernel32::QueryDosDevice($_.DriveLetter, $StringBuilder, $Max)

          if ($ReturnLength)
          {
          $DriveMapping = @{
          DriveLetter = $_.DriveLetter
          DevicePath = $StringBuilder.ToString()
          }

          New-Object PSObject -Property $DriveMapping
          }
          }


          Source:
          http://www.morgantechspace.com/2014/11/Get-Volume-Path-from-Drive-Name-using-Powershell.html



          Output looks like this:



          DevicePath               DriveLetter
          ---------- -----------
          DeviceHarddiskVolume2 F:
          DeviceHarddiskVolume7 J:
          DeviceHarddiskVolume10 D:
          DeviceHarddiskVolume12 E:
          DeviceHarddiskVolume5 C:





          share|improve this answer































            1














            The reason I couldn't get things done is that HarddiskVolume doesn't reflect Diskpart volumes -which only lists every Windows readable volumes-.



            In fact, it works with every partitions available on the disk -even the non-Windows ones-, by order they appear like in Linux's Gparted.



            E.g, if you have an sda4 before sda3, this latter will show as is -sda4 then sda3- (HarddiskVolume4 then HarddiskVolume3).



            So, it means that HarddiskVolume0 mainly don't exist in BCD.



            The commands that helped me to understand that are:



            mountvol /L

            bootsect /nt60 all /force -> Be careful with that one !!!


            These links also helped me:




            • https://neosmart.net/forums/threads/confusion-over-harddiskvolume.9841/

            • https://digital-forensics.sans.org/blog/2015/08/19/device-profiling-with-windows-prefetch

            • http://diddy.boot-land.net/bcdedit/files/device.htm

            • https://discuss.howtogeek.com/t/windows-7-device-harddisk-to-physical-drive/10066/8

            • https://translate.google.com/translate?sl=auto&tl=en&js=y&prev=_t&hl=en&ie=UTF-8&u=http%3A%2F%2Fwww.delphipraxis.net%2F186489-win7-%255Cdevice%255Charddiskvolume-n-wo-finde-ich-das.html&edit-text=&act=url


            Finally, if you have a spare Windows, just run DriveLetterView to see how Windows works with HarddiskVolume.



            Note: The HarddiskVolume is a WMI/COM notation






            share|improve this answer































              1














              The easiest way without installing anything and tinkering with Powershell scripts might be System Information Viewer a portable Windows application. This app is great because it provides nearly every information about your machine / hardware. It not only offers a read out of hard drive related data rather nearly everything about your device can be found. Moreover it's very lightweight but TBH a bit confusing structured.



              Finally, how do you find drive information? Under Volumes there is the option Volume List that will give you an overview of all DeviceHarddiskvolumeXX present on your computer. Additionally you get drive letter and GUID of your partitions.



              I also want to highlight the option Drives which displays .PhysicalDriveXX, path, unit and controller IDs. The listing under Drive Mapping might also be quite useful.






              share|improve this answer

































                -1














                If you want just to find out where your system BCD store is take a look at REGISTRYMACHINEBCD00000000 value in HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlhivelist registry key. Yes, its location can differ from DeviceHardDiskVolume1 even if it is on the 1st partition of the 1st physical disk.






                share|improve this answer

























                  Your Answer








                  StackExchange.ready(function() {
                  var channelOptions = {
                  tags: "".split(" "),
                  id: "3"
                  };
                  initTagRenderer("".split(" "), "".split(" "), channelOptions);

                  StackExchange.using("externalEditor", function() {
                  // Have to fire editor after snippets, if snippets enabled
                  if (StackExchange.settings.snippets.snippetsEnabled) {
                  StackExchange.using("snippets", function() {
                  createEditor();
                  });
                  }
                  else {
                  createEditor();
                  }
                  });

                  function createEditor() {
                  StackExchange.prepareEditor({
                  heartbeatType: 'answer',
                  autoActivateHeartbeat: false,
                  convertImagesToLinks: true,
                  noModals: true,
                  showLowRepImageUploadWarning: true,
                  reputationToPostImages: 10,
                  bindNavPrevention: true,
                  postfix: "",
                  imageUploader: {
                  brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                  contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                  allowUrls: true
                  },
                  onDemand: true,
                  discardSelector: ".discard-answer"
                  ,immediatelyShowMarkdownHelp:true
                  });


                  }
                  });














                  draft saved

                  draft discarded


















                  StackExchange.ready(
                  function () {
                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1058217%2flist-every-device-harddiskvolume%23new-answer', 'question_page');
                  }
                  );

                  Post as a guest















                  Required, but never shown

























                  5 Answers
                  5






                  active

                  oldest

                  votes








                  5 Answers
                  5






                  active

                  oldest

                  votes









                  active

                  oldest

                  votes






                  active

                  oldest

                  votes









                  2














                  How do I list every Harddiskvolume in Windows?



                  This can be done using diskpart.



                  Solution 1:




                  1. Run diskpart.


                  2. Type list volume to list all of the attached disk volumes


                  3. Type exit



                  Example output:



                  F:test>diskpart

                  Microsoft DiskPart version 6.1.7601
                  Copyright (C) 1999-2008 Microsoft Corporation.
                  On computer: HAL

                  DISKPART> list volume

                  Volume ### Ltr Label Fs Type Size Status Info
                  ---------- --- ----------- ----- ---------- ------- --------- --------
                  Volume 0 D DVD-ROM 0 B No Media
                  Volume 1 System Rese NTFS Partition 100 MB Healthy System
                  Volume 2 C NTFS Partition 449 GB Healthy Boot
                  Volume 3 Recovery NTFS Partition 16 GB Healthy Hidden
                  Volume 4 E SANDISK FAT32 Removable 59 GB Healthy
                  Volume 5 F Expansion NTFS Partition 2794 GB Healthy

                  DISKPART> exit

                  Leaving DiskPart...

                  F:test>


                  Solution 2:




                  1. Run diskpart.


                  2. Type list disk to list all of the attached disks.


                  3. Type select disk # where # is the number of the disk.


                  4. Type detail disk


                  5. Repeat steps 3 and 4 for each disk.


                  6. Type exit



                  The example output below shows that I currently have 3 disks with 5 volumes.



                  Example output:



                  F:test>diskpart

                  Microsoft DiskPart version 6.1.7601
                  Copyright (C) 1999-2008 Microsoft Corporation.
                  On computer: HAL

                  DISKPART> list disk

                  Disk ### Status Size Free Dyn Gpt
                  -------- ------------- ------- ------- --- ---
                  Disk 0 Online 465 GB 0 B
                  Disk 1 Online 59 GB 0 B
                  Disk 2 Online 2794 GB 7168 KB

                  DISKPART> select disk 0

                  Disk 0 is now the selected disk.

                  DISKPART> detail disk

                  WDC WD5000LPVX-08V0TT5
                  Disk ID: D831FAA5
                  Type : ATA
                  Status : Online
                  Path : 0
                  Target : 0
                  LUN ID : 0
                  Location Path : PCIROOT(0)#ATA(C00T00L00)
                  Current Read-only State : No
                  Read-only : No
                  Boot Disk : Yes
                  Pagefile Disk : Yes
                  Hibernation File Disk : No
                  Crashdump Disk : Yes
                  Clustered Disk : No

                  Volume ### Ltr Label Fs Type Size Status Info
                  ---------- --- ----------- ----- ---------- ------- --------- --------
                  Volume 1 System Rese NTFS Partition 100 MB Healthy System
                  Volume 2 C NTFS Partition 449 GB Healthy Boot
                  Volume 3 Recovery NTFS Partition 16 GB Healthy Hidden

                  DISKPART> select disk 1

                  Disk 1 is now the selected disk.

                  DISKPART> detail disk

                  SanDisk Cruzer USB Device
                  Disk ID: 00000000
                  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 4 E SANDISK FAT32 Removable 59 GB Healthy

                  DISKPART> select disk 2

                  Disk 2 is now the selected disk.

                  DISKPART> detail disk

                  Seagate Expansion Desk USB Device
                  Disk ID: 75447009
                  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 5 F Expansion NTFS Partition 2794 GB Healthy

                  DISKPART> exit

                  Leaving DiskPart...

                  F:test>




                  Further Reading





                  • An A-Z Index of the Windows CMD command line - An excellent reference for all things Windows cmd line related.


                  • diskpart - Disk Administration, Partition a disk.






                  share|improve this answer





















                  • 1





                    Thanks for the detailed reply, but this still doesn't work since it has depsite correctly showing up the correct number of Windows' readable volumes from the correct disk; but didn't gave me the DeviceHarddiskVolume list. Is there any way to completely list the Device tree from Windows' 7 installation disk ?

                    – X.LINK
                    Mar 28 '16 at 14:50











                  • It's the same thing named differently. Volume 0 == DeviceHarddiskvolume0, Volume 1 == DeviceHarddiskvolume1, etc

                    – DavidPostill
                    Mar 28 '16 at 14:59








                  • 1





                    I've found the solution. In fact, HarddiskVolume doesn't reflect the detected Windows' partitions, but every partitions (even non-windows) that are in the disk.

                    – X.LINK
                    Mar 28 '16 at 17:40






                  • 2





                    @DavidPostill Unfortunately the numbers shown by these diskpart commands do not necessarily match up with device numbers. For instance, in my system the first NTFS volume on Disk 0 is Volume 7 and \?DeviceHarddiskVolume4

                    – rakslice
                    Mar 25 '17 at 1:10
















                  2














                  How do I list every Harddiskvolume in Windows?



                  This can be done using diskpart.



                  Solution 1:




                  1. Run diskpart.


                  2. Type list volume to list all of the attached disk volumes


                  3. Type exit



                  Example output:



                  F:test>diskpart

                  Microsoft DiskPart version 6.1.7601
                  Copyright (C) 1999-2008 Microsoft Corporation.
                  On computer: HAL

                  DISKPART> list volume

                  Volume ### Ltr Label Fs Type Size Status Info
                  ---------- --- ----------- ----- ---------- ------- --------- --------
                  Volume 0 D DVD-ROM 0 B No Media
                  Volume 1 System Rese NTFS Partition 100 MB Healthy System
                  Volume 2 C NTFS Partition 449 GB Healthy Boot
                  Volume 3 Recovery NTFS Partition 16 GB Healthy Hidden
                  Volume 4 E SANDISK FAT32 Removable 59 GB Healthy
                  Volume 5 F Expansion NTFS Partition 2794 GB Healthy

                  DISKPART> exit

                  Leaving DiskPart...

                  F:test>


                  Solution 2:




                  1. Run diskpart.


                  2. Type list disk to list all of the attached disks.


                  3. Type select disk # where # is the number of the disk.


                  4. Type detail disk


                  5. Repeat steps 3 and 4 for each disk.


                  6. Type exit



                  The example output below shows that I currently have 3 disks with 5 volumes.



                  Example output:



                  F:test>diskpart

                  Microsoft DiskPart version 6.1.7601
                  Copyright (C) 1999-2008 Microsoft Corporation.
                  On computer: HAL

                  DISKPART> list disk

                  Disk ### Status Size Free Dyn Gpt
                  -------- ------------- ------- ------- --- ---
                  Disk 0 Online 465 GB 0 B
                  Disk 1 Online 59 GB 0 B
                  Disk 2 Online 2794 GB 7168 KB

                  DISKPART> select disk 0

                  Disk 0 is now the selected disk.

                  DISKPART> detail disk

                  WDC WD5000LPVX-08V0TT5
                  Disk ID: D831FAA5
                  Type : ATA
                  Status : Online
                  Path : 0
                  Target : 0
                  LUN ID : 0
                  Location Path : PCIROOT(0)#ATA(C00T00L00)
                  Current Read-only State : No
                  Read-only : No
                  Boot Disk : Yes
                  Pagefile Disk : Yes
                  Hibernation File Disk : No
                  Crashdump Disk : Yes
                  Clustered Disk : No

                  Volume ### Ltr Label Fs Type Size Status Info
                  ---------- --- ----------- ----- ---------- ------- --------- --------
                  Volume 1 System Rese NTFS Partition 100 MB Healthy System
                  Volume 2 C NTFS Partition 449 GB Healthy Boot
                  Volume 3 Recovery NTFS Partition 16 GB Healthy Hidden

                  DISKPART> select disk 1

                  Disk 1 is now the selected disk.

                  DISKPART> detail disk

                  SanDisk Cruzer USB Device
                  Disk ID: 00000000
                  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 4 E SANDISK FAT32 Removable 59 GB Healthy

                  DISKPART> select disk 2

                  Disk 2 is now the selected disk.

                  DISKPART> detail disk

                  Seagate Expansion Desk USB Device
                  Disk ID: 75447009
                  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 5 F Expansion NTFS Partition 2794 GB Healthy

                  DISKPART> exit

                  Leaving DiskPart...

                  F:test>




                  Further Reading





                  • An A-Z Index of the Windows CMD command line - An excellent reference for all things Windows cmd line related.


                  • diskpart - Disk Administration, Partition a disk.






                  share|improve this answer





















                  • 1





                    Thanks for the detailed reply, but this still doesn't work since it has depsite correctly showing up the correct number of Windows' readable volumes from the correct disk; but didn't gave me the DeviceHarddiskVolume list. Is there any way to completely list the Device tree from Windows' 7 installation disk ?

                    – X.LINK
                    Mar 28 '16 at 14:50











                  • It's the same thing named differently. Volume 0 == DeviceHarddiskvolume0, Volume 1 == DeviceHarddiskvolume1, etc

                    – DavidPostill
                    Mar 28 '16 at 14:59








                  • 1





                    I've found the solution. In fact, HarddiskVolume doesn't reflect the detected Windows' partitions, but every partitions (even non-windows) that are in the disk.

                    – X.LINK
                    Mar 28 '16 at 17:40






                  • 2





                    @DavidPostill Unfortunately the numbers shown by these diskpart commands do not necessarily match up with device numbers. For instance, in my system the first NTFS volume on Disk 0 is Volume 7 and \?DeviceHarddiskVolume4

                    – rakslice
                    Mar 25 '17 at 1:10














                  2












                  2








                  2







                  How do I list every Harddiskvolume in Windows?



                  This can be done using diskpart.



                  Solution 1:




                  1. Run diskpart.


                  2. Type list volume to list all of the attached disk volumes


                  3. Type exit



                  Example output:



                  F:test>diskpart

                  Microsoft DiskPart version 6.1.7601
                  Copyright (C) 1999-2008 Microsoft Corporation.
                  On computer: HAL

                  DISKPART> list volume

                  Volume ### Ltr Label Fs Type Size Status Info
                  ---------- --- ----------- ----- ---------- ------- --------- --------
                  Volume 0 D DVD-ROM 0 B No Media
                  Volume 1 System Rese NTFS Partition 100 MB Healthy System
                  Volume 2 C NTFS Partition 449 GB Healthy Boot
                  Volume 3 Recovery NTFS Partition 16 GB Healthy Hidden
                  Volume 4 E SANDISK FAT32 Removable 59 GB Healthy
                  Volume 5 F Expansion NTFS Partition 2794 GB Healthy

                  DISKPART> exit

                  Leaving DiskPart...

                  F:test>


                  Solution 2:




                  1. Run diskpart.


                  2. Type list disk to list all of the attached disks.


                  3. Type select disk # where # is the number of the disk.


                  4. Type detail disk


                  5. Repeat steps 3 and 4 for each disk.


                  6. Type exit



                  The example output below shows that I currently have 3 disks with 5 volumes.



                  Example output:



                  F:test>diskpart

                  Microsoft DiskPart version 6.1.7601
                  Copyright (C) 1999-2008 Microsoft Corporation.
                  On computer: HAL

                  DISKPART> list disk

                  Disk ### Status Size Free Dyn Gpt
                  -------- ------------- ------- ------- --- ---
                  Disk 0 Online 465 GB 0 B
                  Disk 1 Online 59 GB 0 B
                  Disk 2 Online 2794 GB 7168 KB

                  DISKPART> select disk 0

                  Disk 0 is now the selected disk.

                  DISKPART> detail disk

                  WDC WD5000LPVX-08V0TT5
                  Disk ID: D831FAA5
                  Type : ATA
                  Status : Online
                  Path : 0
                  Target : 0
                  LUN ID : 0
                  Location Path : PCIROOT(0)#ATA(C00T00L00)
                  Current Read-only State : No
                  Read-only : No
                  Boot Disk : Yes
                  Pagefile Disk : Yes
                  Hibernation File Disk : No
                  Crashdump Disk : Yes
                  Clustered Disk : No

                  Volume ### Ltr Label Fs Type Size Status Info
                  ---------- --- ----------- ----- ---------- ------- --------- --------
                  Volume 1 System Rese NTFS Partition 100 MB Healthy System
                  Volume 2 C NTFS Partition 449 GB Healthy Boot
                  Volume 3 Recovery NTFS Partition 16 GB Healthy Hidden

                  DISKPART> select disk 1

                  Disk 1 is now the selected disk.

                  DISKPART> detail disk

                  SanDisk Cruzer USB Device
                  Disk ID: 00000000
                  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 4 E SANDISK FAT32 Removable 59 GB Healthy

                  DISKPART> select disk 2

                  Disk 2 is now the selected disk.

                  DISKPART> detail disk

                  Seagate Expansion Desk USB Device
                  Disk ID: 75447009
                  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 5 F Expansion NTFS Partition 2794 GB Healthy

                  DISKPART> exit

                  Leaving DiskPart...

                  F:test>




                  Further Reading





                  • An A-Z Index of the Windows CMD command line - An excellent reference for all things Windows cmd line related.


                  • diskpart - Disk Administration, Partition a disk.






                  share|improve this answer















                  How do I list every Harddiskvolume in Windows?



                  This can be done using diskpart.



                  Solution 1:




                  1. Run diskpart.


                  2. Type list volume to list all of the attached disk volumes


                  3. Type exit



                  Example output:



                  F:test>diskpart

                  Microsoft DiskPart version 6.1.7601
                  Copyright (C) 1999-2008 Microsoft Corporation.
                  On computer: HAL

                  DISKPART> list volume

                  Volume ### Ltr Label Fs Type Size Status Info
                  ---------- --- ----------- ----- ---------- ------- --------- --------
                  Volume 0 D DVD-ROM 0 B No Media
                  Volume 1 System Rese NTFS Partition 100 MB Healthy System
                  Volume 2 C NTFS Partition 449 GB Healthy Boot
                  Volume 3 Recovery NTFS Partition 16 GB Healthy Hidden
                  Volume 4 E SANDISK FAT32 Removable 59 GB Healthy
                  Volume 5 F Expansion NTFS Partition 2794 GB Healthy

                  DISKPART> exit

                  Leaving DiskPart...

                  F:test>


                  Solution 2:




                  1. Run diskpart.


                  2. Type list disk to list all of the attached disks.


                  3. Type select disk # where # is the number of the disk.


                  4. Type detail disk


                  5. Repeat steps 3 and 4 for each disk.


                  6. Type exit



                  The example output below shows that I currently have 3 disks with 5 volumes.



                  Example output:



                  F:test>diskpart

                  Microsoft DiskPart version 6.1.7601
                  Copyright (C) 1999-2008 Microsoft Corporation.
                  On computer: HAL

                  DISKPART> list disk

                  Disk ### Status Size Free Dyn Gpt
                  -------- ------------- ------- ------- --- ---
                  Disk 0 Online 465 GB 0 B
                  Disk 1 Online 59 GB 0 B
                  Disk 2 Online 2794 GB 7168 KB

                  DISKPART> select disk 0

                  Disk 0 is now the selected disk.

                  DISKPART> detail disk

                  WDC WD5000LPVX-08V0TT5
                  Disk ID: D831FAA5
                  Type : ATA
                  Status : Online
                  Path : 0
                  Target : 0
                  LUN ID : 0
                  Location Path : PCIROOT(0)#ATA(C00T00L00)
                  Current Read-only State : No
                  Read-only : No
                  Boot Disk : Yes
                  Pagefile Disk : Yes
                  Hibernation File Disk : No
                  Crashdump Disk : Yes
                  Clustered Disk : No

                  Volume ### Ltr Label Fs Type Size Status Info
                  ---------- --- ----------- ----- ---------- ------- --------- --------
                  Volume 1 System Rese NTFS Partition 100 MB Healthy System
                  Volume 2 C NTFS Partition 449 GB Healthy Boot
                  Volume 3 Recovery NTFS Partition 16 GB Healthy Hidden

                  DISKPART> select disk 1

                  Disk 1 is now the selected disk.

                  DISKPART> detail disk

                  SanDisk Cruzer USB Device
                  Disk ID: 00000000
                  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 4 E SANDISK FAT32 Removable 59 GB Healthy

                  DISKPART> select disk 2

                  Disk 2 is now the selected disk.

                  DISKPART> detail disk

                  Seagate Expansion Desk USB Device
                  Disk ID: 75447009
                  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 5 F Expansion NTFS Partition 2794 GB Healthy

                  DISKPART> exit

                  Leaving DiskPart...

                  F:test>




                  Further Reading





                  • An A-Z Index of the Windows CMD command line - An excellent reference for all things Windows cmd line related.


                  • diskpart - Disk Administration, Partition a disk.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Mar 28 '16 at 14:46

























                  answered Mar 28 '16 at 14:39









                  DavidPostillDavidPostill

                  104k25225260




                  104k25225260








                  • 1





                    Thanks for the detailed reply, but this still doesn't work since it has depsite correctly showing up the correct number of Windows' readable volumes from the correct disk; but didn't gave me the DeviceHarddiskVolume list. Is there any way to completely list the Device tree from Windows' 7 installation disk ?

                    – X.LINK
                    Mar 28 '16 at 14:50











                  • It's the same thing named differently. Volume 0 == DeviceHarddiskvolume0, Volume 1 == DeviceHarddiskvolume1, etc

                    – DavidPostill
                    Mar 28 '16 at 14:59








                  • 1





                    I've found the solution. In fact, HarddiskVolume doesn't reflect the detected Windows' partitions, but every partitions (even non-windows) that are in the disk.

                    – X.LINK
                    Mar 28 '16 at 17:40






                  • 2





                    @DavidPostill Unfortunately the numbers shown by these diskpart commands do not necessarily match up with device numbers. For instance, in my system the first NTFS volume on Disk 0 is Volume 7 and \?DeviceHarddiskVolume4

                    – rakslice
                    Mar 25 '17 at 1:10














                  • 1





                    Thanks for the detailed reply, but this still doesn't work since it has depsite correctly showing up the correct number of Windows' readable volumes from the correct disk; but didn't gave me the DeviceHarddiskVolume list. Is there any way to completely list the Device tree from Windows' 7 installation disk ?

                    – X.LINK
                    Mar 28 '16 at 14:50











                  • It's the same thing named differently. Volume 0 == DeviceHarddiskvolume0, Volume 1 == DeviceHarddiskvolume1, etc

                    – DavidPostill
                    Mar 28 '16 at 14:59








                  • 1





                    I've found the solution. In fact, HarddiskVolume doesn't reflect the detected Windows' partitions, but every partitions (even non-windows) that are in the disk.

                    – X.LINK
                    Mar 28 '16 at 17:40






                  • 2





                    @DavidPostill Unfortunately the numbers shown by these diskpart commands do not necessarily match up with device numbers. For instance, in my system the first NTFS volume on Disk 0 is Volume 7 and \?DeviceHarddiskVolume4

                    – rakslice
                    Mar 25 '17 at 1:10








                  1




                  1





                  Thanks for the detailed reply, but this still doesn't work since it has depsite correctly showing up the correct number of Windows' readable volumes from the correct disk; but didn't gave me the DeviceHarddiskVolume list. Is there any way to completely list the Device tree from Windows' 7 installation disk ?

                  – X.LINK
                  Mar 28 '16 at 14:50





                  Thanks for the detailed reply, but this still doesn't work since it has depsite correctly showing up the correct number of Windows' readable volumes from the correct disk; but didn't gave me the DeviceHarddiskVolume list. Is there any way to completely list the Device tree from Windows' 7 installation disk ?

                  – X.LINK
                  Mar 28 '16 at 14:50













                  It's the same thing named differently. Volume 0 == DeviceHarddiskvolume0, Volume 1 == DeviceHarddiskvolume1, etc

                  – DavidPostill
                  Mar 28 '16 at 14:59







                  It's the same thing named differently. Volume 0 == DeviceHarddiskvolume0, Volume 1 == DeviceHarddiskvolume1, etc

                  – DavidPostill
                  Mar 28 '16 at 14:59






                  1




                  1





                  I've found the solution. In fact, HarddiskVolume doesn't reflect the detected Windows' partitions, but every partitions (even non-windows) that are in the disk.

                  – X.LINK
                  Mar 28 '16 at 17:40





                  I've found the solution. In fact, HarddiskVolume doesn't reflect the detected Windows' partitions, but every partitions (even non-windows) that are in the disk.

                  – X.LINK
                  Mar 28 '16 at 17:40




                  2




                  2





                  @DavidPostill Unfortunately the numbers shown by these diskpart commands do not necessarily match up with device numbers. For instance, in my system the first NTFS volume on Disk 0 is Volume 7 and \?DeviceHarddiskVolume4

                  – rakslice
                  Mar 25 '17 at 1:10





                  @DavidPostill Unfortunately the numbers shown by these diskpart commands do not necessarily match up with device numbers. For instance, in my system the first NTFS volume on Disk 0 is Volume 7 and \?DeviceHarddiskVolume4

                  – rakslice
                  Mar 25 '17 at 1:10













                  2














                  Found a powershell script that lists the mounted volumes:



                  # Biuild System Assembly in order to call Kernel32:QueryDosDevice. 
                  $DynAssembly = New-Object System.Reflection.AssemblyName('SysUtils')
                  $AssemblyBuilder = [AppDomain]::CurrentDomain.DefineDynamicAssembly($DynAssembly, [Reflection.Emit.AssemblyBuilderAccess]::Run)
                  $ModuleBuilder = $AssemblyBuilder.DefineDynamicModule('SysUtils', $False)

                  # Define [Kernel32]::QueryDosDevice method
                  $TypeBuilder = $ModuleBuilder.DefineType('Kernel32', 'Public, Class')
                  $PInvokeMethod = $TypeBuilder.DefinePInvokeMethod('QueryDosDevice', 'kernel32.dll', ([Reflection.MethodAttributes]::Public -bor [Reflection.MethodAttributes]::Static), [Reflection.CallingConventions]::Standard, [UInt32], [Type]@([String], [Text.StringBuilder], [UInt32]), [Runtime.InteropServices.CallingConvention]::Winapi, [Runtime.InteropServices.CharSet]::Auto)
                  $DllImportConstructor = [Runtime.InteropServices.DllImportAttribute].GetConstructor(@([String]))
                  $SetLastError = [Runtime.InteropServices.DllImportAttribute].GetField('SetLastError')
                  $SetLastErrorCustomAttribute = New-Object Reflection.Emit.CustomAttributeBuilder($DllImportConstructor, @('kernel32.dll'), [Reflection.FieldInfo]@($SetLastError), @($true))
                  $PInvokeMethod.SetCustomAttribute($SetLastErrorCustomAttribute)
                  $Kernel32 = $TypeBuilder.CreateType()

                  $Max = 65536
                  $StringBuilder = New-Object System.Text.StringBuilder($Max)

                  Get-WmiObject Win32_Volume | ? { $_.DriveLetter } | % {
                  $ReturnLength = $Kernel32::QueryDosDevice($_.DriveLetter, $StringBuilder, $Max)

                  if ($ReturnLength)
                  {
                  $DriveMapping = @{
                  DriveLetter = $_.DriveLetter
                  DevicePath = $StringBuilder.ToString()
                  }

                  New-Object PSObject -Property $DriveMapping
                  }
                  }


                  Source:
                  http://www.morgantechspace.com/2014/11/Get-Volume-Path-from-Drive-Name-using-Powershell.html



                  Output looks like this:



                  DevicePath               DriveLetter
                  ---------- -----------
                  DeviceHarddiskVolume2 F:
                  DeviceHarddiskVolume7 J:
                  DeviceHarddiskVolume10 D:
                  DeviceHarddiskVolume12 E:
                  DeviceHarddiskVolume5 C:





                  share|improve this answer




























                    2














                    Found a powershell script that lists the mounted volumes:



                    # Biuild System Assembly in order to call Kernel32:QueryDosDevice. 
                    $DynAssembly = New-Object System.Reflection.AssemblyName('SysUtils')
                    $AssemblyBuilder = [AppDomain]::CurrentDomain.DefineDynamicAssembly($DynAssembly, [Reflection.Emit.AssemblyBuilderAccess]::Run)
                    $ModuleBuilder = $AssemblyBuilder.DefineDynamicModule('SysUtils', $False)

                    # Define [Kernel32]::QueryDosDevice method
                    $TypeBuilder = $ModuleBuilder.DefineType('Kernel32', 'Public, Class')
                    $PInvokeMethod = $TypeBuilder.DefinePInvokeMethod('QueryDosDevice', 'kernel32.dll', ([Reflection.MethodAttributes]::Public -bor [Reflection.MethodAttributes]::Static), [Reflection.CallingConventions]::Standard, [UInt32], [Type]@([String], [Text.StringBuilder], [UInt32]), [Runtime.InteropServices.CallingConvention]::Winapi, [Runtime.InteropServices.CharSet]::Auto)
                    $DllImportConstructor = [Runtime.InteropServices.DllImportAttribute].GetConstructor(@([String]))
                    $SetLastError = [Runtime.InteropServices.DllImportAttribute].GetField('SetLastError')
                    $SetLastErrorCustomAttribute = New-Object Reflection.Emit.CustomAttributeBuilder($DllImportConstructor, @('kernel32.dll'), [Reflection.FieldInfo]@($SetLastError), @($true))
                    $PInvokeMethod.SetCustomAttribute($SetLastErrorCustomAttribute)
                    $Kernel32 = $TypeBuilder.CreateType()

                    $Max = 65536
                    $StringBuilder = New-Object System.Text.StringBuilder($Max)

                    Get-WmiObject Win32_Volume | ? { $_.DriveLetter } | % {
                    $ReturnLength = $Kernel32::QueryDosDevice($_.DriveLetter, $StringBuilder, $Max)

                    if ($ReturnLength)
                    {
                    $DriveMapping = @{
                    DriveLetter = $_.DriveLetter
                    DevicePath = $StringBuilder.ToString()
                    }

                    New-Object PSObject -Property $DriveMapping
                    }
                    }


                    Source:
                    http://www.morgantechspace.com/2014/11/Get-Volume-Path-from-Drive-Name-using-Powershell.html



                    Output looks like this:



                    DevicePath               DriveLetter
                    ---------- -----------
                    DeviceHarddiskVolume2 F:
                    DeviceHarddiskVolume7 J:
                    DeviceHarddiskVolume10 D:
                    DeviceHarddiskVolume12 E:
                    DeviceHarddiskVolume5 C:





                    share|improve this answer


























                      2












                      2








                      2







                      Found a powershell script that lists the mounted volumes:



                      # Biuild System Assembly in order to call Kernel32:QueryDosDevice. 
                      $DynAssembly = New-Object System.Reflection.AssemblyName('SysUtils')
                      $AssemblyBuilder = [AppDomain]::CurrentDomain.DefineDynamicAssembly($DynAssembly, [Reflection.Emit.AssemblyBuilderAccess]::Run)
                      $ModuleBuilder = $AssemblyBuilder.DefineDynamicModule('SysUtils', $False)

                      # Define [Kernel32]::QueryDosDevice method
                      $TypeBuilder = $ModuleBuilder.DefineType('Kernel32', 'Public, Class')
                      $PInvokeMethod = $TypeBuilder.DefinePInvokeMethod('QueryDosDevice', 'kernel32.dll', ([Reflection.MethodAttributes]::Public -bor [Reflection.MethodAttributes]::Static), [Reflection.CallingConventions]::Standard, [UInt32], [Type]@([String], [Text.StringBuilder], [UInt32]), [Runtime.InteropServices.CallingConvention]::Winapi, [Runtime.InteropServices.CharSet]::Auto)
                      $DllImportConstructor = [Runtime.InteropServices.DllImportAttribute].GetConstructor(@([String]))
                      $SetLastError = [Runtime.InteropServices.DllImportAttribute].GetField('SetLastError')
                      $SetLastErrorCustomAttribute = New-Object Reflection.Emit.CustomAttributeBuilder($DllImportConstructor, @('kernel32.dll'), [Reflection.FieldInfo]@($SetLastError), @($true))
                      $PInvokeMethod.SetCustomAttribute($SetLastErrorCustomAttribute)
                      $Kernel32 = $TypeBuilder.CreateType()

                      $Max = 65536
                      $StringBuilder = New-Object System.Text.StringBuilder($Max)

                      Get-WmiObject Win32_Volume | ? { $_.DriveLetter } | % {
                      $ReturnLength = $Kernel32::QueryDosDevice($_.DriveLetter, $StringBuilder, $Max)

                      if ($ReturnLength)
                      {
                      $DriveMapping = @{
                      DriveLetter = $_.DriveLetter
                      DevicePath = $StringBuilder.ToString()
                      }

                      New-Object PSObject -Property $DriveMapping
                      }
                      }


                      Source:
                      http://www.morgantechspace.com/2014/11/Get-Volume-Path-from-Drive-Name-using-Powershell.html



                      Output looks like this:



                      DevicePath               DriveLetter
                      ---------- -----------
                      DeviceHarddiskVolume2 F:
                      DeviceHarddiskVolume7 J:
                      DeviceHarddiskVolume10 D:
                      DeviceHarddiskVolume12 E:
                      DeviceHarddiskVolume5 C:





                      share|improve this answer













                      Found a powershell script that lists the mounted volumes:



                      # Biuild System Assembly in order to call Kernel32:QueryDosDevice. 
                      $DynAssembly = New-Object System.Reflection.AssemblyName('SysUtils')
                      $AssemblyBuilder = [AppDomain]::CurrentDomain.DefineDynamicAssembly($DynAssembly, [Reflection.Emit.AssemblyBuilderAccess]::Run)
                      $ModuleBuilder = $AssemblyBuilder.DefineDynamicModule('SysUtils', $False)

                      # Define [Kernel32]::QueryDosDevice method
                      $TypeBuilder = $ModuleBuilder.DefineType('Kernel32', 'Public, Class')
                      $PInvokeMethod = $TypeBuilder.DefinePInvokeMethod('QueryDosDevice', 'kernel32.dll', ([Reflection.MethodAttributes]::Public -bor [Reflection.MethodAttributes]::Static), [Reflection.CallingConventions]::Standard, [UInt32], [Type]@([String], [Text.StringBuilder], [UInt32]), [Runtime.InteropServices.CallingConvention]::Winapi, [Runtime.InteropServices.CharSet]::Auto)
                      $DllImportConstructor = [Runtime.InteropServices.DllImportAttribute].GetConstructor(@([String]))
                      $SetLastError = [Runtime.InteropServices.DllImportAttribute].GetField('SetLastError')
                      $SetLastErrorCustomAttribute = New-Object Reflection.Emit.CustomAttributeBuilder($DllImportConstructor, @('kernel32.dll'), [Reflection.FieldInfo]@($SetLastError), @($true))
                      $PInvokeMethod.SetCustomAttribute($SetLastErrorCustomAttribute)
                      $Kernel32 = $TypeBuilder.CreateType()

                      $Max = 65536
                      $StringBuilder = New-Object System.Text.StringBuilder($Max)

                      Get-WmiObject Win32_Volume | ? { $_.DriveLetter } | % {
                      $ReturnLength = $Kernel32::QueryDosDevice($_.DriveLetter, $StringBuilder, $Max)

                      if ($ReturnLength)
                      {
                      $DriveMapping = @{
                      DriveLetter = $_.DriveLetter
                      DevicePath = $StringBuilder.ToString()
                      }

                      New-Object PSObject -Property $DriveMapping
                      }
                      }


                      Source:
                      http://www.morgantechspace.com/2014/11/Get-Volume-Path-from-Drive-Name-using-Powershell.html



                      Output looks like this:



                      DevicePath               DriveLetter
                      ---------- -----------
                      DeviceHarddiskVolume2 F:
                      DeviceHarddiskVolume7 J:
                      DeviceHarddiskVolume10 D:
                      DeviceHarddiskVolume12 E:
                      DeviceHarddiskVolume5 C:






                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Dec 30 '17 at 20:35









                      merlemerle

                      413




                      413























                          1














                          The reason I couldn't get things done is that HarddiskVolume doesn't reflect Diskpart volumes -which only lists every Windows readable volumes-.



                          In fact, it works with every partitions available on the disk -even the non-Windows ones-, by order they appear like in Linux's Gparted.



                          E.g, if you have an sda4 before sda3, this latter will show as is -sda4 then sda3- (HarddiskVolume4 then HarddiskVolume3).



                          So, it means that HarddiskVolume0 mainly don't exist in BCD.



                          The commands that helped me to understand that are:



                          mountvol /L

                          bootsect /nt60 all /force -> Be careful with that one !!!


                          These links also helped me:




                          • https://neosmart.net/forums/threads/confusion-over-harddiskvolume.9841/

                          • https://digital-forensics.sans.org/blog/2015/08/19/device-profiling-with-windows-prefetch

                          • http://diddy.boot-land.net/bcdedit/files/device.htm

                          • https://discuss.howtogeek.com/t/windows-7-device-harddisk-to-physical-drive/10066/8

                          • https://translate.google.com/translate?sl=auto&tl=en&js=y&prev=_t&hl=en&ie=UTF-8&u=http%3A%2F%2Fwww.delphipraxis.net%2F186489-win7-%255Cdevice%255Charddiskvolume-n-wo-finde-ich-das.html&edit-text=&act=url


                          Finally, if you have a spare Windows, just run DriveLetterView to see how Windows works with HarddiskVolume.



                          Note: The HarddiskVolume is a WMI/COM notation






                          share|improve this answer




























                            1














                            The reason I couldn't get things done is that HarddiskVolume doesn't reflect Diskpart volumes -which only lists every Windows readable volumes-.



                            In fact, it works with every partitions available on the disk -even the non-Windows ones-, by order they appear like in Linux's Gparted.



                            E.g, if you have an sda4 before sda3, this latter will show as is -sda4 then sda3- (HarddiskVolume4 then HarddiskVolume3).



                            So, it means that HarddiskVolume0 mainly don't exist in BCD.



                            The commands that helped me to understand that are:



                            mountvol /L

                            bootsect /nt60 all /force -> Be careful with that one !!!


                            These links also helped me:




                            • https://neosmart.net/forums/threads/confusion-over-harddiskvolume.9841/

                            • https://digital-forensics.sans.org/blog/2015/08/19/device-profiling-with-windows-prefetch

                            • http://diddy.boot-land.net/bcdedit/files/device.htm

                            • https://discuss.howtogeek.com/t/windows-7-device-harddisk-to-physical-drive/10066/8

                            • https://translate.google.com/translate?sl=auto&tl=en&js=y&prev=_t&hl=en&ie=UTF-8&u=http%3A%2F%2Fwww.delphipraxis.net%2F186489-win7-%255Cdevice%255Charddiskvolume-n-wo-finde-ich-das.html&edit-text=&act=url


                            Finally, if you have a spare Windows, just run DriveLetterView to see how Windows works with HarddiskVolume.



                            Note: The HarddiskVolume is a WMI/COM notation






                            share|improve this answer


























                              1












                              1








                              1







                              The reason I couldn't get things done is that HarddiskVolume doesn't reflect Diskpart volumes -which only lists every Windows readable volumes-.



                              In fact, it works with every partitions available on the disk -even the non-Windows ones-, by order they appear like in Linux's Gparted.



                              E.g, if you have an sda4 before sda3, this latter will show as is -sda4 then sda3- (HarddiskVolume4 then HarddiskVolume3).



                              So, it means that HarddiskVolume0 mainly don't exist in BCD.



                              The commands that helped me to understand that are:



                              mountvol /L

                              bootsect /nt60 all /force -> Be careful with that one !!!


                              These links also helped me:




                              • https://neosmart.net/forums/threads/confusion-over-harddiskvolume.9841/

                              • https://digital-forensics.sans.org/blog/2015/08/19/device-profiling-with-windows-prefetch

                              • http://diddy.boot-land.net/bcdedit/files/device.htm

                              • https://discuss.howtogeek.com/t/windows-7-device-harddisk-to-physical-drive/10066/8

                              • https://translate.google.com/translate?sl=auto&tl=en&js=y&prev=_t&hl=en&ie=UTF-8&u=http%3A%2F%2Fwww.delphipraxis.net%2F186489-win7-%255Cdevice%255Charddiskvolume-n-wo-finde-ich-das.html&edit-text=&act=url


                              Finally, if you have a spare Windows, just run DriveLetterView to see how Windows works with HarddiskVolume.



                              Note: The HarddiskVolume is a WMI/COM notation






                              share|improve this answer













                              The reason I couldn't get things done is that HarddiskVolume doesn't reflect Diskpart volumes -which only lists every Windows readable volumes-.



                              In fact, it works with every partitions available on the disk -even the non-Windows ones-, by order they appear like in Linux's Gparted.



                              E.g, if you have an sda4 before sda3, this latter will show as is -sda4 then sda3- (HarddiskVolume4 then HarddiskVolume3).



                              So, it means that HarddiskVolume0 mainly don't exist in BCD.



                              The commands that helped me to understand that are:



                              mountvol /L

                              bootsect /nt60 all /force -> Be careful with that one !!!


                              These links also helped me:




                              • https://neosmart.net/forums/threads/confusion-over-harddiskvolume.9841/

                              • https://digital-forensics.sans.org/blog/2015/08/19/device-profiling-with-windows-prefetch

                              • http://diddy.boot-land.net/bcdedit/files/device.htm

                              • https://discuss.howtogeek.com/t/windows-7-device-harddisk-to-physical-drive/10066/8

                              • https://translate.google.com/translate?sl=auto&tl=en&js=y&prev=_t&hl=en&ie=UTF-8&u=http%3A%2F%2Fwww.delphipraxis.net%2F186489-win7-%255Cdevice%255Charddiskvolume-n-wo-finde-ich-das.html&edit-text=&act=url


                              Finally, if you have a spare Windows, just run DriveLetterView to see how Windows works with HarddiskVolume.



                              Note: The HarddiskVolume is a WMI/COM notation







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Mar 28 '16 at 18:22









                              X.LINKX.LINK

                              1,27931229




                              1,27931229























                                  1














                                  The easiest way without installing anything and tinkering with Powershell scripts might be System Information Viewer a portable Windows application. This app is great because it provides nearly every information about your machine / hardware. It not only offers a read out of hard drive related data rather nearly everything about your device can be found. Moreover it's very lightweight but TBH a bit confusing structured.



                                  Finally, how do you find drive information? Under Volumes there is the option Volume List that will give you an overview of all DeviceHarddiskvolumeXX present on your computer. Additionally you get drive letter and GUID of your partitions.



                                  I also want to highlight the option Drives which displays .PhysicalDriveXX, path, unit and controller IDs. The listing under Drive Mapping might also be quite useful.






                                  share|improve this answer






























                                    1














                                    The easiest way without installing anything and tinkering with Powershell scripts might be System Information Viewer a portable Windows application. This app is great because it provides nearly every information about your machine / hardware. It not only offers a read out of hard drive related data rather nearly everything about your device can be found. Moreover it's very lightweight but TBH a bit confusing structured.



                                    Finally, how do you find drive information? Under Volumes there is the option Volume List that will give you an overview of all DeviceHarddiskvolumeXX present on your computer. Additionally you get drive letter and GUID of your partitions.



                                    I also want to highlight the option Drives which displays .PhysicalDriveXX, path, unit and controller IDs. The listing under Drive Mapping might also be quite useful.






                                    share|improve this answer




























                                      1












                                      1








                                      1







                                      The easiest way without installing anything and tinkering with Powershell scripts might be System Information Viewer a portable Windows application. This app is great because it provides nearly every information about your machine / hardware. It not only offers a read out of hard drive related data rather nearly everything about your device can be found. Moreover it's very lightweight but TBH a bit confusing structured.



                                      Finally, how do you find drive information? Under Volumes there is the option Volume List that will give you an overview of all DeviceHarddiskvolumeXX present on your computer. Additionally you get drive letter and GUID of your partitions.



                                      I also want to highlight the option Drives which displays .PhysicalDriveXX, path, unit and controller IDs. The listing under Drive Mapping might also be quite useful.






                                      share|improve this answer















                                      The easiest way without installing anything and tinkering with Powershell scripts might be System Information Viewer a portable Windows application. This app is great because it provides nearly every information about your machine / hardware. It not only offers a read out of hard drive related data rather nearly everything about your device can be found. Moreover it's very lightweight but TBH a bit confusing structured.



                                      Finally, how do you find drive information? Under Volumes there is the option Volume List that will give you an overview of all DeviceHarddiskvolumeXX present on your computer. Additionally you get drive letter and GUID of your partitions.



                                      I also want to highlight the option Drives which displays .PhysicalDriveXX, path, unit and controller IDs. The listing under Drive Mapping might also be quite useful.







                                      share|improve this answer














                                      share|improve this answer



                                      share|improve this answer








                                      edited Dec 21 '18 at 15:25

























                                      answered Dec 21 '18 at 15:20









                                      thexthex

                                      415




                                      415























                                          -1














                                          If you want just to find out where your system BCD store is take a look at REGISTRYMACHINEBCD00000000 value in HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlhivelist registry key. Yes, its location can differ from DeviceHardDiskVolume1 even if it is on the 1st partition of the 1st physical disk.






                                          share|improve this answer






























                                            -1














                                            If you want just to find out where your system BCD store is take a look at REGISTRYMACHINEBCD00000000 value in HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlhivelist registry key. Yes, its location can differ from DeviceHardDiskVolume1 even if it is on the 1st partition of the 1st physical disk.






                                            share|improve this answer




























                                              -1












                                              -1








                                              -1







                                              If you want just to find out where your system BCD store is take a look at REGISTRYMACHINEBCD00000000 value in HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlhivelist registry key. Yes, its location can differ from DeviceHardDiskVolume1 even if it is on the 1st partition of the 1st physical disk.






                                              share|improve this answer















                                              If you want just to find out where your system BCD store is take a look at REGISTRYMACHINEBCD00000000 value in HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlhivelist registry key. Yes, its location can differ from DeviceHardDiskVolume1 even if it is on the 1st partition of the 1st physical disk.







                                              share|improve this answer














                                              share|improve this answer



                                              share|improve this answer








                                              edited Oct 1 '16 at 18:50

























                                              answered Oct 1 '16 at 18:42









                                              GCRaistlinGCRaistlin

                                              185




                                              185






























                                                  draft saved

                                                  draft discarded




















































                                                  Thanks for contributing an answer to Super User!


                                                  • Please be sure to answer the question. Provide details and share your research!

                                                  But avoid



                                                  • Asking for help, clarification, or responding to other answers.

                                                  • Making statements based on opinion; back them up with references or personal experience.


                                                  To learn more, see our tips on writing great answers.




                                                  draft saved


                                                  draft discarded














                                                  StackExchange.ready(
                                                  function () {
                                                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1058217%2flist-every-device-harddiskvolume%23new-answer', 'question_page');
                                                  }
                                                  );

                                                  Post as a guest















                                                  Required, but never shown





















































                                                  Required, but never shown














                                                  Required, but never shown












                                                  Required, but never shown







                                                  Required, but never shown

































                                                  Required, but never shown














                                                  Required, but never shown












                                                  Required, but never shown







                                                  Required, but never shown







                                                  Popular posts from this blog

                                                  "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

                                                  Alcedinidae

                                                  RAC Tourist Trophy