Migrating backup device

Asked by Gustavo

Suppose I have used for a long time an external disk (A) for storing my snapshots and now I bought I new one (B) and want to preserve all my previous snapshots (from A) in the new disk (B). I tried a simple 'cp' and then 'rsync -aH' but the hard links are not preserved and I end up with a lot of unnecessary duplications.

How do I copy my old snapshot data with the hard links?

Cheers,

Gustavo

Question information

Language:
English Edit question
Status:
Solved
For:
Back In Time Edit question
Assignee:
No assignee Edit question
Solved by:
Gustavo
Solved:
Last query:
Last reply:
Revision history for this message
Germar (germar) said :
#1

Hi Gustavo,

is the filesystem on your new disk able to handle hardlinks?
If your new disk is empty except the snapshot copy, you can also use dd to clone your old disk and then enlarge the partition with gparted.

Regards,
Germar

Revision history for this message
Gustavo (gustavo-andriotti) said :
#2

Thanks, I will try it.

Cheers,

Gustavo

Revision history for this message
Tom Metro (tmetro+ubuntu) said :
#3

GNU tar will handle hard links:
http://www.gnu.org/software/tar/manual/html_node/hard-links.html

The command to use it to replicate a backup tree from one file system to another would be something like:
% cd /old-drive
% tar -vcf - backintime/ | tar -C /new-drive -xf -

There's an example of this technique in the documentation:

http://www.gnu.org/software/tar/manual/html_node/file.html#SEC104
  The following example is a convenient way of copying directory hierarchy from ‘sourcedir’ to ‘targetdir’.
  $ tar -C sourcedir -cf - . | tar -C targetdir -xpf -

 -Tom