Thursday, August 25, 2011

Backing up NTFS partitions

The reasons for backing up your NTFS filesystem vary but the task is quite simple (if you don't use NTFS advanced features such as bitlocker or compression). You can do it with "ntfsclone" (part of ntfs-3g package) that runs on many operating systems - it is also included in System Rescue CD mentioned in earlier posts.

It's usage is quite simple: ntfsclone -s -o [output file] [input device]
The "-s" switch enables a "special format" that ignores empty space, so the output file is smaller. Without it the file is bigger (it uses sparse file function so it is not THAT big) but you can mount it as a loopback device and access its contents (you can't do that with the "special format").

You can also use compression but better have a fast processor or enough time:
ntfsclone -s -o - [input device] | pigz > [output file]
pigz is a parallel gzip compressor that uses all your CPU cores for compression and is preferred over gzip. But you can also use bzip2, xz or any other compressor that works with standard input/output.

Next article: how to restore the backed-up NTFS partition.

No comments:

Post a Comment