Emergency restore: Don't fail on large VMs

VMs whose backup size exceeds 100 GiB have more than a thousand chunks,
i.e. private.img.999 is succeeded by private.img.1000 and so on. Ensure
that these are all processed, and in the right numerical order.

Fixes QubesOS/qubes-issues#6113
This commit is contained in:
Rusty Bird 2020-10-08 15:22:54 +00:00
parent 575c8234c3
commit 2de76f9553
No known key found for this signature in database
GPG Key ID: 469D78F47AAF2ADF
3 changed files with 4 additions and 4 deletions

View File

@ -68,7 +68,7 @@ encrypted and compressed.
**Note:** For multi-part files, a loop can be used:
~~~
for f in private.img.*; do
find -name 'private.img.*' | sort -V | while read f; do
openssl enc -d -pass pass:your_passphrase -aes-256-cbc -in $f -out
${f/.img/.img.dec}
done

View File

@ -93,7 +93,7 @@ any GNU/Linux system with the following procedure.
5. Decrypt the `private.img` file.
[user@restore vm1]$ cat private.img.??? | openssl enc -d -pass pass:your_passphrase -aes-256-cbc -out private.img.dec
[user@restore vm1]$ find -name 'private.img.*[0-9]' | sort -V | xargs cat | openssl enc -d -pass pass:your_passphrase -aes-256-cbc -out private.img.dec
**Note:** If your backup was encrypted with a cipher algorithm other than
`aes-256-cbc`, you must substitute the correct cipher command. This

View File

@ -148,7 +148,7 @@ Emergency Recovery Instructions
6. Verify the integrity of and decrypt the `private.img` file that houses your
data.
[user@restore ~]$ for f_enc in vm1/private.img.???.enc; do \
[user@restore ~]$ find vm1 -name 'private.img.*.enc' | sort -V | while read f_enc; do \
f_dec=${f_enc%.enc}; \
echo "$backup_id!$f_dec!$backup_pass" | scrypt dec -P $f_enc $f_dec || break; \
done
@ -158,7 +158,7 @@ Emergency Recovery Instructions
7. Decompress and untar the decrypted `private.img` file.
[user@restore ~]$ cat vm1/private.img.??? | gzip -d | tar -xv
[user@restore ~]$ find vm1 -name 'private.img.*[0-9]' | sort -V | xargs cat | gzip -d | tar -xv
vm1/private.img
**Note:** If your backup was compressed with a program other than `gzip`,