Re: [Dar-support] Continuing an interrupted backup
For full, incremental, compressed and encrypted backups or archives
Brought to you by:
edrusb
From: Denis C. <dar...@fr...> - 2013-05-17 21:14:05
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Le 17/05/2013 20:45, Charley Dixon wrote: > Hi Denis, Hello Charley, > > thanks for confirming that I was looking to the right direction. I > should have probably been more specific as to why this approach > confused me. > > First I do not want to experiment with multi-100GB backup, so let me > make a smaller one for testing: of course, > > # dar_xform -s 256K -p /path/to/backup testbackup > Finished writing to file 1, ready to continue ? [return = YES | Esc = NO] > Received signal: Interrupt > Archive delayed termination engaged > Disabling signal handler, the next time this signal is received the > program will abort immediately > Continuing... > Program has been aborted for the following reason: Thread cancellation > requested, aborting as properly as possible > > > Now I need to make sure there is at least one full file in the test backup: > OK > # ls -lh testbackup* > -rw-r--r-- 1 root root 256K May 17 07:01 testbackup.1.dar > -rw-r--r-- 1 root root 1 May 17 07:01 testbackup.2.dar > # dar -l testbackup -0 > [data ][ EA ][compr][S]| permission | user | group | size | > date | filename > ------------------------+------------+-------+-------+-------+-------------------------------+------------ > [Saved] [-----][ ] drwxr-xr-x root root 0 Wed > May 11 07:58:23 2011 opt > [Saved] [-----][ ] drwxr-xr-x root root 0 Wed [...] > correct file. [return = YES | Esc = NO] > Escaping... > Aborting program. User refused to continue while asking: > testbackup.2.dar has a bad or corrupted header, please provide the > correct file. > > > Finally I may try to make an isolated catalog: OK > > # dar -C foo -A testbackup -0 > testbackup.2.dar has a bad or corrupted header, please provide the > correct file. [return = YES | Esc = NO] This behavior is due to the way you generated testbackup: Interrupting dar_xform at slice boundary made a second slice having only on byte. Thus, for dar, this file is even not a dar slice... solution here is to remove the second slice as it is smaller than around 20 bytes. The "relax" (checking) mode is only implemented for archive restoration so we cannot use it here. For a more interesting test, I would suggest not using -p option with dar_xform and hitting Ctrl-C twice at a random time. You will either get a last slice with user data (and thus a complete header) of as here a too short slice to contain even a complete slice header, so you can remove it. # dar_xform -s 256k large testbackup ^CReceived signal: Interrupt Archive delayed termination engaged Disabling signal handler, the next time this signal is received the program will abort immediately Program has been aborted for the following reason: Thread cancellation requested, aborting as properly as possible # ls testbackup.* | wc -l 134 # ls -l testbackup.134.dar - -rw-r--r-- 1 denis maison 60082 17 mai 22:46 testbackup.134.dar The last slice is shorter than 256k due to dar_xform interruption and has enough bytes to hold a slice header (+/- 20 bytes), and we can see by the following test using usual direct access mode (i.e.: not sequential mode) that the archive has no internal catalogue: # ./dar -t testbackup Error while reading archive's header, this may be because this archive is an old encrypted archive or that data corruption took place, Assuming it is an old archive, we have to read the header at the beginning of the first slice... Final memory cleanup... FATAL error, aborting operation Found a correct archive header at the beginning of the archive, which does not stands to be an old archive, the end of the archive is thus corrupted. You need to use sequential reading mode to have a chance to use this corrupted archive > Escaping... > Aborting program. User refused to continue while asking: > testbackup.2.dar has a bad or corrupted header, please provide the > correct file. Now, I met a bug that is present up to version 2.4.10 (probably since 2.4.0) that lead dar to cause a segmentation fault when isolating a catalogue from an truncated archive. So I fixed it (fix is available in GIT on branch_2.4.x) and now dar works as expected: # ./dar -C foo -A testbackup -0 ERR <ROOT>/var/cache/apt/archives/... : can't read data CRC: No escape mark found for that file Uncompleted archive! Assuming it has been interrupted during the backup process. If an error has been reported just above, simply ignore it, this is about the file that was saved at the time of the interruption. A problem occurred while reading this archive contents: Cannot extract from the internal catalogue the list of files to remove #./dar -l foo -q Archive version format : 08 Compression algorithm used : bzip2 Scrambling or strong encryption used : no Sequential reading marks : present Catalogue size in archive : 4553 bytes User comment : "./dar" "-C" "foo" "-A" "testbackup" "-0" Archive is composed of 1 file(s) File size: 4747 bytes [...] and so on. In conclusion, the catalogue isolation from the partial archive is optional and has a bug up to release 2.4.10 (fix is available in GIT as wrote above). But you can also make a differential backup directly taking the partial archive as reference using sequential reading mode: # dar --create foo2 -A testbackup -0 -R / ... However having the isolated catalogue is really useful to speed up the operation on your large and truncated archive, in particular if you need to restore few files from it. So my best suggestion is to use the latest dar version available on branch_2.4.x on GIT to be able to build the extracted catalogue, keep it for later restoration and here use it to build a differential backup to complete your backup process without throwing away the large partial backup you already get. Regards, Denis. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIVAwUBUZadjAgxsL0D2LGCAQLD0RAAtWFxQpGuoNuSralXSqW44ws28M0GI+Om fqj9TochI5UjLx5Bxr64beVKKEpLmsMw18DdyRS5pcMYljR+WbMS7389ZeIamvBh QJY6q63H+JErzZFd1Xhn0nZuhGS9FRw4ZnUvBBEVHdvJkF5XrQmT+C4M3mBQPVVW 2E5CVgLkWWXnR4AvCPJnHhL1DG2tktRasArw/AP7R5MwwE+b5kMFm3OjHa5Siz9w jAN+bcI1fEjBJVmCA/RTHWS110yQA1njQCoINcXgACtEmljEa//OTfhj162UI0RX YFIaSa207G0if5dMa/896cIb5d6l8yy+UYPnkkmThbXgOHU+3xvLNsNrIoKGHvUS U1XOg6mg3NGw1t7ytqps/acuCse/RcXQwMovhQxs7mjRxDWJsJHRDrAkytlQCs9N mvWnVCe5M/tRFV7j1SIFhslKRSaNPlleXJTcRCWndNNixHBM7cyU9kQddOHY8Wtd ezwP3IS5CkHp/Fbf3KT3V9tWAyAcpjo/cE6G3L0V5eVD+Ck4XMfmz9IrAC34rEvy //SE6edSHxtFLA7JqVkniJxGHq6G7ugMKBCHtXH0qBvySAqtlUXh5z+9Wnc1Bghv E09QoWxZOMo+NpOM4sLgXo6Eksr/YnmjOnOIVllZl9p+I80ailmSyTO+1J/fJepe kbtBJiivfCk= =7Nyk -----END PGP SIGNATURE----- |