Linux "ntfsclone" Command Line Options and Examples
Efficiently clone, image, restore or rescue an NTFS

ntfsclone will efficiently clone (copy, save, backup, restore) or rescue an NTFS filesystem to a sparse file, image, device (partition) or standard output. It works at disk sector level and copies only the used data.


Usage:

ntfsclone [OPTIONS] SOURCE
    ntfsclone --save-image [OPTIONS] SOURCE
    ntfsclone --restore-image [OPTIONS] SOURCE
    ntfsclone --metadata [OPTIONS] SOURCE






Command Line Options:

-o
Clone NTFS to the non-existent FILE. If FILE is '-' then clone to the standard output. This optioncannot be used for creating a partition, use --overwrite for an existing partition.
ntfsclone -o ...
-O
Clone NTFS to FILE, which can be an existing partition or a regular file which will be overwritten ifit exists.
ntfsclone -O ...
-s
Save to the special image format. This is the most efficient way space and speed-wise if imaging isdone to the standard output, e.g. for image compression, encryption or streaming through a network.
ntfsclone -s ...
-r
Restore from the special image format specified by SOURCE argument. If the SOURCE is '-' then the imageis read from the standard input.
ntfsclone -r ...
-n
Test the consistency of a saved image by simulating its restoring without writing anything. The NTFSdata contained in the image is not tested. The option --restore-image must also be present, and theoptions --output and --overwrite must be omitted.
ntfsclone -n ...
--rescue
Ignore disk read errors so disks having bad sectors, e.g. dying disks, can be rescued the most effi‐ciently way, with minimal stress on them. Ntfsclone works at the lowest, sector level in this mode toothus more data can be rescued. The contents of the unreadable sectors are filled by character '?' andthe beginning of such sectors are marked by "BadSectoR\0".
ntfsclone --rescue ...
-m
Clone ONLY METADATA (for NTFS experts). Only cloning to a (sparse) file is allowed, unless used theoption --save-image is also used. You can't metadata-only clone to a device.
ntfsclone -m ...
--ignore-fs-check
Ignore the result of the filesystem consistency check. This option is allowed to be used only with the
ntfsclone --ignore-fs-check ...
-t
Do not wipe the timestamps, to be used only with the --metadata option.
ntfsclone -t ...
--full-logfile
Include the Windows log file in the copy. This is only useful for extracting metadata, saving orcloning a file system which was not properly unmounted from Windows.
ntfsclone --full-logfile ...
--new-half-serial
Set a new random serial number to the clone. The serial number is a 64 bit number used to identify thedevice during the mounting process, so it has to be changed to enable the original file system and theclone to be mounted at the same time on the same computer.The option --new-half-serial only changes the upper part of the serial number, keeping the lower partwhich is used by Windows unchanged.The options --new-serial and --new-half-serial can only be used when cloning a file system of restoringfrom an image.The serial number is not the volume UUID used by Windows to locate files which have been moved toanother volume.
ntfsclone --new-half-serial ...
-f
Forces ntfsclone to proceed if the filesystem is marked "dirty" for consistency check.
ntfsclone -f ...
-q
Do not display any progress-bars during operation.
ntfsclone -q ...
-h
Show a list of options with a brief description of each one.EXIT CODESThe exit code is 0 on success, non-zero otherwise.EXAMPLESClone NTFS on /dev/hda1 to /dev/hdc1:ntfsclone --overwrite /dev/hdc1 /dev/hda1Save an NTFS to a file in the special image format:ntfsclone --save-image --output backup.img /dev/hda1Restore an NTFS from a special image file to its original partition:ntfsclone --restore-image --overwrite /dev/hda1 backup.imgSave an NTFS into a compressed image file:ntfsclone --save-image -o - /dev/hda1 | gzip -c > backup.img.gzRestore an NTFS volume from a compressed image file:gunzip -c backup.img.gz | \ntfsclone --restore-image --overwrite /dev/hda1 -Backup an NTFS volume to a remote host, using ssh. Please note, that ssh may ask for a password!ntfsclone --save-image --output - /dev/hda1 | \gzip -c | ssh host 'cat > backup.img.gz'Restore an NTFS volume from a remote host via ssh. Please note, that ssh may ask for a password!ssh host 'cat backup.img.gz' | gunzip -c | \ntfsclone --restore-image --overwrite /dev/hda1 -Stream an image file from a web server and restore it to a partition:wget -qO - http://server/backup.img | \ntfsclone --restore-image --overwrite /dev/hda1 -Clone an NTFS volume to a non-existent file:ntfsclone --output ntfs-clone.img /dev/hda1Pack NTFS metadata for NTFS experts. Please note that bzip2 runs very long but results usually at least 10times smaller archives than gzip on a sparse file.ntfsclone --metadata --output ntfsmeta.img /dev/hda1bzip2 ntfsmeta.imgOr, outputting to a compressed image :ntfsclone -mst --output - /dev/hda1 | bzip2 > ntfsmeta.bz2Unpacking NTFS metadata into a sparse file:bunzip2 -c ntfsmeta.img.bz2 | \cp --sparse=always /proc/self/fd/0 ntfsmeta.imgKNOWN ISSUESThere are no known problems with ntfsclone. If you think you have found a problem then please send an emaildescribing it to the development team: ntfs-3g-devel@lists.sf.netSometimes it might appear ntfsclone froze if the clone is on ReiserFS and even CTRL-C won't stop it. This isnot a bug in ntfsclone, however it's due to ReiserFS being extremely inefficient creating large sparse filesand not handling signals during this operation. This ReiserFS problem was improved in kernel 2.4.22. XFS, JFSand ext3 don't have this problem.AUTHORSntfsclone was written by Szabolcs Szakacsits with contributions from Per Olofsson (special image format sup‐port) and Anton Altaparmakov. It was ported to ntfs-3g by Erik Larsson and Jean-Pierre Andre.AVAILABILITYntfsclone is part of the ntfs-3g package and is available at:http://www.tuxera.com/community/
ntfsclone -h ...