A single-file USB tool for Linux
TUI • CLI • Write • Format • Wipe
No build system. No headers. No surprises.
What it is • Features • Quick start • CLI • Safety • Requirements
Filament writes ISO images to USB drives, formats drives as FAT32/exFAT, and wipes drives. One C file. TUI or CLI. libc and ncurses, nothing else.
It refuses to touch mounted devices or any disk with a system mount. It makes you type the device name before anything destructive. It tells you when the kernel is still buffering writes instead of inventing a speed number.
- Write ISO images: raw write, configurable block size, progress, speed, ETA
- Verify after write: byte-for-byte, mandatory unless
--no-verify - SHA-256 hashing: optional, off by default, source and target
- Compressed sources:
.gz,.xz,.bz2,.zstdecompressed on the fly - Format: FAT32, VFAT, exFAT
- Partition tables: MBR, GPT
- Quick wipe: first 1 MB
- Full zero: entire device
- Safety checks: refuses mounted devices and system disks
- Device name confirmation for anything destructive
- Filesystem detection: FAT32, exFAT, NTFS, ext; partition table type
- Multi-device listing of removable USB devices
- File browser with hidden-file toggle
- Full CLI mode
- Scripting flags:
--yes,--quiet,--log=FILE - Source hash verification against a
.sha256file before writing - SIGINT handling
- Honest progress:
buffering...until writes block, then real device speed
gcc -std=c99 -Wall -Wextra -pedantic -O2 -o filament filament.c -lncurses
sudo ./filament| Key | Action |
|---|---|
1 |
Write ISO to USB |
2 |
Format USB |
3 |
Wipe/zero USB |
4 / Q |
Quit |
| Key | Action |
|---|---|
↑ / ↓ |
Navigate |
Enter |
Select |
Q |
Back |
| Key | Action |
|---|---|
↑ / ↓ |
Navigate |
Enter |
Open / select |
Backspace |
Parent directory |
H |
Toggle hidden files |
Q |
Cancel |
| Key | Action |
|---|---|
V |
Toggle SHA-256 output |
Enter |
Confirm (asks for device name) |
Backspace |
Back |
Q |
Cancel |
| Key | Action |
|---|---|
F |
Cycle filesystem (FAT32 / VFAT / exFAT) |
T |
Toggle partition table (MBR / GPT) |
L |
Set volume label |
Enter |
Start (asks for device name) |
Backspace |
Back |
| Key | Action |
|---|---|
Q |
Quick wipe (first 1 MB) |
F |
Full zero |
| Other | Cancel |
Destructive operations require typing the device name (sdb).
filament --version
filament --help
filament --list
filament --list-partitions /dev/sdb
sudo filament --write /dev/sdb image.iso
sudo filament --write /dev/sdb image.iso --sha256
sudo filament --write /dev/sdb image.iso --no-verify
sudo filament --write /dev/sdb image.iso --dry-run
sudo filament --write /dev/sdb image.iso --unmount
sudo filament --write /dev/sdb image.iso --block-size=1048576
sudo filament --write /dev/sdb image.iso.gz
sudo filament --write /dev/sdb image.iso --verify-source=image.iso.sha256
sudo filament --wipe /dev/sdb
sudo filament --zero /dev/sdb
sudo filament --format /dev/sdb --fat32
sudo filament --format /dev/sdb --exfat --gpt --label=MYUSBBlock size: 4096 to 67108864 bytes.
| Flag | Effect |
|---|---|
--yes |
Skip interactive confirmation. Required for non-tty. |
--quiet |
Suppress progress output. |
--log=FILE |
Append an audit log. |
Destructive CLI operations prompt for yes unless --yes is given.
USB sticks lie. The kernel absorbs writes into page cache at hundreds of MB/s, then dribbles them to flash at whatever the flash can do.
- Speed shows
buffering...while the kernel absorbs. No fake number. - Once writes block, speed switches to
(writing)and shows real device speed. - Verify reads back from the device. Always honest.
- After the write pass,
Syncing to Devicewhile the kernel flushes. Slow devices can take a minute. Not a hang. Do not remove the device.
Total wall time is unchanged. Filament just tells you where it went.
| Filesystem | Write ISO | Format | Notes |
|---|---|---|---|
| FAT32 | ✓ | ✓ | Universal, 4 GB file limit |
| VFAT | — | ✓ | FAT32 with long names |
| exFAT | — | ✓ | Large files, modern systems |
| NTFS | — | — | Detected, not formattable |
Formatting shells out. Nothing else does.
| Operation | Requires |
|---|---|
| Format FAT32 / VFAT | mkfs.vfat (dosfstools) |
| Format exFAT | mkfs.exfat (exfatprogs) or mkexfatfs (exfat-utils) |
Compressed sources shell out to gzip, xz, bzip2, or zstd.
Write, verify, wipe, zero, list, and the TUI do not touch external
tools. Missing formatters means formatting fails; everything else
works.
Format always unmounts the target first.
- Mounted device check: refuses anything mounted
- System disk check: refuses any disk with a mount outside
/media,/run/media, or/mnt - Device name confirmation: type
sdbbefore anything destructive (TUI) yesprompt in CLI unless--yesis passed- Dry run:
--dry-runshows what would happen - Clear identification: model, serial, size, filesystem, partition table
ncurses for the TUI.
# Artix / Arch
sudo pacman -S ncurses
# Debian / Ubuntu
sudo apt install libncurses-dev
# Fedora
sudo dnf install ncurses-devel
# Void
sudo xbps-install ncurses-develFormatting also needs:
# Artix / Arch
sudo pacman -S dosfstools exfatprogs
# Debian / Ubuntu
sudo apt install dosfstools exfatprogs
# Fedora
sudo dnf install dosfstools exfatprogs
# Void
sudo xbps-install dosfstools exfatprogsFILAMENT/
├── filament.c
├── LICENSE
└── README.md
I'll be dead honest here. I fucking hate balenaEtcher, Rufus isn't portable to Linux, and dd reminds me of drinking 2 liters of red wine with not so great outcomes.
Filament is simple, safe, fast, and works. It does one thing well, among a few other things.
Single file. Minimal dependencies.