{"id":49876418,"url":"https://github.com/sh1ftd/disk-layout-scanner","last_synced_at":"2026-05-15T12:37:23.230Z","repository":{"id":357497740,"uuid":"1237203955","full_name":"sh1ftd/disk-layout-scanner","owner":"sh1ftd","description":"Command-line program that enumerates physical disks and prints a report to the terminal (text or JSON) or to an HTML file—drive identity, partitions, SMART, NVMe health, and related fields the OS can expose.","archived":false,"fork":false,"pushed_at":"2026-05-13T02:23:33.000Z","size":58,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-13T04:08:17.198Z","etag":null,"topics":["cli","disk","harddisk","harddrive","hdd","linux","nvme","sata","smart","ssd","windows"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sh1ftd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-13T01:17:42.000Z","updated_at":"2026-05-13T02:23:37.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sh1ftd/disk-layout-scanner","commit_stats":null,"previous_names":["sh1ftd/disk-layout-scanner"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/sh1ftd/disk-layout-scanner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sh1ftd%2Fdisk-layout-scanner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sh1ftd%2Fdisk-layout-scanner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sh1ftd%2Fdisk-layout-scanner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sh1ftd%2Fdisk-layout-scanner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sh1ftd","download_url":"https://codeload.github.com/sh1ftd/disk-layout-scanner/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sh1ftd%2Fdisk-layout-scanner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33067473,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","disk","harddisk","harddrive","hdd","linux","nvme","sata","smart","ssd","windows"],"created_at":"2026-05-15T12:37:21.034Z","updated_at":"2026-05-15T12:37:23.224Z","avatar_url":"https://github.com/sh1ftd.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# disk-layout-scanner\n\n## What it is\n\nCommand-line program that enumerates **physical** disks and prints a report to the terminal (text or JSON) or to an HTML file—drive identity, partitions, SMART, NVMe health, and related fields the OS can expose.\n\n---\n\n## Requirements\n\n- **Windows:** Administrator (SMART / pass-through / `\\\\.\\PhysicalDrive*`).\n- **Linux:** root (block dev ioctls); kernel-dependent.\n\n---\n\n## Collected data (summary)\n\n`scan_disks` fills `DiskInfo`; formatters omit sections with no valid data. Full probe list: `queries_win.c`, `queries_linux.c`.\n\n### Windows (`\\\\.\\PhysicalDriveN`)\n\n**→** [Field-level reference (Windows)](WINDOWS.md)\n\n\n| Probe / API surface | Populated fields (high level) |\n|---------------------|------------------------------|\n| `IOCTL_STORAGE_QUERY_PROPERTY` → `StorageDeviceProperty` | Vendor, product, revision, serial, `STORAGE_BUS_TYPE`, removable |\n| `IOCTL_ATA_PASS_THROUGH` → IDENTIFY | `AtaIdentifyInfo`: model/serial/fw, LBA28/48, WWN, RPM/SSD, queue depth, SATA gen, NCQ/TRIM/LBA48/write-cache/SMART capability flags, logical/physical sector layout, form factor, ATA version, UDMA, `transport_major` |\n| `SMART_SEND_DRIVE_COMMAND` + `SMART_RCV_DRIVE_DATA` | `SmartInfo` (attributes + derived temp/POH/cycles/realloc); `SmartThreshInfo` (threshold page **0xD1**) |\n| `IOCTL_STORAGE_QUERY_PROPERTY` → NVMe protocol | `NvmeHealthInfo` (log **0x02**); `NvmeIdentifyInfo`; `NvmeFwSlotInfo` |\n| `IOCTL_DISK_GET_DRIVE_LAYOUT_EX` | `DriveLayoutInfo`: MBR/GPT/other, disk signature or disk GUID, partition offset/length/type or GPT name |\n| `IOCTL_DISK_GET_DRIVE_GEOMETRY_EX` + `IOCTL_DISK_PERFORMANCE` | `GeometryInfo` (incl. media type, CHS); `PerfInfo` (bytes, counts, times, queue depth) |\n| `IOCTL_DISK_GET_CACHE_INFORMATION` + property IDs **6 / 7 / 8** | `CacheInfo`; `ExtraPropsInfo` (alignment, seek penalty, TRIM) |\n| `IOCTL_STORAGE_QUERY_PROPERTY` → `StorageDeviceIdProperty` | `DeviceIdsInfo` (typed identifiers, hex/ASCII) |\n| `ReadFile` LBA **0** (512 B) | `RawMbrInfo` |\n| Additional ATA pass-through | `AtaSecurityInfo` (IDENTIFY word 128); `PowerModeInfo`; `HpaInfo`; `DcoInfo` |\n| Trusted receive / security scan | `SedOpalInfo` |\n| SCSI MODE SENSE (**0x1A** / **0x01**) | `ScsiModePagesInfo` |\n| SetupAPI disk instance | `DevPathInfo` (instance path, friendly name, HW ID, location, driver) |\n| Volume IOCTLs + `GetVolumeInformation` | `VolumesInfo` (letter, FS, label, serial, `\\\\?\\Volume{…}`) |\n\n**→** [Field-level reference (Windows)](WINDOWS.md)\n\n### Linux (`/sys/block` → `sd*` / `vd*` / `xvd*` / `hd*` / `nvme*n*`)\n\n**→** [Field-level reference (Linux)](LINUX.md)\n\n| Data class | SATA-style (`sd*`, `vd*`, …) | NVMe (`nvme*n`) |\n|------------|------------------------------|-----------------|\n| **Storage identity** | sysfs `vendor` / `model` / `rev`; `transport` → bus guess; serial from sysfs or IDENTIFY | sysfs `model` / `serial` / `firmware_rev`; bus fixed NVMe |\n| **ATA IDENTIFY** | `HDIO_GET_IDENTITY` → same `AtaIdentifyInfo` parse as Windows | Not used |\n| **SMART / health** | SG **ATA PASS-THROUGH**, SMART READ VALUES → `SmartInfo` (no threshold page) | `NVME_IOCTL_ADMIN_CMD`, get-log **0x02** → `NvmeHealthInfo` only |\n| **NVMe Identify / FW slots** | — | Not implemented |\n| **Partition layout** | Not implemented | Not implemented |\n| **Mounts** | `/proc/mounts` → `fs_name`, `mount_point` | Same |\n| **Geometry** | sysfs `size`, `queue/hw_sector_size` → `GeometryInfo` (no CHS / media type) | Same |\n| **I/O counters** | `/proc/diskstats` → `PerfInfo` | Same |\n| **Queue / discard** | `queue/rotational`, `queue/discard_max_bytes` → `ExtraPropsInfo` | `discard_max_bytes` only; non-rotating assumed |\n| **LBA0** | `pread(512)` → `RawMbrInfo` | Not read |\n| **Device path** | `dev_path`; sysfs `device/driver` → `DevPathInfo.driver` | `dev_path` only |\n| **Security / HPA / DCO / SED / SCSI mode pages / `StorageDeviceIdProperty` / SetupAPI** | Not implemented | Not implemented |\n\n**→** [Field-level reference (Linux)](LINUX.md)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsh1ftd%2Fdisk-layout-scanner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsh1ftd%2Fdisk-layout-scanner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsh1ftd%2Fdisk-layout-scanner/lists"}