shard

Storage Health, Audit & Recovery Device

v1.10.1
NixOS x86_64

Quick Start

Install via jcli (recommended)

jcli install shard

Eight subcommands, one binary

# READ-ONLY — no auth required
sudo shard list                                  # eligible devices (USB in laptop mode, all in server mode)
sudo shard info --device /dev/sdb                # model, serial, SMART, mounts, port topology
sudo shard benchmark --device /dev/sdb           # 256 MB read throughput sample
sudo shard doctor                                # dependency + posture check

# DESTRUCTIVE — require --i-am-authorized
sudo shard --i-am-authorized erase --device /dev/sdb --mode thorough
sudo shard --i-am-authorized format --device /dev/sdb --fs luks-ext4 --label vault
sudo shard --i-am-authorized flash --device /dev/sdb --iso ./debian.iso --verify
sudo shard --i-am-authorized repair --device /dev/sdb --badblocks
sudo shard --i-am-authorized --really-yes panic  # wipe all removable USB devices

What it does

shard is a unified front-end for block-device hygiene on Linux: enumerate visible disks, read SMART health, securely erase, format (ext4 / exFAT / FAT32 / LUKS+ext4), flash ISOs with SHA-256 verify, run fsck and badblocks scans, and — under explicit two-flag authorization — emergency-wipe every removable USB stick currently attached. It orchestrates lsblk, smartctl, dd, cryptsetup, mkfs.*, fsck, and badblocks; it does not reimplement them.

Subcommands

CommandClassWhat it does
listread-onlyEnumerate eligible block devices
info --device PATHread-onlyModel, serial, SMART, mounts, port topology, partitions
benchmark --device PATHread-only256 MB direct-IO read throughput
doctorread-onlyDependency + root posture check
erase --device PATH --mode quick|thoroughdestructive*dd /dev/urandom (1 pass) or random+zeros+random (3 passes)
format --device PATH --fs ext4|exfat|fat32|luks-ext4destructive*mkfs (+ cryptsetup for luks-ext4)
flash --device PATH --iso FILE --verifydestructive*dd ISO + SHA-256 verify read-back
repair --device PATH [--badblocks]destructive*fsck -y + optional read-only badblocks scan
panic --really-yesdestructive*Wipe first 2 GiB of every removable USB device

* destructive subcommands require --i-am-authorized (or SHARD_AUTHORIZED=1) and won't act on the root filesystem device, mounted devices (without --force-unmount), or non-removable devices in laptop mode. panic additionally requires --really-yes.

SMART classifications

ClassTriggers
OKsmart_status.passed = true and no other red flags
DEGRADEDTemperature > 65 °C, power-on hours > 50 000, or NVMe percent used 80–89
CRITICALSMART self-test failed; reallocated / pending / uncorrectable sector count > 0; NVMe percent used ≥ 90; NVMe available spare < 10; NVMe media errors > 0
N/Asmartctl couldn't be invoked or returned no smart_status field (typical on raw USB without root)

External tool requirements

Run shard doctor for a host posture report. Required tools are checked at every invocation; optional tools only matter for the corresponding subcommand.

ToolRequired for
lsblk, blkiddevice enumeration
dderase, benchmark, ISO flash, panic
smartctlSMART health classification
cryptsetupformat --fs luks-ext4
mkfs.ext4format --fs ext4 (and luks-ext4)
mkfs.exfatformat --fs exfat (optional)
mkfs.vfatformat --fs fat32 (optional)
fsck, badblocksrepair

shard performs destructive operations on block devices. Always verify the target with shard info --device /dev/sdX before running erase, format, flash, or panic. The pre-flight prompt asks you to retype the exact device path because typos here lose data. --dry-run prints every command without executing if you want to see the exact dd / mkfs / cryptsetup invocations before committing.

Compliance crosswalk

This table lists controls where shard's output may form part of the evidence set presented to an assessor. It does not claim shard alone satisfies any framework — every control still requires assessor judgment and typically evidence from other sources.

Schema: compliance-crosswalk/v1 · Machine-readable: tools/shard/compliance.json

GDPR — General Data Protection Regulation (Reg. 2016/679)

RefNameHowCoverage
Art. 17 Right to erasure Certificate of destruction is a written record of secure erasure per operator/data-subject request. evidences

HIPAA — HIPAA (45 CFR §164)

RefNameHowCoverage
§164.310(d)(2)(i) Disposal Certificate of destruction documents disposal of media containing ePHI. evidences
§164.310(d)(2)(ii) Media re-use wipefs + erase modes prepare media for safe re-use. evidences

PCI-DSS — PCI-DSS v4.0

RefNameHowCoverage
Req. 9.8.1 Media destruction Certificate of destruction documents destruction of media containing cardholder data. evidences

ISO27001 — ISO/IEC 27001:2022

RefNameHowCoverage
A.7.14 Secure disposal or re-use of equipment Certificate of destruction + audit-log chain evidences the control. evidences

Release artefacts & provenance

Every signed release ships with checksum + signature sidecars plus a CycloneDX SBOM. Enterprise procurement can pin third-party components without unpacking the binary.