Clone2fs is a handy program that helps you copy an ext2/ext3 file system to another volume or even an image file. If you're sending it to a volume, just make sure there’s enough space to fit the whole file system. And if your source is bigger than the destination, no worries! You can use resize2fs from the e2fsprogs package to shrink it down before copying.
So, what's cool about clone2fs? Unlike dd, it doesn’t just copy everything in sight; it only grabs the blocks that are actually in use. This usually makes it a lot faster! Plus, it's quicker than other backup tools like dump/restore or tar because it mostly accesses the source and destination volumes one after another.
A quick heads-up: clone2fs lets you clone a mounted file system without any warnings—even if it's writable. If you do this, you’ll need to run e2fsck on the finished image to keep things consistent. Since cloning takes some time, any changes made while clone2fs is working might not show up in your clone. For an exact replica, it's best to unmount the source file system or remount it as read-only.
If your destination is a disk partition, any unused blocks will stay as they are unless you tell clone2fs to zero-fill them using the -Z option. But if you're sending data to a file, clone2fs smartly uses lseek() to skip unused blocks. This does what -Z does but takes up less space if your target filesystem supports sparse files. When writing to devices that don’t support seeking, clone2fs acts like -Z is on and fills those empty blocks with NUL bytes.
This tool also copies the boot sector (block #0) of your source file system just as it is—even if it's filled with NUL bytes. However, don't expect that you'll be able to boot from a cloned volume right away! Boot sectors often have specific references tied to disk sectors (like GRUB's boot sector points somewhere). If you change where the volume sits on disk, those references won’t work anymore. To make your cloned volume bootable again, mount it somewhere and reinstall the boot loader—trust me; this is much safer!
Usage:
clone2fs [option...] (device|image)
-h
: display this help-o output
: write image to -O output
: write image even if -q
: be less verbose -V
: show program version and exit -Z
: zero-fill unused blocks Go to the Softpas website, press the 'Downloads' button, and pick the app you want to download and install—easy and fast!
SoftPas is your platform for the latest software and technology news, reviews, and guides. Stay up to date with cutting-edge trends in tech and software development.
Subscribe to newsletter
© Copyright 2024, SoftPas, All Rights Reserved.