Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

╔══════════════════════════════════════╗
║ FILAMENT — USB Tool for Linux ║
╚══════════════════════════════════════╝

FILAMENT

A single-file, TUI/CLI USB image writer, formatter, and wiper

Version C ncurses License


What is Filament?

Filament is a single C file, TUI/CLI USB tool for Linux.

It writes ISO images to USB drives, formats drives as FAT32/exFAT, wipes drives securely, and does it all with clear safety checks and progress indicators.

No dependencies beyond libc and ncurses. No build system. No hidden magic.


Quick Start

gcc -std=c99 -Wall -Wextra -pedantic -O2 -o filament filament.c -lncurses
sudo ./filament

TUI Controls

Main Menu

Key Action
1 Write ISO to USB
2 Format USB
3 Wipe/Zero USB
4 / Q Quit

Device Selection

Key Action
↑ / ↓ Navigate devices
Enter Select device
Q Back to menu

File Browser (ISO selection)

Key Action
↑ / ↓ Navigate files
Enter Open directory / select file
Backspace Parent directory
H Toggle hidden files
Q Cancel

Format Options

Key Action
F Cycle filesystem (FAT32 / VFAT / exFAT)
T Toggle partition table (MBR / GPT)
L Set volume label
Enter Start format
Backspace Back

Wipe/Zero

Key Action
Q Quick wipe (first 1 MB)
F Full zero (entire device)
Other Cancel

All destructive operations require typing the device name (e.g., sdb) to confirm.


CLI Usage

# Show version
filament --version

# Show help
filament --help

# List USB devices
sudo filament --list

# Write ISO to USB (with verification)
sudo filament --write /dev/sdb image.iso

# Dry run (shows what would happen)
sudo filament --write /dev/sdb image.iso --dry-run

# Quick wipe (first 1 MB)
sudo filament --wipe /dev/sdb

# Full zero
sudo filament --zero /dev/sdb

# Format as FAT32 (MBR)
sudo filament --format /dev/sdb --fat32

# Format as exFAT (GPT) with label
sudo filament --format /dev/sdb --exfat --gpt --label=MYUSB

Features

  • Write ISO images — raw write with 4 MB block size, progress bar, speed, ETA
  • Verify after write — byte-for-byte comparison of written data
  • Format USB drives — FAT32 (with VFAT alias), exFAT
  • Partition tables — MBR or GPT (with CRC32 checksums)
  • Quick wipe — zeros first 1 MB (kills partition tables and filesystem signatures)
  • Full zero — zeros entire device (secure erase)
  • Safety checks — refuses to write to mounted devices or system disks
  • Device name confirmation — requires typing device name before destructive operations
  • Filesystem detection — shows current filesystem and partition table type
  • Multi-device support — lists all removable USB devices
  • File browser — navigate directories to select ISO, with hidden file toggle
  • CLI mode — full functionality without the TUI
  • Single file — no headers, no build system, minimal dependencies
  • SIGINT handling — Ctrl+C safely interrupts operations
  • Filesystem detection — shows current filesystem (FAT32, exFAT, NTFS) and partition table type

Safety Features

Filament is designed to prevent the most common USB tool disasters:

  • Mounted device check — refuses to write to any mounted device
  • System disk check — refuses to write to devices containing / or /boot
  • Device name confirmation — requires typing the device name (e.g., sdb) before any destructive operation
  • Dry run mode — CLI --dry-run shows what would happen without doing it
  • Clear device identification — shows model, serial, size, filesystem, and partition table

Supported Filesystems

Filesystem Write ISO Format Notes
FAT32 Universal compatibility, 4 GB file limit
VFAT Alias for FAT32 with long filename support
exFAT Large file support, modern systems only
NTFS Detected, not formattable

Dependencies

Filament requires only ncurses for its 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-devel

Project Structure

FILAMENT/
├── filament.c        # the entire program
├── LICENSE           # IRX License 1.0
└── README.md         # this file

Why Filament Exists

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.


Contributing

Contributions welcome. Keep it simple — Filament is intentionally a single file with minimal dependencies.


License

Licensed under the IRX License 1.0 © realvolk 2026.

Releases

Packages

Contributors

Languages