Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a good way to incrementally sync truecrypt containers? I currently have large containers (200gb+), and I'd like to find a way to back them up without having to mount them. Rsync seems to not be able to sync incrementally and instead tries to re-transfer the whole container each time even when only a single file inside the container changed.

Is there some rsync patch or some specific option to make rsync look harder for differences instead of transferring the whole file? Or, is there some better tool to do this?

share|improve this question
    
Were the two containers created separately or was one a copy of the other. I think if they were created separately they will be different due to the random data you enter when you created them whereas if one was a copy of the other the rsync might (I'm guessing) work better. –  Col Aug 14 '11 at 8:39
    
It was a copy. Then, I changed one file in the original container. –  vonhogen Aug 14 '11 at 20:52
add comment

4 Answers

Unfortunately, due to the nature of stream encryption, it is not possible to incrementally back up an encrypted volume. This is because the entirety of the volume is cryptographically dependent on each individual part. This is for security reasons. You will need to either decrypt the container, or copy the container entirely each time.

share|improve this answer
4  
Actually, if only the changed sections of the file are transferred then that should work. Also, TrueCrypt works on a per-block basis meaning that only those blocks with data that has been changed get modified -- updating the entire 200+ GB container file for a single changed byte would require far too many processor and disk I/O resources to be practical. –  Randolf Richardson Aug 14 '11 at 6:40
add comment

It seems this has been solved.

From the rsync website:

We are happy to report that the internal structure of truecrypt disk images make it possible to efficiently rsync them to a remote location. This means that after the initial (complete) upload of your TrueCrypt disk image, subsequent uploads will efficiently transfer only the changes that have been made to the encrypted filesystem since its last upload.

share|improve this answer
    
It is best not to provide just a link as an answer. By providing a description/precis of what you're linking to it helps in case the linked address changes. (It makes it easier to search for) –  Tog Jul 23 '13 at 11:40
add comment

I've just tested rsyncing a TrueCrypt container to a remote host.

Incremental backups do in fact work. Initial transfer of a 128 MB container:

bash$ rsync -v --progress --checksum --inplace test.tc $REMOTE_HOST:
test.tc
   134217728 100%  339.51kB/s    0:06:25 (xfer#1, to-check=0/1)

sent 134234196 bytes  received 31 bytes  338547.86 bytes/sec
total size is 134217728  speedup is 1.00

Then I copied a file to the TrueCrypt volume and rsynced again:

bash$ rsync -v --progress --checksum --inplace test.tc $REMOTE_HOST:
test.tc
   134217728 100%   49.42MB/s    0:00:02 (xfer#1, to-check=0/1)

sent 162256 bytes  received 81140 bytes  23180.57 bytes/sec
total size is 134217728  speedup is 551.44

As you can see, after adding a file to the container, the second transfer was only 160 KB.

Notes:

  • the --checksum option tells rsync to use checksums instead of only looking at the mod-time and size; if you don't do this, rsync won't know that the volume changed.
  • the --inplace option tells rsync to update the destination file in-place.
share|improve this answer
    
I feel I should add that from experience backing up, I recommend not using --inplace option for real backups, to prevent corruption in the case of partial transfers. Also, from experience, I've found --checksum is not really needed. –  QuasarDonkey Mar 27 at 16:49
add comment

RSync is a good tool for this because of its "delta-transfer" feature (which is enabled by default) that only transfers changed sections of files.

The fact that your file is at least 200 GBs means that when RSync reads the entire file to detect changes, it's likely that you're getting the impression that the whole file may be getting transferred instead of only its changes.

share|improve this answer
    
I have the -P option turned on, so I can see the amount being transferred. It is transferring all 200gb by my calculations (the time also suggests this since it's indicating 4-5 more hours to go). I only changed one 30mb file within the container. –  vonhogen Aug 14 '11 at 6:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.