LinuxCommandLibrary

ntfsclone

Clone NTFS partitions to an image or disk

SYNOPSIS

ntfsclone [OPTIONS] SOURCE

PARAMETERS

-o, --output FILE
    Write the cloned filesystem image to FILE. This is the destination for the clone.

--restore-image
    Restore a previously created image back to an NTFS partition. The SOURCE is the file containing the image.

-s, --save-image
    Save the image after writing it to the destination. This option can be used with restore-image to create a backup of the target filesystem.

-r, --rescue
    Attempt to rescue bad sectors by skipping over them. Data in those sectors will be lost.

--ignore-fscheck
    Ignore the result of fsck. Usually ntfsclone will refuse to create an image from a filesystem that is marked for fsck. This option overrides that behaviour.

--progress
    Display a progress bar during the cloning process.

--debug
    Enable debug mode for more verbose output.

--version
    Display version information.

--help
    Display a help message.

SOURCE
    The NTFS partition to clone, or the file to restore.

DESCRIPTION

ntfsclone is a utility for efficiently cloning NTFS filesystems.
Instead of copying the raw data block by block (like dd), ntfsclone intelligently copies only the used portions of the NTFS partition.
This results in significantly faster cloning and smaller image files, especially for partitions with a large amount of free space. ntfsclone can clone to an image file or directly to another partition.
It preserves metadata such as UUIDs, which is crucial for maintaining the integrity of the filesystem.
It is a useful tool for backups, disaster recovery, and system migration. Note: ntfsclone does *not* check the original filesystem for consistency errors during the cloning process. It will clone a damaged filesystem as-is. It is therefore recommended to first run ntfsfix on the NTFS partition before cloning. ntfsclone is part of the ntfsprogs package.

CAVEATS

ntfsclone should be used with caution. Incorrect usage can lead to data loss. Always double-check the source and destination before running the command. It does not handle encrypted filesystems very well without special options.

EXIT CODES

ntfsclone returns 0 on success, and non-zero on error. Common errors include I/O errors, insufficient permissions, and incorrect command syntax.

EXAMPLES

ntfsclone -o /path/to/image.img /dev/sda1 - Creates an image of /dev/sda1 and saves it to /path/to/image.img.
ntfsclone --restore-image /path/to/image.img /dev/sdb1 - Restores an image from /path/to/image.img to the partition /dev/sdb1.

HISTORY

ntfsclone was developed as part of the ntfsprogs suite, providing tools for managing NTFS filesystems on Linux. Its main purpose was to provide a faster and more efficient way to clone NTFS partitions compared to traditional methods like dd. The utility has been improved over time to support various features and options. It's usage has expanded with the rise of virtual machines, as it provides a quick mechanism to clone and distribute disk images.

SEE ALSO

ntfsfix(8), mkntfs(8), ntfsresize(8), dd(1)

Copied to clipboard