Jump to content











Photo
- - - - -

How to detect SSD and HDD drives using CMD batch in WinPE ?


  • Please log in to reply
No replies to this topic

#1 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 540 posts
  •  
    India

Posted 21 January 2024 - 05:31 AM

Hi.

 

For unattended Windows Installation in PCs containing both SSD and HDD, It is required to detect SSD Drive Number. I have tried wmic in boot.wim environment to get any info regarding SSD. But unable to find out a way to figure out which Disk is SSD or HDD. 

 

Is there any method to detect SSD Disk Number in WinPE environment using CMD batch file ?

 

Please help...

 

Regards...



#2 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 21 January 2024 - 01:38 PM

Find the smallest "Fixed hard disk media" device?

Not accurate/universal of course, but I would guess that it would be accurate on 99% of PC's with one SSD and one HDD.

 

Also, "unattended" requires anyway some initial attendance, unless - maybe - if it is "mass deploying on n identical machines" (in which case the target device can be set to a "fixed" value or "Model" can be used to find the SSD with WMIC)

 

:duff:

Wonko



#3 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 540 posts
  •  
    India

Posted 26 January 2024 - 01:58 PM

Is there any 32-bit winpe and 64-bit winpe simple command line program to measure random-reads of an unformatted disk and output result to console ?
 
This way we will be abole to list SSD and HDD as per these speed in decending order for preferred instalation disk !
 
Regards...


#4 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 27 January 2024 - 10:19 AM

Well, you can use dsfo with output to nul and read the time it took in batch.

Something *like*:

dsfo \\.\Physicaldrive1 0 1073741824 NUL

will result in something *like*:

OK, 1073741824 bytes, 39.510s, MD5 = 786a48c5db7548a6bf34cb945b62ae75

but of course you need to add dsfo to the winpe build.

 

These are not random, but rather sequential reads, but the speed difference between a SSD and a HDD should be noticeable nonetheless.

 

:duff:

Wonko



#5 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 540 posts
  •  
    India

Posted 27 January 2024 - 11:28 AM

https://github.com/a...ases/tag/latest

 

Microsoft Windows [Version 10.0.22621.3007]
(c) Microsoft Corporation. All rights reserved.

C:\Windows\System32>cd C:\Users\KRISHNA\Downloads\nwinfo

C:\Users\KRISHNA\Downloads\nwinfo>nwinfo_x64 --disk=\\.\PhysicalDrive0 --no-smart
---
NWinfo:
    Build Time: 'Jan 27 2024 12:52:09'
    libnw: 'v0.9.5.0'
    MSVC Version: '193732826'
    NT Version: '10.0.22621'
    Driver: 'NOT FOUND'
    Language ID: '1033'
    libcpuid: '0.6.4'
    CrystalDiskInfo: '9.2.1'
    PCI ID: '2024.01.25'
    USB ID: '2024.01.20'
    PNP ID: '2024.01.27'
    JEP106 ID: '2023.09.29'
    Error: [ '~' ]
    Disks:
        - Disk:
            Path: '\\.\PhysicalDrive0'
            HWID: 'SCSI\Disk&Ven_APPLE&Prod_SSD_SM0128G\5&17298cac&0&000000'
            HW Name: 'APPLE SSD SM0128G'
            Product ID: 'APPLE SSD SM0128G'
            Product Rev: 'BXZ33A0Q'
            Serial Number: 'S2XUNY6J802678'
            Serial Number (Raw): 'S2XUNY6J802678'
            Type: 'SATA'
            Removable: No
            Size: 121332826112
            Partition Table: 'GPT'
            GPT GUID: '{0249C2AD-7AEA-C44C-9D26-43D1C93A918F}'
            SSD: Yes
            Volumes:
                - Volume:
                    Path: '\Device\HarddiskVolume3'
                    Volume GUID: '\\?\Volume{daaf04b2-da21-4fa6-b9fb-38519e799079}'
                    Starting LBA: 68964352
                    Partition Number: 3
                    Partition Type: '{EBD0A0A2-B9E5-4433-87C0-68B6B72699C7}'
                    Partition ID: '{DAAF04B2-DA21-4FA6-B9FB-38519E799079}'
                    Partition Flag: 'DATA'
                    Label: 'WIN 11'
                    Filesystem: 'NTFS'
                    Free Space: 4994064384
                    Total Space: 64500002816
                    Usage: '92.26%'
                    Volume Path Names:
                        - Mount Point:
                            Drive Letter: 'C:\'
                - Volume:
                    Path: '\Device\HarddiskVolume4'
                    Volume GUID: '\\?\Volume{8e862813-ea70-4b12-8294-4ac071d43d32}'
                    Starting LBA: 194940928
                    Partition Number: 4
                    Partition Type: '{EBD0A0A2-B9E5-4433-87C0-68B6B72699C7}'
                    Partition ID: '{8E862813-EA70-4B12-8294-4AC071D43D32}'
                    Partition Flag: 'DATA'
                    Label: 'MULTIMEDIA'
                    Filesystem: 'exFAT'
                    Free Space: 5074124800
                    Total Space: 21517828096
                    Usage: '76.42%'
                    Volume Path Names:
                        - Mount Point:
                            Drive Letter: 'D:\'
                - Volume:
                    Path: '\Device\HarddiskVolume1'
                    Volume GUID: '\\?\Volume{0ffa4b92-e931-44b4-827f-f3a75fcd28c8}'
                    Starting LBA: 40
                    Partition Number: 1
                    Partition Type: '{C12A7328-F81F-11D2-BA4B-00A0C93EC93B}'
                    Partition ID: '{0FFA4B92-E931-44B4-827F-F3A75FCD28C8}'
                    Partition Flag: 'ESP'
                    Label: 'EFI'
                    Filesystem: 'FAT32'
                    Free Space: 140542976
                    Total Space: 206472192
                    Usage: '31.93%'
                    Volume Path Names: ~

C:\Users\KRISHNA\Downloads\nwinfo>

nwinfo.exe seems interesting now. It may help...



#6 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 27 January 2024 - 05:31 PM

It depends on how (exactly) that information is retrieved.

 

Powershell has a suitable command but it is said to be not always reliable

Get-PhysicalDisk | Format-Table -AutoSize

:duff:

Wonko



#7 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 31 January 2024 - 02:12 PM

It runs under WinPE OK.

See https://rmprepusb.bl...tility-for.html






2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users