Professional Disk Imaging Tool with Clonezilla-Inspired Interface
A modern TUI wrapper for the classic Unix dd command, bringing safety, visualization, and advanced features to disk imaging operations.
Core Operations: Backup/restore disks, disk cloning, secure wipe (zero/random/DOD/Gutmann)
Network: SSH/NFS backup and restore with remote file browser
Visualization: SpinRite-style block map + traditional progress bar (toggle with v)
Safety: SMART health checks, mount detection, multi-level confirmations, automatic checksums (MD5/SHA-256)
Performance: Intelligent block size detection, multiple compression (gzip/pigz/zstd/xz)
Interface: Clonezilla colors, full keyboard/mouse navigation, scrollable logs, built-in help (F1)
╔════════════════════════════════════════════════════════════════╗
║ DD Interface v1.0.0 - Main Menu [Professional Disk Imaging] ║
╠════════════════════════════════════════════════════════════════╣
║ [1] Backup Disk to Image File ║
║ [2] Restore Image File to Disk ║
║ [3] Clone Disk to Disk ║
║ [4] Secure Wipe Disk ║
║ [5] Network Operations (SSH/NFS) ║
╠════════════════════════════════════════════════════════════════╣
║ LOG [Tab to focus] ║
║ 2024-01-15 10:30:45 - INFO - Application started ║
╚════════════════════════════════════════════════════════════════╝
↑↓:Navigate | Enter:Select | Esc:Back | Tab:Log | F1:Help | q:Quit
Block Map Progress:
║ Block Map (each char = 64 MiB): ║
║ ████████████████████████████████████▒························· ║
║ Progress: 45.2% | 32.1 GiB / 71.0 GiB ║
║ Speed: 125.3 MiB/s | ETA: 00:05:12 | Errors: 0 ║
Legend: · = Pending | ▒ = Writing | █ = Complete | X = Error
wget https://raw.githubusercontent.com/opensolutionsgroup/dd-interface/main/ddi.py
wget https://raw.githubusercontent.com/opensolutionsgroup/dd-interface/main/ddi.md
chmod +x ddi.py
sudo ./ddi.pysudo cp ddi.py /usr/local/bin/ddi
sudo cp ddi.md /usr/local/share/doc/ddi/
sudo chmod +x /usr/local/bin/ddi
sudo ddi- Python 3.6+ (all required packages in stdlib: curses, subprocess, os, sys, time, re, logging, textwrap)
- Root access (required for disk operations)
- Optional utilities: smartmontools, pigz, zstd, gzip, xz, openssh-client, nfs-common
Install optional utilities:
# Debian/Ubuntu
sudo apt-get install smartmontools pigz zstd openssh-client nfs-common
# RHEL/Fedora
sudo dnf install smartmontools pigz zstd openssh-clients nfs-utils
# Arch
sudo pacman -S smartmontools pigz zstd openssh nfs-utils- Run:
sudo ./ddi.py - Select "Backup Disk to Image File"
- Choose source device → SMART check performed → unmount if needed
- Select compression (gzip recommended) and block size (or use auto-detected)
- Enter output directory/filename → free space checked
- Confirm with "YES" → monitor progress (press
vto toggle views) - Choose checksum algorithm (MD5/SHA-256/both/skip)
- Select "Restore Image File to Disk"
- Browse/select image → checksum auto-verified if available
- Choose target device → SMART check → unmount if needed
- Confirm with "YES" → monitor progress
- Restore partition table if needed (
.geometryfile)
- Select "Network Operations" → "SSH Backup"
- Enter credentials (user@host:port) → browse remote directory
- Choose source device and compression → image created on remote server
SSH Setup:
ssh-keygen -t rsa -b 4096
ssh-copy-id user@remote-server
ssh user@remote-server echo "Connection works"Automatic pre-operation checks: Overall health, reallocated sectors, pending sectors, uncorrectable sectors, spin retry, temperature, power-on hours
Results: PASSED (safe) | WARNING (caution) | FAILED (not recommended)
- Info dialogs - Operation details (any key)
- Yes/No - Red background, keyboard only (y/n)
- Final warning - Type "YES" exactly for destructive operations
- Mount detection and unmounting
- Checksum creation (.md5/.sha256) and verification
- Partition table geometry preservation (.geometry)
- Free space checking
- Complete operation logging
| Key | Action | Key | Action |
|---|---|---|---|
| F1 | Help screen | F12 | About/credits |
| ↑/↓ | Navigate menus | 1-9 | Quick select |
| Enter | Select | Esc/q | Cancel/Quit |
| Tab | Focus log | v | Toggle view (during ops) |
| y/n | Confirm/Cancel | Mouse | Scroll/select |
Log window (Tab): ↑/↓ scroll, PgUp/PgDn page, Home/End jump, Tab/Esc return
- None - Fastest, largest files
- gzip - Balanced, compatible (recommended)
- pigz - Parallel gzip for multi-core
- zstd - Fast, excellent ratio (best for SSD)
- xz - Maximum compression, slow
Use auto-detected optimal size (analyzes physical/logical sector size + optimal I/O). Manual: 64K-1M for modern drives.
✓ SMART checks | ✓ Mount/unmount | ✓ Optimal block size | ✓ Free space check
✓ Partition table backup | ✓ Checksums | ✓ Error tracking | ✓ Complete logging
- Restore partition table:
sudo sfdisk /dev/sdX < backup.geometry - Refresh:
sudo partprobe /dev/sdX - Check filesystems if needed
Characters: · Pending | ▒ Writing | █ Complete | X Error
Colors: Green/Blue = Normal | White/Red = Error
Scale: Each char = 64-256 MiB (based on disk size/terminal width)
Press v during operation to toggle between block map and progress bar views.
Q: Why sudo/root required?
A: Direct disk access, mount/unmount operations, and dd require root privileges.
Q: Which compression method?
A: gzip for compatibility/balance, zstd for SSD/speed, xz for archival/small files.
Q: Can I resume interrupted operations?
A: No. The dd command doesn't support resuming. Start from beginning.
Q: What if power fails during operation?
A: Backup = partial/corrupted file. Restore/Clone = target disk unusable. Always maintain backups.
Q: "SMART not supported" message?
A: USB drives, some USB enclosures, VMs, and SD cards don't support SMART. DDI still works.
Q: "Device busy" error?
A: Device still mounted. DDI auto-unmounts, but if failed: sudo umount /dev/sdX* or check: sudo lsof | grep /dev/sdX
Q: SSH backup permission denied?
A: Ensure SSH keys configured (ssh-copy-id user@host), write permissions, test manually first.
Q: Terminal display corrupted?
A: Resize to 80x24+, run reset before DDI, try different terminal, check locale (echo $LANG).
Q: Backup vs Clone vs Restore?
A: Backup = create image file. Clone = direct disk-to-disk. Restore = write image to disk.
Q: Typical backup speeds?
A: HDDs: 50-150 MiB/s, SSDs: 200-500 MiB/s (uncompressed). Depends on disk, compression, CPU.
python3 -m py_compile ddi.py # Syntax check
python3 -m flake8 ddi.py --max-line-length=100 # LintPython 3, UTF-8, 100-char lines, snake_case functions, PascalCase classes, UPPER_SNAKE_CASE constants
See AGENTS.md for detailed guidelines.
Bug Reports: Check existing issues → include DDI version, Python version, distro, steps to reproduce, ddi.log output
Feature Requests: Check existing → describe use case → ensure fits DDI philosophy (safety/simplicity/visualization)
Pull Requests: Fork → feature branch → follow code style → test → update docs → clear commits → open PR
git clone https://github.com/opensolutionsgroup/dd-interface.git
cd dd-interface
python3 -m venv venv && source venv/bin/activate
pip install flake8 pylint black
sudo python3 ddi.py- Resume interrupted operations
- Sparse/incremental backups
- BitLocker/LUKS detection
- Partition-level imaging
- Image format conversion (raw/qcow2/vmdk)
- GUI wrapper
- macOS/BSD support
- Config file support
- Scheduling & email notifications
GNU General Public License v3.0 (GPLv3)
DD Interface (DDI) - Professional Disk Imaging Tool
Copyright (C) 2024 Paul Miskovsky
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Full license: https://www.gnu.org/licenses/gpl-3.0.html
Author: Paul Miskovsky
GitHub: @opensolutionsgroup
Project: dd-interface
Inspired by: Clonezilla (disk imaging) & SpinRite (block map visualization)
The dd command dates back to 1970s Unix development at Bell Labs. The name comes from IBM JCL's "Data Definition" (DD). Its unusual key=value syntax reflects JCL heritage rather than typical Unix flags.
Despite earning the nickname "disk destroyer" due to its power (one typo can wipe a disk), dd remains essential for disk imaging, bootable USB creation, benchmarking, and data recovery. DDI makes dd safer and more accessible while maintaining its power.
USE AT YOUR OWN RISK
DDI performs low-level disk operations. While it includes extensive safety features, you are responsible for selecting correct devices.
Always: Double-check selections | Maintain backups | Test on non-critical systems | Understand operations before confirming
Authors/contributors are not responsible for data loss, hardware damage, or any issues from software use.
Documentation: Built-in help (F1) | ddi.md user guide | This README
Support: Check FAQ → Review GitHub Issues → Check ddi.log → Open new issue