Amanda Backup: Restoring files

I’ve been reading the various posts on Amanda backup and I have set up a backup using the instructions:here

However when it comes to testing the restore, I don’t understand this sentence:
" You have to find the slot yourself by checking their content. Once you find out the requested file (probably starting with 00000. ), you redirect amanda to use the slot which contains the file (e.g. slot 1) using this…"

What command should I use to find the slot?

Thank you

Ian

1 Like

Neither do I now that I reread it :blush:
I’m not sure anymore when there was a need to tell Amanda. It usually finds out on it’s own.
I think it was only when you have dumps that are so large that they span multiple (v)tapes, plus some more conditions I’m unaware of now.

Please read the updated README here.

Try this:

[13:59:15] backup@openhabianpi:~$ amtape openhab-dir show
scanning all 15 slots in changer:
slot   1: date 20191215010006 label openhab-dir-016
slot   2: date 20191216010003 label openhab-dir-017
slot   3: date 20191217010003 label openhab-dir-018
slot   4: date 20191218010002 label openhab-dir-019
slot   5: in use
slot   6: date 20191219010002 label openhab-dir-006
slot   7: date 20191230010003 label openhab-dir-007
slot   8: date 20191207010002 label openhab-dir-008
slot   9: date 20191208010002 label openhab-dir-009
slot  10: date 20191209010003 label openhab-dir-010
slot  11: date 20191210010006 label openhab-dir-011
slot  12: date 20191211010003 label openhab-dir-012
slot  13: date 20191212010004 label openhab-dir-013
slot  14: date 20191213010004 label openhab-dir-014
slot  15: date 20191214010003 label openhab-dir-015

So if the amfetchdump command asked you to insert say volume openhab-dir-012, run amtape openhab-dir slot 12 in that other shell window.
You can also use amadmin to find which tape a specific file or partition is stored on:

[14:11:55] backup@openhabianpi:~$ amadmin openhab-dir find
date                host         disk              lv storage     pool        tape or file    file part  status
2019-12-06 01:00:02 openhabianpi /boot              0 openhab-dir openhab-dir openhab-dir-005    2   1/1 OK
2019-12-07 01:00:02 openhabianpi /boot              0 openhab-dir openhab-dir openhab-dir-008    2   1/1 OK
2019-12-08 01:00:02 openhabianpi /boot              0 openhab-dir openhab-dir openhab-dir-009    2   1/1 OK
2019-12-09 01:00:03 openhabianpi /boot              0 openhab-dir openhab-dir openhab-dir-010    2   1/1 OK
2019-12-10 01:00:06 openhabianpi /boot              0 openhab-dir openhab-dir openhab-dir-011    2   1/1 OK
2019-12-11 01:00:03 openhabianpi /boot              0 openhab-dir openhab-dir openhab-dir-012    2   1/1 OK
2019-12-12 01:00:04 openhabianpi /boot              1 openhab-dir openhab-dir openhab-dir-013    1   1/1 OK
2019-12-13 01:00:04 openhabianpi /boot              0 openhab-dir openhab-dir openhab-dir-014    2   1/1 OK
2019-12-14 01:00:03 openhabianpi /boot              1 openhab-dir openhab-dir openhab-dir-015    1   1/1 OK
2019-12-15 01:00:06 openhabianpi /boot              0 openhab-dir openhab-dir openhab-dir-016    1   1/1 OK
2019-12-17 01:00:03 openhabianpi /boot              1 openhab-dir openhab-dir openhab-dir-018    2   1/1 OK
2019-12-18 01:00:02 openhabianpi /boot              0 openhab-dir openhab-dir openhab-dir-019    2   1/1 OK
2019-12-19 01:00:02 openhabianpi /boot              0 openhab-dir openhab-dir openhab-dir-006    2   1/1 OK
2019-12-30 01:00:03 openhabianpi /boot              0 openhab-dir openhab-dir openhab-dir-007    2   1/1 OK
2019-12-06 01:00:02 openhabianpi /dev/mmcblk0       0 openhab-dir openhab-dir openhab-dir-005    5   1/1 OK
2019-12-07 01:00:02 openhabianpi /dev/mmcblk0       0 openhab-dir openhab-dir openhab-dir-008    5   1/1 OK
2019-12-08 01:00:02 openhabianpi /dev/mmcblk0       0 openhab-dir openhab-dir openhab-dir-009    5   1/1 OK
2019-12-09 01:00:03 openhabianpi /dev/mmcblk0       0 openhab-dir openhab-dir openhab-dir-010    5   1/1 OK
2019-12-10 01:00:06 openhabianpi /dev/mmcblk0       0 openhab-dir openhab-dir openhab-dir-011    5   1/1 OK
2019-12-11 01:00:03 openhabianpi /dev/mmcblk0       0 openhab-dir openhab-dir openhab-dir-012    5   1/1 OK
2019-12-12 01:00:04 openhabianpi /dev/mmcblk0       0 openhab-dir openhab-dir openhab-dir-013    5   1/1 OK
2019-12-13 01:00:04 openhabianpi /dev/mmcblk0       0 openhab-dir openhab-dir openhab-dir-014    5   1/1 OK
2019-12-14 01:00:03 openhabianpi /dev/mmcblk0       0 openhab-dir openhab-dir openhab-dir-015    5   1/1 OK
2019-12-15 01:00:06 openhabianpi /dev/mmcblk0       0                                            0 -1/-1 FAILED (planner) "[/usr/lib/amanda/application/amraw terminated with signal 15: see /var/log/amanda/client/openhab-dir/sendsize.20191215010011.debug]"
2019-12-16 01:00:03 openhabianpi /dev/mmcblk0       0                                            0 -1/-1 FAILED (planner) "[missing result for /dev/mmcblk0 in openhabianpi response]"
2019-12-17 01:00:03 openhabianpi /dev/mmcblk0       0 openhab-dir openhab-dir openhab-dir-018    5   1/1 OK
2019-12-18 01:00:02 openhabianpi /dev/mmcblk0       0 openhab-dir openhab-dir openhab-dir-019    5   1/1 OK
2019-12-19 01:00:02 openhabianpi /dev/mmcblk0       0 openhab-dir openhab-dir openhab-dir-006    5   1/1 OK
2019-12-30 01:00:03 openhabianpi /dev/mmcblk0       0 openhab-dir openhab-dir openhab-dir-007    5   1/1 OK
2019-12-06 01:00:02 openhabianpi /etc               0 openhab-dir openhab-dir openhab-dir-005    3   1/1 OK
2019-12-07 01:00:02 openhabianpi /etc               0 openhab-dir openhab-dir openhab-dir-008    3   1/1 OK
2019-12-08 01:00:02 openhabianpi /etc               0 openhab-dir openhab-dir openhab-dir-009    3   1/1 OK
2019-12-09 01:00:03 openhabianpi /etc               0 openhab-dir openhab-dir openhab-dir-010    3   1/1 OK
2019-12-10 01:00:06 openhabianpi /etc               0 openhab-dir openhab-dir openhab-dir-011    3   1/1 OK
2019-12-11 01:00:03 openhabianpi /etc               0 openhab-dir openhab-dir openhab-dir-012    3   1/1 OK
2019-12-12 01:00:04 openhabianpi /etc               0 openhab-dir openhab-dir openhab-dir-013    3   1/1 OK
2019-12-13 01:00:04 openhabianpi /etc               0 openhab-dir openhab-dir openhab-dir-014    3   1/1 OK
2019-12-14 01:00:03 openhabianpi /etc               0 openhab-dir openhab-dir openhab-dir-015    3   1/1 OK
2019-12-15 01:00:06 openhabianpi /etc               0 openhab-dir openhab-dir openhab-dir-016    3   1/1 OK
2019-12-17 01:00:03 openhabianpi /etc               0 openhab-dir openhab-dir openhab-dir-018    3   1/1 OK
2019-12-18 01:00:02 openhabianpi /etc               0 openhab-dir openhab-dir openhab-dir-019    3   1/1 OK
2019-12-19 01:00:02 openhabianpi /etc               0 openhab-dir openhab-dir openhab-dir-006    3   1/1 OK
2019-12-30 01:00:03 openhabianpi /etc               0 openhab-dir openhab-dir openhab-dir-007    3   1/1 OK
2019-12-06 01:00:02 openhabianpi /home/openhabian   0 openhab-dir openhab-dir openhab-dir-005    4   1/1 OK
2019-12-07 01:00:02 openhabianpi /home/openhabian   0 openhab-dir openhab-dir openhab-dir-008    4   1/1 OK
2019-12-08 01:00:02 openhabianpi /home/openhabian   0 openhab-dir openhab-dir openhab-dir-009    4   1/1 OK
2019-12-09 01:00:03 openhabianpi /home/openhabian   0 openhab-dir openhab-dir openhab-dir-010    4   1/1 OK
2019-12-10 01:00:06 openhabianpi /home/openhabian   0 openhab-dir openhab-dir openhab-dir-011    4   1/1 OK
2019-12-11 01:00:03 openhabianpi /home/openhabian   0 openhab-dir openhab-dir openhab-dir-012    4   1/1 OK
2019-12-12 01:00:04 openhabianpi /home/openhabian   0 openhab-dir openhab-dir openhab-dir-013    4   1/1 OK
2019-12-13 01:00:04 openhabianpi /home/openhabian   0 openhab-dir openhab-dir openhab-dir-014    4   1/1 OK
2019-12-14 01:00:03 openhabianpi /home/openhabian   0 openhab-dir openhab-dir openhab-dir-015    4   1/1 OK
2019-12-15 01:00:06 openhabianpi /home/openhabian   1 openhab-dir openhab-dir openhab-dir-016    4   1/1 OK
2019-12-17 01:00:03 openhabianpi /home/openhabian   0 openhab-dir openhab-dir openhab-dir-018    4   1/1 OK
2019-12-18 01:00:02 openhabianpi /home/openhabian   0 openhab-dir openhab-dir openhab-dir-019    4   1/1 OK
2019-12-19 01:00:02 openhabianpi /home/openhabian   0 openhab-dir openhab-dir openhab-dir-006    4   1/1 OK
2019-12-30 01:00:03 openhabianpi /home/openhabian   0 openhab-dir openhab-dir openhab-dir-007    4   1/1 OK
2019-12-06 01:00:02 openhabianpi /var/lib/openhab2  0 openhab-dir openhab-dir openhab-dir-005    1   1/1 OK
2019-12-07 01:00:02 openhabianpi /var/lib/openhab2  0 openhab-dir openhab-dir openhab-dir-008    1   1/1 OK
2019-12-08 01:00:02 openhabianpi /var/lib/openhab2  0 openhab-dir openhab-dir openhab-dir-009    1   1/1 OK
2019-12-09 01:00:03 openhabianpi /var/lib/openhab2  0 openhab-dir openhab-dir openhab-dir-010    1   1/1 OK
2019-12-10 01:00:06 openhabianpi /var/lib/openhab2  0 openhab-dir openhab-dir openhab-dir-011    1   1/1 OK
2019-12-11 01:00:03 openhabianpi /var/lib/openhab2  0 openhab-dir openhab-dir openhab-dir-012    1   1/1 OK
2019-12-12 01:00:04 openhabianpi /var/lib/openhab2  1 openhab-dir openhab-dir openhab-dir-013    2   1/1 OK
2019-12-13 01:00:04 openhabianpi /var/lib/openhab2  0 openhab-dir openhab-dir openhab-dir-014    1   1/1 OK
2019-12-14 01:00:03 openhabianpi /var/lib/openhab2  1 openhab-dir openhab-dir openhab-dir-015    2   1/1 OK
2019-12-15 01:00:06 openhabianpi /var/lib/openhab2  1 openhab-dir openhab-dir openhab-dir-016    2   1/1 OK
2019-12-17 01:00:03 openhabianpi /var/lib/openhab2  0 openhab-dir openhab-dir openhab-dir-018    1   1/1 OK

Thanks for that, that makes more sense :slight_smile:
Presumably once I have restored the file, I then use the Openhab restore CLI command to actually restore the files?

Ian

Did you read the updated README ? (link has not been clicked that’s why I ask, let me know if it can remain like that)

Assuming by “the” file you refer to a backup tarball taken by openhab-cli backup then yes use openhab-cli restore <file> to restore.

1 Like

Thank you, the paragraph makes more sense now :slight_smile:

No, I was referring tot he Amanda image file, however since posting I have been reading the amanda docs and need to expand that file as per the instructions.

It’s either a tar file (where you chose to backup a directory) or a partition dump. That latter you cannot expand. Well you can restore it and mount the partition(s), then copy off what you’re looking for.