https://github.com/p-kraszewski/image_writer_rs
Write bootable OS images to USB drive (dd on steroids)
https://github.com/p-kraszewski/image_writer_rs
Last synced: about 1 month ago
JSON representation
Write bootable OS images to USB drive (dd on steroids)
- Host: GitHub
- URL: https://github.com/p-kraszewski/image_writer_rs
- Owner: p-kraszewski
- License: bsd-2-clause
- Created: 2025-07-31T07:07:34.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2025-08-16T15:35:56.000Z (3 months ago)
- Last Synced: 2025-08-16T16:34:11.762Z (3 months ago)
- Language: Rust
- Size: 24.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `image_writer_rs`
## Warning
**WARNING WARNING WARNING**
The code assumes:
* You run it on Linux
* The `/dev/disk/by-id/` directory exists and is properly populated
* The `/sys/block/` directory exists and is properly populated
## Features
- Autodetect any writable USB mass storage with non-zero capacity, show choice when more than 1 detected.
- Show warning with exact detected device name and countdown before writing an image - you have 10 seconds to `^C` if
you
change your mind.
- Warn if the disk image appears to not be bootable (missing `0x55AA` signature in the first sector)
- Abort if (eventually decompressed) disk image is not a multiple of 512 bytes.
- Support various disk image types (extension is case-insensitive):
- Uncompressed: `.ISO`, `.FS`, `.IMG`, `.IMA`, `.DD`, `.BIN`, `.RAW`
- Compressed: `.BZ2`, `.BZIP2`, `.GZ`, `.GZIP`, `.XZ`, `.LZMA`, `.PIXZ`, `.ZST`, `.ZSTD`, `.LZ4`
- All images need to be in RAW format (after the eventual decompression).
- Write directly to the device, bypassing cache.
- Verify written data against the original image.
## TODO
- [x] Check if image fits on media.
- [ ] Optionally fix the secondary GPT partition table to end of written media (warning - will invalidate checksum as it
must modify the primary GPT partition)
- [ ] Support VM partition images (like `qcow2` or `vmdk`) - that is copy virtual disk to a physical one.