Releases: Amarilu84/afdw-secure-drive-wiper
AFDW v1.3
[1.3.0] - 2025-09-17
Added
- Zero-pass fallback triggered automatically if discard verification fails.
- Progress/ETA via
pvfor long writes (noise and zero passes), with automatic fallback todd status=progresswhenpvisn’t available. - Pre-partition gap wipe helper that’s MBR/GPT-aware and respects protective/primary/backup GPT areas.
Previous version (1.2) had a big problem where it wasn't correctly formatting the drive in exFat. It was wiping fine but would hang on volume ID.
This was because we were racing the kernel/udev (partition node not ready yet) and hadn’t set the partition type, so blkid/lsblk didn’t report exFAT reliably; we fixed that by adding the partprobe/udevadm settle/rescan loop and setting the type (MBR=0x07, GPT=msftdata).
After that, the only remaining “fail” was our own verifier flagging the pre-partition gap while --skip-wipe was on, which we changed to SKIP (and only FAIL in --strict).
In my pursuit to find that problem, I added some features and a more robust method of formatting and being mindful of different setups:
-
Verification suite:
- Protective MBR 0x55AA signature check.
- Pre-partition gap erased check (now SKIP when
--skip-wipe, FAIL only in--strict). - Middle/last MiB erased checks.
- Partition table type matches requested MBR/GPT.
- exFAT filesystem presence, label format, UUID format (####-####), 1MiB alignment, and readable sample inside partition.
- MBR 0x07 / GPT Microsoft Basic Data (EBD0A0A2-…) partition type validation.
-
Robust partition re-read flow:
partprobe,udevadm settle,partx,kpartx(if present),blockdev --rereadpt, and MMC rescan fallback. -
Safety checks: refuse to run in WSL or containers; refuse system/root disk unless
--genius. -
Non-interactive mode with
--device+--erase-confirm ERASE. -
FAST mode (
--fast): if DISCARD unsupported, skip noise pass. -
Skip/limit modes:
--skip-wipe,--noise-only,--zero-only. -
Formatting controls:
--no-format,--force-format,--gpt, label modes (--label RANDOM|CUSTOM,--label-text). -
mkfs selection: prefer
mkfs.exfat(exfatprogs), fallback tomkexfatfs(exfat-utils) with SPC computed from cluster size & sector size. -
Cluster-size auto-pick for exFAT based on partition size (16K/32K/64K/128K).
-
Post-format snapshot (
lsblk,blkid) and EXFAT signature verification. -
JSON logging (device metadata, modes, timings) + per-run text verification log.
-
Power-off/eject on success via
udisksctl(if available). -
Doctor mode (
--doctor) to check environment/deps. -
Auto-install optional (
--install-deps) for Debian/Ubuntu. -
Trap cleanup on signals (flush/sync before exit).
Changed
- Dependency checks tightened; clearer guidance; optional auto-install.
- Partition creation standardizes on 1MiB start; MBR type set via
sfdisk; GPTmsftdataflag set viaparted. - Label handling: RANDOM generator (A–Z0–9) or CUSTOM (sanitized, upcased, ≤11 chars).
- Exit codes clarified: 0 success, 2 when verification fails under
--strict. - Output styling consolidated under
info/warn/die; color can be disabled with--no-color.
Fixed
- Race conditions after partitioning by adding multiple re-read paths + MMC rescan.
- Correct SPC calculation for
mkexfatfswhen sector size ≠ 512. - Accurate handling of pre-partition gap for both MBR and GPT disks.
- Ensured verification respects
--skip-wipe(reports SKIP; only FAILs in--strict).
AFDW v1.2.0
First public release of AFDW (Anti-Forensic Drive Wiper).
- Securely wipe drives with forensic plausible deniability
- Choice of high entropy uninitialized noise from end to end, or factory-fresh zero's
- Attempts on-board discard/trim secure erase commands, else perform zero run
- Built-in safety checks and confirmations
- Clean Bash script, easy to run on Linux
- Full log file with time stamps, confirming every aspect of wipe and anti-forensic features