shard

Storage Health, Audit & Recovery Device

v1.10.0
Linux

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.