Skip to main content

lsdsk

English | Deutsch

CI CodeQL License: MIT Open in Codespaces PyPI PyPI - Downloads Code Style: Ruff codecov Maintainability security: bandit

lsdsk is a storage diagnostic for Linux and Windows: it groups every drive under the controller and the PCIe path it hangs off, reads what the ports and the drives can do and what they actually negotiated, reads SMART data and error counters, and recommends what to act on.

c't Magazin covered it on 17 September 2026, in German: Kommandozeilentool lsdsk: Performance-Engpässe bei SSDs und Controllern finden.

Ten drives, three controllers, a chipset and a riser between them and the CPU. The machine boots fine, and nothing on it tells you that one card negotiated x1 in an x8 slot, that two SSDs share a link, or that the free port you were about to fill hangs off an uplink that is already full. A storage server rarely fails outright. It runs quietly for years with a shortfall that is easy to fix, and the values that would explain it are spread across sysfs, a set of ioctls and the mainboard manual.

lsdsk starts no subprocesses and makes no network requests: every value it prints was read directly, from sysfs and direct ioctls on Linux and from SetupAPI and DeviceIoControl on Windows.

QUICKSTART

The command below needs uv and nothing else; if uv is not installed yet, INSTALL.md documents the one-line installer for Linux, macOS and Windows.

For full information run lsdsk as root or Administrator. Without those rights you lose SMART wear, the error counters, PCIe connector detection and the SATA controllers' port count. The details are in INSTALL.md.

The usual invocation is uvx lsdsk@latest - uv then installs the newest version in a virtual environment. The rest of this document writes the short form lsdsk for readability.

# run as Administrator or root for full information 
uvx lsdsk@latest          # lsdsk TUI
uvx lsdsk@latest report   # get a printed report
uvx lsdsk@latest --help   # get further help

uvx lsdsk@latest opens an interactive view at a terminal, with a page per topic; piped or redirected it prints the same data as one page: the mainboard, what is wrong, the controller tree, every disk's identity, wear and error counters, every SMART attribute, the PCIe slots, and each finding with its reasoning.

The TUI

Number keys switch between the pages, Tab cycles, and every page is also a subcommand, so lsdsk health prints exactly what page 4 shows.

The lsdsk interactive view: eight pages, the tree density cycling, the detail panel, and a table being scrolled

Six of the eight pages carry a cursor, and a panel under the table gives the detail: every value the row had no column for, and the findings that go with it. PAGES.md describes all eight pages in detail.

Through a pipe, into a file, or with the command lsdsk report, the program prints text instead, most important findings first. REPORT.md documents that report.

Privileges

lsdsk runs unprivileged too. Topology, PCIe link state, SATA capability and negotiated speed, SAS phy rates, capacity, controller firmware and NVMe temperature all read without elevated rights.

Four things do need root or Administrator:

  • SMART attributes and wear.
  • The error counters, so trend and record.
  • PCIe slot numbers and whether a port is a real connector.
  • The AHCI capability register.

Inside an LXC or Proxmox container these values cannot be read even with elevated rights.

lsdsk ships a skill for Claude Code

The hard part of a storage report is not reading it, it is knowing which findings deserve action. lsdsk ships that judgement as a Claude Code skill, so an agent reading the output reaches the same conclusions a practised admin would.

# in claude code
/plugin marketplace add bitranox/lsdsk
/plugin install lsdsk

The skill shows and explains what the tool cannot: that a CRC count is the cable and never the drive, that a wear percentage means nothing without the drive's own threshold, that a controller capped by the board has two opposite remedies depending on whether a faster port exists and is merely occupied, and that a slot number is matched against the mainboard manual because no readable source gives the form factor. lsdsk can also export every value as JSON, and the skill can then interpret that data on another machine. Nobody wants an agent running on the server itself.

Install

uvx lsdsk@latest       # run without installing
uv tool install lsdsk  # install for repeated use, in its own venv
pip install lsdsk      # if you prefer the old way

Python 3.11 or newer, Linux or Windows. It shells out to nothing: no smartmontools, no nvme-cli, no lspci, no subprocess of any kind, and no network access at any point. Its own Python dependencies are declared in pyproject.toml.

From the hardware lsdsk reads only a controller's numeric identifiers, not its name. The PCI name database therefore ships with it. That is why a controller reads the same on Linux and on Windows; lsdsk does not quote the localised device names Windows carries. See NOTICE for that database's licence.

How lsdsk works

Linux reads sysfs and issues SG_IO ATA passthrough and NVMe admin ioctls directly. A SATA port's own speed comes from the AHCI controller's capability register. Windows uses SetupAPI and DeviceIoControl through ctypes, with no WMI and no PowerShell. Both platforms receive the same ATA IDENTIFY, ATA SMART and NVMe structures, so a single set of decoders serves both and is tested against captures from real hardware on every supported operating system.

Every command lsdsk issues is a read. It never writes to a device or a controller.

Documentation

Document What it covers
PAGES.md The eight pages and the key bindings
REPORT.md The one-page report
COMMANDS.md Every command and global option, the JSON envelope, and the exit codes
FINDINGS.md What it reports, and what evidence each rule needs
WHY.md The problem it was written for, and the two cases easiest to get wrong without it
INSTALL.md Installing it, and what works unprivileged versus what needs root
CONFIG.md Every configuration key, the layered sources, and the env-var forms
DEVELOPMENT.md Working on lsdsk: the gate, the test lanes, capturing a fixture
CONTRIBUTING.md How to propose a change
SECURITY.md Reporting a vulnerability
CHANGELOG.md What changed, and when
docs/systemdesign/module_reference.md Every module, the layer rule, the CLI commands and the exit codes
ai-transparency.md Where an AI assistant was used, what was verified on real hardware, and what was not
ai-stance.md Why the project takes that position

Licence

MIT.

Metadata

Release files for lsdsk 1.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lsdsk 1.3.1
File Size Uploaded
lsdsk-1.3.1.tar.gz 3.8 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for lsdsk 1.3.1
File Interpreter ABI Platform
lsdsk-1.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 4.4 MB

Release files / lsdsk-1.3.1.tar.gz

Download URL lsdsk-1.3.1.tar.gz
Size 3.8 MB
Tags Source
SHA-256 checksum
How to use checksums
c2def4a46f30d306dbcafb840cbfc0167977f16f37e439a14aea19332af863c5
BLAKE2b-256 checksum
How to use checksums
3294dd7c4c464416df799d1f368955120a9fed9c1ec00ce104e85c4e0b201163
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / lsdsk-1.3.1-py3-none-any.whl

Download URL lsdsk-1.3.1-py3-none-any.whl
Size 598.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
39204cd11c56817c0bc4285c2bbffee42361332c605260105b0cb614291afa90
BLAKE2b-256 checksum
How to use checksums
b0aa59028d75bdeeb057171cb1b51771bec8cc2b6eb477ee4220b173a740affb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

1.5.0

2 release files

This release

1.3.1 This release

2 release files

1.3.0

2 release files

1.2.15

2 release files

1.2.14

2 release files

1.2.12

2 release files

1.2.11

2 release files

1.2.10

2 release files

1.2.9

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page