diskforge is a command-line utility for creating disk images, backing up, and restoring. It supports sparse copying, compression, and other features.
- Copying disks and partitions
- Creating disk images (full and sparse)
- Restoring disk images
- Compressing images (tar.xz, tar.zst)
- Verifying copies
- Large file support
- Sparse copying (skip zero blocks)
To build diskforge, you need a C compiler (e.g., GCC or Clang) and the zstd, xz, and archive libraries.
-
Clone the repository:
git clone <repository_url> cd diskforge
-
Build the project:
./build.sh
This will create the
diskforgeexecutable in thebuild/distdirectory.
Usage: diskforge [options]
-i input_file: The input file to copy from.
-o output_file: The output file to copy to.
-b block_size: The block size to use for copying (default: 4194304).
-v: Show version and exit.
-s: Create an image from a disk (sparse).
-z: Restore an image to a disk.
-x: Create a tar.xz archive from a disk.
-t: Create a tar.zst archive from a disk.
-f: Enable sparse copy (skip zero blocks).
-h: Show help and exit.
Examples:
diskforge -i /dev/sda -o disk.img (Create a full disk image)
diskforge -i /dev/sda -o disk.img -f (Create a sparse disk image)
diskforge -i disk.img -o /dev/sdb (Restore a disk image)
diskforge -i /dev/sda -o disk.tar.xz -s (Create a tar.xz archive)
diskforge -i /dev/sda -o disk.tar.zst -s (Create a tar.zst archive)
-i input_file: Path to the input file (disk, partition, or image).-o output_file: Path to the output file (image, disk, or partition).-b block_size: Block size for copying (in bytes). Default: 4194304 (4MB).-v: Show version information and exit.-s: Create a disk image (sparse).-z: Restore a disk image.-x: Create atar.xzarchive.-t: Create atar.zstarchive.-f: Enable sparse copying (skip zero blocks).-h: Show help and exit.
-
Create a full disk image:
diskforge -i /dev/sda -o disk.img
-
Create a sparse disk image:
diskforge -i /dev/sda -o disk.img -f
-
Restore a disk image:
diskforge -i disk.img -o /dev/sdb
-
Create a
tar.xzarchive:diskforge -i /dev/sda -o disk.tar.xz -s
-
Create a
tar.zstarchive:diskforge -i /dev/sda -o disk.tar.zst -s
diskforge is released under the MIT license. See the LICENSE file for more information.
AnmiTaliDev
diskforge is part of the FOSP NurOS project.
1.0.2