Navigation:Documentation:Other:Link Collection:~~CLOUD:30~~ |
Table of Contents
About ntfscloneThe ntfsclone utility efficiently copies, backups and restores an NTFS filesystem to/from a file, partition or standard output. It is part of the ntfsprogs suite, its full description along with some usage examples can be found in the ntfsclone manual. Working with ntfsclone is like working with dd, but ntfsclone is always faster. Like dd, ntfsclone works at the disk sector level, but since it knows the underlying filesystem (unlike dd) it either ignores unused sectors or converts them into easily compressible zeros. If you store the resulting images uncompressed, most Unix file systems (xfs, jfs, ext2/3, reiser3/4, etc) as well as NTFS won't waste space for these unused sectors. Ntfsclone also has an advanced image format which makes the image files much smaller than plain dd images, by not storing the zeros at all. On the down side, such images are not loop-mountable. Why use ntfsclone
Well there are also some disadvantages:
Copy, move or restore WindowsIf you want to copy, move or restore a system or boot partition to another computer, or to a different disk or partition (e.g. hda1→hda2, hda1→hdb1 or to different disk sector offset) then you will need to take extra care. Usually, Windows will not be able to boot, unless you copy, move or restore NTFS to the same partition which starts at the same sector on the same type of disk having the same BIOS legacy cylinder setting as the original partition and disk had. The ntfsclone utility guarantees to make an exact copy of NTFS but it will never deal with booting issues. This is by design: ntfsclone is a filesystem, not system utility. Its aim is only to clone NTFS, not to clone Windows. Therefore ntfsclone can be used as a very fast and absolutely reliable building block for Windows cloning, but itself it's not enough. If you want to fix the booting issue then please take a look at http://winhlp.com/?q=node/66, or at the Forking an XP-installation mini-howto. An program named relocntfs which is reported to fix the booting issue is located in the contrib section. An other method is to use GAG (graphical boot manager) after ntfsclone :
Store only NTFS metadataOne of the advanced features of ntfsclone is to be able to create metadata images. These images are useful for analysis rather than backup purposes, as they contain only the filesystem 'metadata' (like file attributes, sizes, and locations), but not the actual file content. Such metadata images are mountable, with all files at the exact same places/names/sizes/attributes, but without the file data. This feature is mainly used for debugging. If you find the ntfsprogs tools or the kernel_driver behave wrongly with an NTFS volume, create such a very small, bzip2 compressed image (0.5-8 MB), in case the developers want to take a look. Images are also used for future regression testing. In order to store only the metadata, type the following two commands on separate lines, supposed the first one doesn't give any error: ntfsclone --metadata --output ntfsmeta.img <your_ntfs_partition> bzip2 ntfsmeta.img or ntfsclone --ignore-fs-check -mo inconsistent-ntfs.img <your_ntfs_partition> bzip2 inconsistent-ntfs.img and send the resulting file to the developer that asked for it. Even better: make it available somewhere for download. Please note that bzip2 is quite slow, on typical images it takes 10-60 minutes. Gzip could be used instead, as it's much faster, but it creates considerably larger files which are often more than 10 times in size. Another alternative would be the tar utility with the –sparse option, however this functionality of tar is seriously broken for over a year now, and results in absolutely unusable archives (tar 1.16.0 should be ok when it is released). Unpacking is a bit tricky, otherwise bzip2 would create non-sparse file: bzcat ntfsmeta.img.bz2 | cp --sparse=always /proc/self/fd/0 ntfsmeta.img Storing large NTFS volumesIf you would like to create a large image (>4GB), be aware that some file systems can not host such large files (e.g. ext2 without large file support or fat32). Therefore, you will not be able to store the image on these file systems directly. Instead, if you forsee that the image will be large enough (or if you cloned and failed), do: ntfsclone --save-image -o - /dev/sda1 | split -a 3 -b 4000m -d - windows.img That will create windows.img000, windows.img001, etc each of 4000MiB in size… Then to restore the fragments: cat windows.img* | ntfsclone --restore-image -O /dev/sda1 - This will also help you to create images that are small enough to be stored on CDs, DVDs, tapes, (diskettes?!?), etc. Reseting the bad sectors list after cloningWhen you clone a partition from a disk with bad sectors to a new disk, Windows still reports bad sectors on the new disk. This is because, by design, ntfsclone copies everything, including the bad sector list. While this is not strictly ntfsclone-related, some people may use the following procedure to reset the bad sector list after cloning:
Unless you're certain that the bad clusters were just an error, It is recommended to do a full surface scan using either your hard disk manufacturer's tools or chkdsk /r after doing this. |