This software can clone ext2 and ext3 file systems with ease, allowing for easy replication and backup of important data.
Clone2fs is a program that enables the copying of an ext2/ext3 file system to another volume or image file. However, if the destination is a volume, it must be able to accommodate the entire file system. To reduce the size of the source before copying, you can use resize2fs from the e2fsprogs package.
Features:
Clone2fs is faster than dd because it copies only the blocks that are in use, rather than copying the whole volume. Similarly, it is quicker than other backup software such as dump/restore or tar because it accesses source and destination volumes sequentially most of the time.
If required, you can clone a mounted file system without receiving a warning, even if it is writable. However, the resulting image may require e2fsck in order to render it consistent. Since the copying process takes a while, changes may or may not become visible in the clone while clone2fs is working. For an exact clone, the source file system should be unmounted or remounted in read-only mode.
If the destination is a disk partition, unused blocks in the cloned file will remain unchanged unless clone2fs is requested to zero-fill them using the -Z option. If the cloned image is a file, clone2fs uses lseek() to skip unused blocks. This technique has the same effect as -Z and requires less space if the target filesystem supports sparse files. If the cloned data is being written to a pipe or other device that doesn't support seeking, clone2fs will pretend that -Z is set and fill unused blocks with NUL bytes.
Clone2fs always copies the source file system's boot sector (block #0) unmodified, even if it is made solely of NUL bytes. Nevertheless, cloning a volume does not guarantee all clones will be bootable. Boot sectors typically include direct links to specific disk sectors, so if a volume's disk position has changed, these references will be invalid. Clone2fs doesn't provide an option to correct the references. To make the copy bootable, you must mount it and re-install the bootloader by chrooting and running re-installation. This is safer than modifying the boot sector directly if the boot sector is in the MBR.
Usage:
Clone2fs is used in the following way:
clone2fs [option...] (device|image)
Options:
-h: displays help
-o output : write the image to < output >; "-" represents stdout
-O output: write the image to < output > even if it already exists
-q: minimizes the level of verbosity
-V: displays the program version and exits
-Z: zero-fills unused blocks.
Version 1.2.0: N/A