The following are some commands and tools for Microsoft Windows environments that are useful for storage I/O activities (among others).
So you may know and how to find out the more familiar Windows storage device (Solid State Device – SSD, Hard Disk Drives – HDD among others) names such as A:, B:, C:, D: as what you can view from the Windows Explorer, Computer or Admin tools.
However what if you need to find out a physical name for raw (not mounted) and mounted devices for configuration? For example, if you have a tool that wants the physical name for your C: drive that might be \\.\PhysicalDrive0\?
No worries, use the command WMIC DISKDRIVE LIST BRIEF
Need more detail about the devices beyond what is shown above?
Then use WMIC DISKDRIVE LIST or as in the above example, direct the output to a file with the results shown below (scroll to the left or right to see more detail information).
Availability BytesPerSector Capabilities CapabilityDescriptions CompressionMethod ConfigManagerErrorCode ConfigManagerUserConfig DefaultBlockSize Description DeviceID ErrorCleared ErrorDescription ErrorMethodology Index InstallDate InterfaceType LastErrorCode Manufacturer MaxBlockSize MaxMediaSize MediaLoaded MediaType MinBlockSize Model Name NeedsCleaning NumberOfMediaSupported Partitions PNPDeviceID PowerManagementCapabilities PowerManagementSupported SCSIBus SCSILogicalUnit SCSIPort SCSITargetId SectorsPerTrack Signature Size Status StatusInfo SystemName TotalCylinders TotalHeads TotalSectors TotalTracks TracksPerCylinder 512 {3, 4} {"Random Access", "Supports Writing"} 0 FALSE Disk drive \\.\PHYSICALDRIVE2 2 SCSI (Standard disk drives) TRUE Fixed hard disk media ATA ST3000DM001-1CH1 SCSI Disk Device \\.\PHYSICALDRIVE2 0 SCSI\DISK&VEN_ATA&PROD_ST3000DM001-1CH1\5&3626375C&0&000600 0 0 3 6 63 0 3000590369280 OK DBIOTEST 364801 255 5860528065 93024255 255 512 {3, 4} {"Random Access", "Supports Writing"} 0 FALSE Disk drive \\.\PHYSICALDRIVE3 3 SCSI (Standard disk drives) TRUE Fixed hard disk media SEAGATE ST600MP0034 SCSI Disk Device \\.\PHYSICALDRIVE3 0 SCSI\DISK&VEN_SEAGATE&PROD_ST600MP0034\5&3626375C&0&000A00 0 0 3 10 63 600124654080 OK DBIOTEST 72961 255 1172118465 18605055 255 512 {3, 4} {"Random Access", "Supports Writing"} 0 FALSE Disk drive \\.\PHYSICALDRIVE4 4 SCSI (Standard disk drives) TRUE Fixed hard disk media SEAGATE ST600MX0004 SCSI Disk Device \\.\PHYSICALDRIVE4 0 SCSI\DISK&VEN_SEAGATE&PROD_ST600MX0004\5&3626375C&0&000C00 0 0 3 12 63 600124654080 OK DBIOTEST 72961 255 1172118465 18605055 255 512 {3, 4} {"Random Access", "Supports Writing"} 0 FALSE Disk drive \\.\PHYSICALDRIVE1 1 SCSI (Standard disk drives) TRUE Fixed hard disk media SEAGATE ST9300603SS SCSI Disk Device \\.\PHYSICALDRIVE1 0 SCSI\DISK&VEN_SEAGATE&PROD_ST9300603SS\5&3626375C&0&000400 0 0 3 4 63 299992412160 OK DBIOTEST 36472 255 585922680 9300360 255 512 {3, 4} {"Random Access", "Supports Writing"} 0 FALSE Disk drive \\.\PHYSICALDRIVE0 0 SCSI (Standard disk drives) TRUE Fixed hard disk media VMware Virtual disk SCSI Disk Device \\.\PHYSICALDRIVE0 2 SCSI\DISK&VEN_VMWARE&PROD_VIRTUAL_DISK\5&1982005&1&000000 0 0 2 0 63 -873641784 64420392960 OK DBIOTEST 7832 255 125821080 1997160 255
Some of you might be familiar with Xcopy and if not, it is a handy tool for copying files, folders and directories to local as well as networked storage. Some handy Xcopy command switches include:
/j = use un-buffered IO for large files
/y = suppress prompting
/c = continue if error
/E = copy sub directories
/H = copy hidden files
/Q = quiet mode (don’t list files being copied)
In the following example the content of the Videos folder and its sub-directories (83.5GB) are copied to another destination. Note the Time /T command that is also shown which is useful for timing how long the copy takes (e.g. subtract start-time from end-time and you have elapsed time). In this example 83.5GB are copied from one place to another on the same SSD device and using the results of the Time /T command the elapsed time was about 12 minutes.
Xcopy command example
Ever have a Windows storage device or system that failed to boot, or a problem with a partition, volume or other issue?
How about running into a situation where you are not able to format a device that you know and can confirm is ok to erase, yet you get a message that the volume is write protected or read only?
Diskpart is handy, powerful and potentially dangerous tool if you are not careful as you could mistakenly drop a good volume or partition (e.g. the importance of having good backups). However Diskpart can be used to help repair storage devices that have boot problems, or for clearing read only attributes among other tasks. If you are prefer GUI interfaces, many of the Diskpart functions can also be done via Disk Management interface (e.g. Control Panel -> All Control Panel Items -> Administrative Tools -> Computer Management -> Storage -> Disk Management ). Note that Diskpart to do certain functions will need to be run as Administrator.
In the above example the LIST DISK command shows what disks are present (on-line or off-line) which means that you may see devices here that do not show up elsewhere. Also shown is selecting a disk and then listing partitions, selecting a partition and showing attributes. The Attribute command can be used for clearing Read Only modes should a partition become write protected.
Hint, ever have a device that was once had VMware installed on it, then you move it to Windows and try to reformat for use and get a Read Only error? If so, you will want to have a look at Diskpart and the Attribute commands. However BE CAREFULL and pay attention which disk, partition and volumes you are working with as you can easily cause a problem that would result in testing how good your backups are.
If you have a SATA SSD the TRIM command is a form of garbage collection that is supported with Windows 7 (SAS drives use the SCSI UNMAP). Not sure if your system has TRIM enabled? Try the following command as administrator. Note that if you see a result of "0" then TRIM is enabled while a value of "1" means that it is disabled for your system.
Want to learn more about TRIM, check out this piece from Intel as well as this Microsoft Windows item.
Have an issue or problem collecting your system statistics, or when running a benchmark, workload generation tool such as vdbench and getting an "Unable to obtain CPU statistics"?
Try the Lodctr /R command (as administrator), however read this Microsoft Tip first to learn more.
Like its name implies, if you do not have this tool, you can download it here from Microsoft to not only delete files, folders, as well as write "0" patterns across a disk to secure erase it. You can specify the number of times you want to run the write "0" patterns across a disk to meet your erasure requirements.
There is also another use for Sdelete which is if you need or want to pre-condition a SSD or other device such as for testing, you can run a pre-conditioning pass using Sdelete.
Some command options include -p #n where "n" is the number of times to run, -s recursive to process sub-directories, -z to write "0" or zero out the space on the device, -c for clean, -a to process read-only attributes. Learn more and get your copy of Sdelete from Microsoft here.
A handy tool available from Seagate (may only work with Seagate and their partner devices) is SeaTools that can give drive information, health and status as well as perform various tests including SMART.
Seagate Seatools example
Different HDD and SSD as well as storage system vendors give tools for configuration, monitoring, management and in some cases data movement with their solutions. Samsung SSD Magician is a tool I have installed for managing my SSDs (830 and 840 Pros) that has features for updating firmware, drive health as well as performance optimization. Other hand tools include the Samsung copy tool based on Clonix as Acronis among other clone or data migration utilities (more on those in a future post).
Samsung SSD Magician
While the Microsoft WIndows USB Tool is handy for dealing with Microsoft ISO, however for creating USB’s with ISO’s such as for installing VMware or Linux on bare metal systems, Rufus is a handy tool to have in the tool-box.
Another useful tool that functions as an SSH and FTP utility is Cyberduck that also supports access to Amazon S3 among other cloud services.
There are many other tools for server, storage I/O and other activities on WIndows, not to mention other platforms, however hopefully you find the above useful.
How about it, what’s your favorite Windows server, storage I/O tools and commands?
Ok, nuff said (for now)
Cheers
Gs
Greg Schulz – Author Cloud and Virtual Data Storage Networking (CRC Press), The Green and Virtual Data Center (CRC Press) and Resilient Storage Networks (Elsevier)
twitter @storageio
All Comments, (C) and (TM) belong to their owners/posters, Other content (C) Copyright 2006-2024 Server StorageIO and UnlimitedIO LLC All Rights Reserved
RTO Context Matters With RTO context matters similar to many things in and around Information…
What is Azure Elastic SAN Azure Elastic SAN (AES) is a new (now GA) Azure…
Yes, you read that correctly, Microsoft Hyper-V is alive and enhanced with Windows Server 2025,…
A theme I mention in the above two articles as well as elsewhere about server,…
March 31st is world backup day; when is world recovery day If March 31st is…
ToE NVMeoF TCP Performance Line Boost Performance Reduce Costs. Yes, you read that correct; leverage…
View Comments
Greg- Good collection of tools. One quick note: XCOPY has been deprecated since Windows 2008 and Vista; Microsoft now recommends ROBOCOPY as the officially supported copying tool (and it definitely has some nice features, such as multi-threading).
Hello Tim, happy new years and thanks for the comments.
Good point about ROBOCOPY, I skipped Vista altogether and just dabbling with 8.x now so still using Xcopy on Win 7 (x64) and SBS (e.g. server), however will start doing more with Robocopy. In addition to multi-threading, what other features do you like with Robocopy? Any caveats to be aware of?
gs
Greg- Only real major caveat I'd point out is to be VERY sure when using /MIR (mirroring) parameter --I've seen someone make an assumption about its usage, which ended up REMOVING files from destination folder which didn't exist in source.
Also, one set of parameters I always change is /R and /W --default is to retry ONE MILLION times, with default wait time of 30 seconds between retries. If you hit any locked files, you'll wait a LONG time. Depending on expected conditions, I usually set something like /R:3 and /W:5 --3 retries, with 5 second wait between.
Good tips and notes Tim, thks
Some nice features of ROBOCOPY are:
- Mirroring, to sync up two folder structures, & keep them sync'ed. Very useful when moving things to a new file server over a period of time, e.g., to pre-stage all the data for a later cutover.
- Ability to copy all file/folder attributes and NTFS permissions.
- Restartable file copies.
- Lots of powerful selection criteria.
- Ability to tune performance, e.g., over a WAN.
- Lots of logging options, with configurable output, suitable for automated handling of the log files.
- Can be used as a copy PROCESS, not just a one-time command. It can do things like monitor for changes, run every X minutes, have time windows to be active/quiescent, etc.
All told, pretty powerful tool.
Thanks Tim, have you looked at or used SyncToy?
Curious how the two compare when doing Sync (local and remote).
hi I noticed looking at the wmic results one of the hard drive models was
ST600MX0004
Did I read that correct, Is that a review model or is there somewhere that is now selling that drive? thanks
@neftali thanks for the comment and good eye, the ST600MX004 afaik have been available since last year (iirc late summer), Im not sure who all is offering them besides IBM (and others)...
Here is the STX (Seagate) spec/info/manual page with more details:
Also here is the STX SPC results that used production drives:
https://spcresults.org