(This is a guest post by Antoni Sawicki aka Tenox)
Pleased to announce that lsblk utility for Windows is finally released. This is not entirely new, the original code was on github for a few years now, but it was lacking major features of printing drive letters, mount points and filesystem types.
Why would anyone even want lsblk for Windows? There are many other “native” ways of displaying disks and volumes. For example in PowerShell:
Get-PhysicalDisk or in cmd:
wmic diskdrive list brief. Not to mention
diskpart or disk management UI. There are a few answers to this.
Firstly the output format of lsblk on Linux is rather intuitive and useful, which can’t be said about previously mentioned utilities. People with Linux background find it more like at home.
PowerShell and wmic lack ability to combine disk and volume information, unless you want to write a larger script. This is now part of lsblk.
Lastly lsblk uses low level function to list objects directly from the kernel (think WinObj), rather than going through various high level services, management interfaces and relying on VDS (Virtual Disk Service). As such it’s super fast and you can use it even with VDS stopped or inoperable. Finally it’s yet another of these native Linux tools now also available on Windows.
Finally, some of the column names may sound cryptic, so here is an explanation:
ST – Status 1=healthy 0=unhealthy
TR – Trim / Unmap / Discard Capability
RM – Removable Media
MD – Media changed (for removable media)
RO – Read only
Very nice. Any chance you could add logical and physical sector size reporting?
Yes, it’s pretty easy the information is in STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR. The question is where would you like it printed? Should it be a flag? I don’t even see this in the Linux equivalent. I also see a lot of additional info like controller/bus type, media format (eg for floppy drives), temperature, health, etc.
Probably a flag. lsblk on Linux lets you choose which columns to display with -o parameter (which includes PHY-SEC and LOG-SEC, and quite a few other columns that aren’t displayed by default).