Amanda howto for openhabian and NAS

I read it several times and did my best to understand it.

[18:18:17] backup@openHABianPi:~$ ls -laR /storage/
/storage/:
total 24
drwxr-xr-x  3 root root  4096 Feb 18 10:51 .
drwxr-xr-x 22 root root  4096 Feb 18 10:51 ..
drwxr-xr-x  3 root root 16384 Feb 18 11:32 usbstick-msdos

/storage/usbstick-msdos:
total 36
drwxr-xr-x  3 root root 16384 Feb 18 11:32 .
drwxr-xr-x  3 root root  4096 Feb 18 10:51 ..
drwxr-xr-x 17 root root 16384 Feb 18 11:32 slots

/storage/usbstick-msdos/slots:
total 272
drwxr-xr-x 17 root root 16384 Feb 18 11:32 .
drwxr-xr-x  3 root root 16384 Feb 18 11:32 ..
drwxr-xr-x  2 root root 16384 Feb 18 11:32 slot1
drwxr-xr-x  2 root root 16384 Feb 18 11:32 slot10
drwxr-xr-x  2 root root 16384 Feb 18 11:32 slot11
drwxr-xr-x  2 root root 16384 Feb 18 11:32 slot12
drwxr-xr-x  2 root root 16384 Feb 18 11:32 slot13
drwxr-xr-x  2 root root 16384 Feb 18 11:32 slot14
drwxr-xr-x  2 root root 16384 Feb 18 11:32 slot15
drwxr-xr-x  2 root root 16384 Feb 18 11:32 slot2
drwxr-xr-x  2 root root 16384 Feb 18 11:32 slot3
drwxr-xr-x  2 root root 16384 Feb 18 11:32 slot4
drwxr-xr-x  2 root root 16384 Feb 18 11:32 slot5
drwxr-xr-x  2 root root 16384 Feb 18 11:32 slot6
drwxr-xr-x  2 root root 16384 Feb 18 11:32 slot7
drwxr-xr-x  2 root root 16384 Feb 18 11:32 slot8
drwxr-xr-x  2 root root 16384 Feb 18 11:32 slot9

/storage/usbstick-msdos/slots/slot1:
total 32
drwxr-xr-x  2 root root 16384 Feb 18 11:32 .
drwxr-xr-x 17 root root 16384 Feb 18 11:32 ..

/storage/usbstick-msdos/slots/slot10:
total 32
drwxr-xr-x  2 root root 16384 Feb 18 11:32 .
drwxr-xr-x 17 root root 16384 Feb 18 11:32 ..

/storage/usbstick-msdos/slots/slot11:
total 32
drwxr-xr-x  2 root root 16384 Feb 18 11:32 .
drwxr-xr-x 17 root root 16384 Feb 18 11:32 ..

/storage/usbstick-msdos/slots/slot12:
total 32
drwxr-xr-x  2 root root 16384 Feb 18 11:32 .
drwxr-xr-x 17 root root 16384 Feb 18 11:32 ..

/storage/usbstick-msdos/slots/slot13:
total 32
drwxr-xr-x  2 root root 16384 Feb 18 11:32 .
drwxr-xr-x 17 root root 16384 Feb 18 11:32 ..

/storage/usbstick-msdos/slots/slot14:
total 32
drwxr-xr-x  2 root root 16384 Feb 18 11:32 .
drwxr-xr-x 17 root root 16384 Feb 18 11:32 ..

/storage/usbstick-msdos/slots/slot15:
total 32
drwxr-xr-x  2 root root 16384 Feb 18 11:32 .
drwxr-xr-x 17 root root 16384 Feb 18 11:32 ..

/storage/usbstick-msdos/slots/slot2:
total 32
drwxr-xr-x  2 root root 16384 Feb 18 11:32 .
drwxr-xr-x 17 root root 16384 Feb 18 11:32 ..

/storage/usbstick-msdos/slots/slot3:
total 32
drwxr-xr-x  2 root root 16384 Feb 18 11:32 .
drwxr-xr-x 17 root root 16384 Feb 18 11:32 ..

/storage/usbstick-msdos/slots/slot4:
total 32
drwxr-xr-x  2 root root 16384 Feb 18 11:32 .
drwxr-xr-x 17 root root 16384 Feb 18 11:32 ..

/storage/usbstick-msdos/slots/slot5:
total 32
drwxr-xr-x  2 root root 16384 Feb 18 11:32 .
drwxr-xr-x 17 root root 16384 Feb 18 11:32 ..

/storage/usbstick-msdos/slots/slot6:
total 32
drwxr-xr-x  2 root root 16384 Feb 18 11:32 .
drwxr-xr-x 17 root root 16384 Feb 18 11:32 ..

/storage/usbstick-msdos/slots/slot7:
total 32
drwxr-xr-x  2 root root 16384 Feb 18 11:32 .
drwxr-xr-x 17 root root 16384 Feb 18 11:32 ..

/storage/usbstick-msdos/slots/slot8:
total 32
drwxr-xr-x  2 root root 16384 Feb 18 11:32 .
drwxr-xr-x 17 root root 16384 Feb 18 11:32 ..

/storage/usbstick-msdos/slots/slot9:
total 32
drwxr-xr-x  2 root root 16384 Feb 18 11:32 .
drwxr-xr-x 17 root root 16384 Feb 18 11:32 ..
[18:38:53] backup@openHABianPi:~$

So there are quite some dirs…?!?

yes, there are a lot of “Slots” - representing tapes (the origin of Amanda)
The privileges on the subdirectories are for “root” only, that’s why you get those errors.
and this is, what startles me, because those directories will be generated by the openHABian install-script…

We could now work backwards through all your current installation - but best thing would be, if you have an image of your SD Card before your tries with Amanda? Then you can start over again - I don’t know Amanda yet and just started today and I had no problems (I used the NAS version).

If you can start over, I think the doc misses something which could lead to that mess…? If you have connected the USB stick and are ready to go, did you sudo bash before? I guess you did, because otherwise you wouldn’t have the privilege to echo into/etc/fstab … But it’s worth a shot.
and as we’re at it - you did only the MSDOS (meaning FAT16) version in the stick?

If that’s all set and done - I’m sorry, but then I can’t help you. But I’m sure someone with Amanda and/or knowledge of the openHABian scripts can help surely.

Thomas,
thank you for your approach to help me anyway.

This is also confusing me but thats why I write here.

I have no image of the SD, so far I used the backup method desribed here: https://docs.openhab.org/installation/linux.html#backup-and-restore

But I did some other changes since the last backup which I would like to keep if possible.

Actually I did not manage to do the changes into fstap with echo but have edited the file with vim:

[10:53:43] openhabian@openHABianPi:~$ echo "/dev/sda1     /storage/usbstick-msdos    vfat                                        defaults,noatime  0       1" >> /etc/fstab
-bash: /etc/fstab: Permission denied
[10:54:39] openhabian@openHABianPi:~$ sudo echo "/dev/sda1     /storage/usbstick-msdos    vfa                                   t     defaults,noatime  0       1" >> /etc/fstab
-bash: /etc/fstab: Permission denied

[19:12:19] openhabian@openHABianPi:~$ cat /etc/fstab
proc            /proc           proc    defaults          0       0
PARTUUID=16d75cfa-01  /boot           vfat    defaults          0       2
PARTUUID=16d75cfa-02  /               ext4    defaults,noatime  0       1
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that

/usr/share/openhab2          /srv/openhab2-sys           none bind 0 0
/etc/openhab2                /srv/openhab2-conf          none bind 0 0
/var/lib/openhab2            /srv/openhab2-userdata      none bind 0 0
/var/log/openhab2            /srv/openhab2-logs          none bind 0 0
/usr/share/openhab2/addons   /srv/openhab2-addons        none bind 0 0
/dev/sda1                    /storage/usbstick-msdos    vfat    defaults,noatime 0 1

I only used the FAT part because I did not see the need to have two different partitions.
But I thought it would be FAT32.

Did I get something wrong on that part?

Again thank you for your time!

at first: not really… as it is described in the docs, you only need one of these. FAT16/vfat is readable by MS-DOS and above (vfat is just FAT16 with longer filenames than 8.3). Thing is, not every OS can read ext4. So, if you just want to have a look on the USB-Stick from another OS, you must have an ext4-reader installed under Windows e.g. If you only use the USB stick for your Amanda backup you can also use ext4. If you want to read without additional Software under Windows, stick with FAT16.

[10:54:39] openhabian@openHABianPi:~$ sudo echo "/dev/sda1     /storage/usbstick-msdos    vfa                                   t     defaults,noatime  0       1" >> /etc/fstab
-bash: /etc/fstab: Permission denied

this one explains it I guess… you didn’t sudo bash before everything else! sudo echo ... alone won’t let you write fstab, you need full root here. I don’t know how the openHABian script reacts, but please try again:

  1. Format your USB-stick (you could just as easy assign ext4 this time, if you like)
  2. start over with the whole procedure, but before the fdisk-operation in the doc, do sudo bash, that way you gain full root-privileges and you won’t need sudo
  3. do as the doc says and echo "/dev/sda1 /storage/usbstick-msdos vfat defaults,noatime 0 1" >> /etc/fstab will work now - as the openhabian-config script can access and change the directory privileges then.

This should do it, hopefully…

1 Like

Just guess but the problem might be that the install script does a change ownership to the storage dir and that this does not work for vfat filesystem.
There’s a mount option you can add in the /etc/fstab line to make the whole filesystem be owned by the ‘backup’ user, see here for a description. Edit fstab, remount and reinstall.
But the better idea is to avoid using Windows concepts such as vfat on a UNIX system (I know I shouldn’t have put it into the docs, but you noticed the warning lines on top of and below the code lines, didn’t you ?) . Windows people tend to choose these as they know 'em, but in the end that’s always a bad idea because they need to be compatible with the UNIX software (openHABian and Amanda, these are) and not with the user. Better go with the ext4 version of the stick as shown in the README. Or at least create two partitions, one for backup storage using ext4.

1 Like

Hi Markus,

thank you for creating the readme and your help here.
Got it working now with the additional support and better understanding.

I deleted the previously created dirs and the entry in fstab and formated the usb stick with ext4.
Then went through the steps again and it went all well.

The traps I got in were following, may be others can avoid this:

I thought there is no root usage forseen for openhabian so I tried to do by using sudo and got in some trouble and missunderstandings. Now I found out that root can be used (read here)

The command mkexfatfs seems not to be available in openhabian installation which also confused me a bit.
I have now skipped the FAT part.

Again thank you. Great to be able to benefit from your work!

Now that the installation is done I wonder if there is anything else to be done for scheduling the backups.
I somehow understood Amanda is taking care of it, but how can I see when it is planned or happening?

Glad to hear.

[21:31:49] root@openHABianPi:/# cat /etc/cron.d/amanda
0 1 * * * backup /usr/sbin/amdump openhab-dir &>/dev/null
0 18 * * * backup /usr/sbin/amcheck -m openhab-dir &>/dev/null

Perfekt, danke!

Hi, I have installed and configured Amanda on my system but I am recieving an error and would kindly like to ask community for any hint what could be wrong. Thanks in advance!

My setup:
RPI 3, openhabian installation, running and booting from 16GB micro SD card (shrinked to 10GB to avoid potential issues when reimaging to another 16GB card which is few sectors smaller maybe as well as to decrease the time needed for full backup).

Directly to RPI is attached external 2,5" 60GB HDD, mounted to /mnt/HDD formated to NTFS as I wanted to easily copy backup files also to my WIN PC. Maybe this (NTFS) is the issue, I am not sure, but from what I read, this should work. I have enabled on RPI the higher power for USB and the HDD worked normally until I installed Amanda and run the first backup.

After Amanda installation (the improved readme is now really helpful and I read it about 3 times as well as this discussion before I started the installation so big thanks to @mstormi and others) there were correctly created folders and subfolders on the HDD (I am using only the option with local storage, not the Amazon nor NAS) although, I have inserted as the mount point during the Amanda setup the path in this format: “/mnt/HDD/” including the last slash, which was maybe not correct as Amanda in amreport reffered to “/mnt/HDD//slots/drive…” with double slahes after HDD so the slash was there from my input in the installation as well as Amanda probably added it itself. But as the folder structure on the mounted HDD semeed to be successfully created by amanda, I kept it for the first time as it was (those double slashes). Maybe the installation script could be adjusted to avoid this in the future or the readme could mention that.

Whatever, I have manually run the first backup and after several hours checked with amreport which showed some errors (unfortunately do not have it there was some issue with the raw backup of the card). I couldn’t access the HDD from the RPI (I tried list directories on HDD using ls but didn’t work). However, there WERE created some files on the HDD and I was able to access the HDD after RPI reboot. So I let that be and there was the first overnight backup scheduled by cron.

I had again an error though and the HDD was somehow locked again. So I edited the amanda.conf to correct the double slashes in the path to HDD mount so now is:

tpchanger "chg-disk:/mnt/HDD/slots"    # The tape-changer glue script

and installed the mailing on RPI so amanda could send me reports via email (btw very easy guideline to use gmail account for sending emails from RPI is here, maybe it’s worth add the link to the readme as well). So finally I received the log into my email:

Hostname: openHABianPi
Org     : openHABian openhab-dir
Config  : openhab-dir
Date    : březen 22, 2018

These dumps were to tape openHABian-openhab-dir-002.
Not using all tapes because taper found no tape.
No dumps are left in the holding disk.

The next 10 tapes Amanda expects to use are: 10 new tapes.


FAILURE DUMP SUMMARY:
  openHABianPi /dev/mmcblk0 lev 0  FAILED [data write: Connection reset by peer]
  openHABianPi /dev/mmcblk0 lev 0  partial taper: Error writing device fd 6: Input/output error
  openHABianPi /dev/mmcblk0 lev 0  FAILED [data write: Broken pipe]
  openHABianPi /dev/mmcblk0 lev 0  partial taper: taper found no tape



STATISTICS:
                          Total       Full      Incr.   Level:#
                        --------   --------   --------  --------
Estimate Time (hrs:min)     0:15
Run Time (hrs:min)          0:27
Dump Time (hrs:min)         0:00       0:00       0:00
Output Size (meg)            1.3        0.0        1.3
Original Size (meg)          1.3        0.0        1.3
Avg Compressed Size (%)    100.0        --       100.0
DLEs Dumped                    2          0          2  1:2
Avg Dump Rate (k/s)        538.2        --       538.2

Tape Time (hrs:min)         0:11       0:11       0:00
Tape Size (meg)              1.3        0.0        1.3
Tape Used (%)                0.0        0.0        0.0
DLEs Taped                     4          2          2  1:2
Parts Taped                    4          2          2  1:2
Avg Tp Write Rate (k/s)      2.0        0.0     6700.0

USAGE BY TAPE:
  Label                        Time         Size      %  DLEs Parts
  openHABian-openhab-dir-002   0:11     2380828k   69.8     4     4



FAILED DUMP DETAILS:
  /-- openHABianPi /dev/mmcblk0 lev 0 FAILED [data write: Connection reset by peer]
  sendbackup: info BACKUP=APPLICATION
  sendbackup: info APPLICATION=amraw
  sendbackup: info RECOVER_CMD=/bin/gzip -dc |/usr/lib/amanda/application/amraw restore [./file-to-restore]+
  sendbackup: info COMPRESS_SUFFIX=.gz
  sendbackup: info end
  \--------
  /-- openHABianPi /dev/mmcblk0 lev 0 FAILED [data write: Broken pipe]
  sendbackup: info BACKUP=APPLICATION
  sendbackup: info APPLICATION=amraw
  sendbackup: info RECOVER_CMD=/bin/gzip -dc |/usr/lib/amanda/application/amraw restore [./file-to-restore]+
  sendbackup: info COMPRESS_SUFFIX=.gz
  sendbackup: info end
  \--------



NOTES:
  planner: Adding new disk openHABianPi:/dev/mmcblk0.
  planner: Last full dump of openHABianPi:/etc/openhab2 on tape openHABian-openhab-dir-001 overwritten in 1 run.
  planner: Last full dump of openHABianPi:/var/lib/openhab2 on tape openHABian-openhab-dir-001 overwritten in 1 run.
  planner: WARNING: no history available for openHABianPi:/var/lib/openhab2; guessing that size will be 51730 KB
  planner: WARNING: no history available for openHABianPi:/etc/openhab2; guessing that size will be 1465 KB
  taper: Slot 2 without label can be labeled
  taper: Slot 3 without label can be labeled
  taper: tape openHABian-openhab-dir-002 kb 1340 fm 3 [OK]
  taper: while labeling new volume: Error checking directory /mnt/HDD/slots/drive2/data/: No such file or directory


DUMP SUMMARY:
                                                         DUMPER STATS   TAPER STATS
HOSTNAME     DISK              L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS    KB/s
-------------------------------- ---------------------- -------------- --------------
openHABianPi /dev/mmcblk0      0                     --    PARTIAL      10:58     0.0 PARTIAL
openHABianPi /etc/openhab2     1      20      20     --    0:01   18.3   0:00   200.0
openHABianPi /var/lib/openhab2 1    1320    1320     --    0:01  945.7   0:00 13200.0

(brought to you by Amanda version 3.3.9)

The storagestate file contains:

$STATE = {
           'meta' => undef,
           'drives' => {
                         '/mnt/HDD/slots/drive1' => {},
                         '/mnt/HDD/slots/drive2' => {},
                         '/mnt/HDD//slots/drive1' => {},
                         '/mnt/HDD//slots/drive0' => {
                                                       'pid' => 10185
                                                     }
                       }
         };

Of course I googled the input/output error and most of the links says that the HDD is corrupted. However, this seems strange as after RPI restart it works normally. I am not experienced so can only think of some access rights issues, which is strange if amanda could create folders as well as some files…

Here is the content of my openhab-dir if that helps (bře = March):

openhabian@openHABianPi:/etc/amanda/openhab-dir $ ls -lh
celkem 24K
-rw-r--r-- 1 root   root     13 bře 20 13:11 amanda-client.conf
-rw-r--r-- 1 root   root   2,8K bře 21 22:21 amanda.conf
-rw-r--r-- 1 root   root   2,8K bře 21 21:01 amanda.conf.bkp
-rw-r--r-- 1 root   root    144 bře 20 13:11 disklist
-rw------- 1 backup backup  450 bře 22 10:36 storagestate
-rw------- 1 backup backup  122 bře 22 01:26 tapelist
-rw------- 1 backup backup    0 bře 20 14:01 tapelist.lock

This is the content of the slots folder on HDD (suprisingly I can ls it now without the reboot):

openhabian@openHABianPi:/mnt/HDD/slots $ ls -lh --color=auto
celkem 8,5K
lrwxrwxrwx 1 root root   18 bře 22 10:36 data -> slot3
drwxrwxrwx 1 root root    0 bře 20 13:47 drive0
drwxrwxrwx 1 root root    0 bře 22 01:00 drive1
drwxrwxrwx 1 root root 4,0K bře 20 14:01 slot1
drwxrwxrwx 1 root root    0 bře 20 13:10 slot10
drwxrwxrwx 1 root root    0 bře 20 13:10 slot11
drwxrwxrwx 1 root root    0 bře 20 13:10 slot12
drwxrwxrwx 1 root root    0 bře 20 13:10 slot13
drwxrwxrwx 1 root root    0 bře 20 13:10 slot14
drwxrwxrwx 1 root root    0 bře 20 13:10 slot15
drwxrwxrwx 1 root root 4,0K bře 22 01:15 slot2
drwxrwxrwx 1 root root    0 bře 20 13:10 slot3
drwxrwxrwx 1 root root    0 bře 20 13:10 slot4
drwxrwxrwx 1 root root    0 bře 20 13:10 slot5
drwxrwxrwx 1 root root    0 bře 20 13:10 slot6
drwxrwxrwx 1 root root    0 bře 20 13:10 slot7
drwxrwxrwx 1 root root    0 bře 20 13:10 slot8
drwxrwxrwx 1 root root    0 bře 20 13:10 slot9

and the content of the slot1 folder:

openhabian@openHABianPi:/mnt/HDD/slots/slot1 $ ls -lh --color=auto
celkem 3,0G
-rwxrwxrwx 1 root root  32K bře 20 14:01 00000.openHABian-openhab-dir-001
-rwxrwxrwx 1 root root 102M bře 20 14:01 00001.openHABianPi._var_lib_openhab2.0
-rwxrwxrwx 1 root root 2,9M bře 20 14:01 00002.openHABianPi._etc_op짉nhab2.0
-rwxrwxrwx 1 root root 2,9G bře 20 14:15 00003.openHABianPi._dev_mmcblk0.0

slot2 content (other slots are empty):

openhabian@openHABianPi:/mnt/HDD/slots/slot2 $ ls -lh --color=auto
celkem 2,2G
-rwxrwxrwx 1 root root  32K bře 22 01:15 00000.openHABian-openhab-dir-002
-rwxrwxrwx 1 root root  52K bře 22 01:15 00001.openHABianPi._etc_openhab2.1
-rwxrwxrwx 1 root root 1,4M bře 22 01:15 00002.openHABianPi._var_lib_openhab2.1
-rwxrwxrwx 1 root root 2,2G bře 22 01:25 00003.openHABianPi._dev_mmcblk0.0

So it seems to me that only the first manually run backup worked (with error that I do not have) but not the automated ones. May this really be the ownership issue as the owner of the slot folders seems to be root so user backup can’t write there? If yes, I thought that he amanda installation should take care of that… Is the chown the solution then? It would be strange anyway as the first manual backup I started logged as backup user.

Thanks a lot for any hint!

UPDATE 22.03.2018 14:10
I have created new profile for testing that is backing up only small folder with influxdb data, using same settings for slots and tapes copied from openhab-dir and it works! See the log from email:

Hostname: openHABianPi
Org     : openHABian influx-dir
Config  : influx-dir
Date    : březen 22, 2018

These dumps were to tape openHABian-influx-dir-001.
The next 10 tapes Amanda expects to use are: 10 new tapes.


STATISTICS:
                          Total       Full      Incr.   Level:#
                        --------   --------   --------  --------
Estimate Time (hrs:min)     0:00
Run Time (hrs:min)          0:00
Dump Time (hrs:min)         0:00       0:00       0:00
Output Size (meg)           15.6       15.6        0.0
Original Size (meg)         15.6       15.6        0.0
Avg Compressed Size (%)    100.0      100.0        --
DLEs Dumped                    1          1          0
Avg Dump Rate (k/s)       4536.2     4536.2        --

Tape Time (hrs:min)         0:00       0:00       0:00
Tape Size (meg)             15.6       15.6        0.0
Tape Used (%)                0.5        0.5        0.0
DLEs Taped                     1          1          0
Parts Taped                    1          1          0
Avg Tp Write Rate (k/s)  15990.0    15990.0        --

USAGE BY TAPE:
  Label                       Time         Size      %  DLEs Parts
  openHABian-influx-dir-001   0:00       15990k    0.5     1     1



NOTES:
  planner: Adding new disk openHABianPi:/var/lib/influxdb/data.
  planner: WARNING: no history available for openHABianPi:/var/lib/influxdb/data; guessing that size will be 1000000 KB
  taper: Slot 3 without label can be labeled
  taper: Slot 4 without label can be labeled
  taper: tape openHABian-influx-dir-001 kb 15990 fm 1 [OK]
  big estimate: openHABianPi /var/lib/influxdb/data 0
                  est: 1000032k    out 15990k


DUMP SUMMARY:
                                                              DUMPER STATS   TAPER STATS
HOSTNAME     DISK                   L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS    KB/s
------------------------------------- ---------------------- -------------- --------------
openHABianPi /var/lib/influxdb/data 0   15990   15990     --    0:04 4535.4   0:01 15990.0

(brought to you by Amanda version 3.3.9)

and the slots content now (slot3 used for the influx-dir backup):

[14:12:42] backup@openHABianPi:/mnt/HDD/slots$ ls
celkem 8,5K
lrwxrwxrwx 1 root root   18 bře 22 14:08 data -> slot4
drwxrwxrwx 1 root root    0 bře 20 13:47 drive0
drwxrwxrwx 1 root root    0 bře 22 01:00 drive1
drwxrwxrwx 1 root root 4,0K bře 20 14:01 slot1
drwxrwxrwx 1 root root    0 bře 20 13:10 slot10
drwxrwxrwx 1 root root    0 bře 20 13:10 slot11
drwxrwxrwx 1 root root    0 bře 20 13:10 slot12
drwxrwxrwx 1 root root    0 bře 20 13:10 slot13
drwxrwxrwx 1 root root    0 bře 20 13:10 slot14
drwxrwxrwx 1 root root    0 bře 20 13:10 slot15
drwxrwxrwx 1 root root 4,0K bře 22 01:15 slot2
drwxrwxrwx 1 root root  360 bře 22 14:08 slot3
drwxrwxrwx 1 root root    0 bře 20 13:10 slot4
drwxrwxrwx 1 root root    0 bře 20 13:10 slot5
drwxrwxrwx 1 root root    0 bře 20 13:10 slot6
drwxrwxrwx 1 root root    0 bře 20 13:10 slot7
drwxrwxrwx 1 root root    0 bře 20 13:10 slot8
drwxrwxrwx 1 root root    0 bře 20 13:10 slot9

and the content of the slot3 folder:

[14:14:16] backup@openHABianPi:/mnt/HDD/slots/slot3$ ls
celkem 16M
-rwxrwxrwx 1 root root 32K bře 22 14:08 00000.openHABian-influx-dir-001
-rwxrwxrwx 1 root root 16M bře 22 14:08 00001.openHABianPi._var_lib_influxdb_data.0

Quite likely so. We had a couple of people to CIFS-mount their backup storage from a Windows server who failed, too, because of this. That’s why it is explicitly mentioned in the README as a no-go, see ?
In short, to use Windows tech is a bad idea here. Change this filesystem to ext4 or any other supported. Copying should be done across network.

I see, I read the CIFS issue but as NTFS is supported in raspbian I thought this would be ideal. also strange is that it seems that the backup of influxdb works like a charm…

Anyway, I will try again and use ext4 as you suggested. Thanks for now!

Oh, @mstormi, when I will reformat the HDD, I will have to create the slot directory incl. slot1-slot15 subdirectories there manually right? Anything else to think of? Owner rights should have the backup user?

Thanks!

Manually re-create the dirs just as they are now or re-run Amanda installation from openHABian menu.

OK, formatted the external HDD as ext4, mounted again, created the “slot” folder structure, tested manually with influx-dir backup (worked OK, same as with NTFS). And overnight the scheduled amanda backup (partially?) failed again. The good thing is that the rpi and the HDD didn’t freeze now :smiley:

See amreport and folder’s content:

Hostname: openHABianPi
Org     : openHABian openhab-dir
Config  : openhab-dir
Date    : březen 25, 2018

These dumps were to tape openHABian-openhab-dir-003.
Not using all tapes because taper found no tape.
No dumps are left in the holding disk.

The next 10 tapes Amanda expects to use are: 10 new tapes.


FAILURE DUMP SUMMARY:
  openHABianPi /dev/mmcblk0 lev 0  FAILED [data write: Broken pipe]
  openHABianPi /dev/mmcblk0 lev 0  partial taper: Error writing device fd 6: Read-only file system
  openHABianPi /dev/mmcblk0 lev 0  FAILED [data write: Broken pipe]
  openHABianPi /dev/mmcblk0 lev 0  partial taper: taper found no tape



STATISTICS:
                          Total       Full      Incr.   Level:#
                        --------   --------   --------  --------
Estimate Time (hrs:min)     0:13
Run Time (hrs:min)          0:15
Dump Time (hrs:min)         0:00       0:00       0:00
Output Size (meg)            4.0        0.0        4.0
Original Size (meg)          4.0        0.0        4.0
Avg Compressed Size (%)    100.0        --       100.0
DLEs Dumped                    2          0          2  1:2
Avg Dump Rate (k/s)        991.5        --       991.5

Tape Time (hrs:min)         0:02       0:02       0:00
Tape Size (meg)              4.0        0.0        4.0
Tape Used (%)                0.1        0.0        0.1
DLEs Taped                     4          2          2  1:2
Parts Taped                    4          2          2  1:2
Avg Tp Write Rate (k/s)     39.7        0.0    20300.0

USAGE BY TAPE:
  Label                        Time         Size      %  DLEs Parts
  openHABian-openhab-dir-003   0:02      185628k    5.4     4     4



FAILED DUMP DETAILS:
  /-- openHABianPi /dev/mmcblk0 lev 0 FAILED [data write: Broken pipe]
  sendbackup: info BACKUP=APPLICATION
  sendbackup: info APPLICATION=amraw
  sendbackup: info RECOVER_CMD=/bin/gzip -dc |/usr/lib/amanda/application/amraw restore [./file-to-restore]+
  sendbackup: info COMPRESS_SUFFIX=.gz
  sendbackup: info end
  \--------
  /-- openHABianPi /dev/mmcblk0 lev 0 FAILED [data write: Broken pipe]
  sendbackup: info BACKUP=APPLICATION
  sendbackup: info APPLICATION=amraw
  sendbackup: info RECOVER_CMD=/bin/gzip -dc |/usr/lib/amanda/application/amraw restore [./file-to-restore]+
  sendbackup: info COMPRESS_SUFFIX=.gz
  sendbackup: info end
  \--------



NOTES:
  planner: Last full dump of openHABianPi:/etc/openhab2 on tape openHABian-openhab-dir-001 overwritten in 1 run.
  planner: Last full dump of openHABianPi:/var/lib/openhab2 on tape openHABian-openhab-dir-001 overwritten in 1 run.
  planner: WARNING: no history available for openHABianPi:/etc/openhab2; guessing that size will be 1465 KB
  taper: Slot 3 without label can be labeled
  taper: Slot 4 without label can be labeled
  taper: tape openHABian-openhab-dir-003 kb 4060 fm 3 [OK]
  taper: while labeling new volume: Error checking directory /mnt/HDD/slots/drive3/data/: No such file or directory


DUMP SUMMARY:
                                                         DUMPER STATS   TAPER STATS
HOSTNAME     DISK              L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS    KB/s
-------------------------------- ---------------------- -------------- --------------
openHABianPi /dev/mmcblk0      0                     --    PARTIAL       1:41     0.0 PARTIAL
openHABianPi /etc/openhab2     1    2690    2690     --    0:03  976.4   0:00 26900.0
openHABianPi /var/lib/openhab2 1    1370    1370     --    0:01 1021.3   0:00 13700.0

(brought to you by Amanda version 3.3.9)

openhabian@openHABianPi:/mnt/HDD/slots $ ls
celkem 76K
lrwxrwxrwx 1 backup     backup        5 bře 25 01:13 data -> slot4
drwxrwxrwx 3 openhabian openhabian 4,0K bře 22 21:39 drive0
drwxrwxrwx 3 openhabian openhabian 4,0K bře 22 21:39 drive1
drwx------ 2 backup     backup     4,0K bře 25 01:00 drive2
drwx------ 2 backup     backup     4,0K bře 25 01:13 drive3
drwxrwxrwx 2 openhabian openhabian 4,0K bře 22 21:44 slot1
drwxrwxrwx 2 openhabian openhabian 4,0K bře 22 21:33 slot10
drwxrwxrwx 2 openhabian openhabian 4,0K bře 22 21:33 slot11
drwxrwxrwx 2 openhabian openhabian 4,0K bře 22 21:33 slot12
drwxrwxrwx 2 openhabian openhabian 4,0K bře 22 21:33 slot13
drwxrwxrwx 2 openhabian openhabian 4,0K bře 22 21:33 slot14
drwxrwxrwx 2 openhabian openhabian 4,0K bře 22 21:33 slot15
drwxrwxrwx 2 openhabian openhabian 4,0K bře 24 18:03 slot2
drwxrwxrwx 2 openhabian openhabian 4,0K bře 25 01:13 slot3
drwxrwxrwx 2 openhabian openhabian 4,0K bře 22 21:33 slot4
drwxrwxrwx 2 openhabian openhabian 4,0K bře 22 21:33 slot5
drwxrwxrwx 2 openhabian openhabian 4,0K bře 22 21:33 slot6
drwxrwxrwx 2 openhabian openhabian 4,0K bře 22 21:33 slot7
drwxrwxrwx 2 openhabian openhabian 4,0K bře 22 21:33 slot8
drwxrwxrwx 2 openhabian openhabian 4,0K bře 22 21:33 slot9

openhabian@openHABianPi:/mnt/HDD/slots/slot3 $ ls
celkem 114M
-rw------- 1 backup backup  32K bře 25 01:13 00000.openHABian-openhab-dir-003
-rw------- 1 backup backup 1,4M bře 25 01:13 00001.openHABianPi._var_lib_openhab2.1
-rw------- 1 backup backup 2,7M bře 25 01:13 00002.openHABianPi._etc_openhab2.1
-rw------- 1 backup backup 110M bře 25 01:14 00003.openHABianPi._dev_mmcblk0.0

@mstormi Do you have any idea what’s wrong here? Thanks!

The directory you specified to backup to does not exist or is not writable, somewhere at the beginning it’s saying it’s a readonly filesystem.
You should also check the various logs in /var/log/amanda/*.
You can run amcheck to check without starting a real dump.
Please don’t expect me to debug your (nonstandard) system.

Well @mstormi I do not know what is a standard system acc. to you… I simply used amanda exactly as recommended (rpi, openhabian, amanda standard installation from openhabian-config, local storage ext4 mounted…).

Of course I could read that amanda has write issues and to avoid this I created the folders with 777 rights (as you could see from the ls command above anyway), however, WHY could then create the backup files?

openhabian@openHABianPi:/mnt/HDD/slots/slot3 $ ls
celkem 114M
-rw------- 1 backup backup  32K bře 25 01:13 00000.openHABian-openhab-dir-003
-rw------- 1 backup backup 1,4M bře 25 01:13 00001.openHABianPi._var_lib_openhab2.1
-rw------- 1 backup backup 2,7M bře 25 01:13 00002.openHABianPi._etc_openhab2.1
-rw------- 1 backup backup 110M bře 25 01:14 00003.openHABianPi._dev_mmcblk0.0

I do not expect you to do my work instead of me, I just thought that maybe the amanda standard setup in openhabian may be wrong… of course there may be some error on my side but truly, do not see it.

Thanks for what you did so far, and please leave my (if any) other posts re amanda unanswered as I could clearly understand your message.

A system that was not modified in any aspect that could affect the software’s operation.
One obviously cannot create a comprehensive list of all of these aspects, but your usage of NTFS was an example, and the message below wouldn’t appear on a standard system either, so something else is modified on your system, access rights to the raw device, ACL or you write-protected your SD card or whatever, I cannot know.

This usually indicates that the target is unwritable, but it can also happen if the source is. Most UNIX tools to dump raw devices will leave a marker on the device when they tried last to allow for ‘diff’ computation for level 0/1/… dumps.
If the user the Amanda process (here: amraw or taper) runs as does not have WRITE access rights to the raw device to dump (here: /dev/mmcblk0), it’ll fail (or at least produce a warning which Amanda might interpret as a FAIL).
On a standard system (unmodified openHABian), Amanda/amraw CAN write there, so while I don’t know why it cannot write on your system, I do know that your system is nonstandard.

Well, thanks Markus. The very strange thing is that the last night (and I didn’t change anything) the full raw backup was successful.

Hostname: openHABianPi
Org     : openHABian openhab-dir
Config  : openhab-dir
Date    : březen 26, 2018

These dumps were to tapes openHABian-openhab-dir-004, openHABian-openhab-dir-005, openHABian-openhab-dir-006, openHABian-openhab-dir-007.
The next 10 tapes Amanda expects to use are: 8 new tapes, openHABian-openhab-dir-001, openHABian-openhab-dir-002.


STATISTICS:
                          Total       Full      Incr.   Level:#
                        --------   --------   --------  --------
Estimate Time (hrs:min)     0:14
Run Time (hrs:min)          1:19
Dump Time (hrs:min)         1:05       1:05       0:00
Output Size (meg)        10465.3    10461.3        4.0
Original Size (meg)      14808.0    14804.0        4.0
Avg Compressed Size (%)     70.7       70.7      100.0
DLEs Dumped                    3          1          2  1:2
Avg Dump Rate (k/s)       2730.9     2732.9      924.2

Tape Time (hrs:min)         1:05       1:05       0:00
Tape Size (meg)          10465.3    10461.3        4.0
Tape Used (%)              314.0      313.9        0.1
DLEs Taped                     3          1          2  1:2
Parts Taped                    6          4          2  1:2
Avg Tp Write Rate (k/s)   2732.4     2733.5     1353.3

USAGE BY TAPE:
  Label                        Time         Size      %  DLEs Parts
  openHABian-openhab-dir-004   0:25     3412764k  100.0     3     3
  openHABian-openhab-dir-005   0:19     3412832k  100.0     0     1
  openHABian-openhab-dir-006   0:18     3412832k  100.0     0     1
  openHABian-openhab-dir-007   0:03      478040k   14.0     0     1



NOTES:
  planner: Last full dump of openHABianPi:/etc/openhab2 on tape openHABian-openhab-dir-001 overwritten in 1 run.
  planner: Last full dump of openHABianPi:/var/lib/openhab2 on tape openHABian-openhab-dir-001 overwritten in 1 run.
  taper: Slot 4 without label can be labeled
  taper: Slot 5 without label can be labeled
  taper: tape openHABian-openhab-dir-004 kb 3412764 fm 3 [OK]
  taper: Slot 6 without label can be labeled
  taper: tape openHABian-openhab-dir-005 kb 3412832 fm 1 [OK]
  taper: Slot 7 without label can be labeled
  taper: tape openHABian-openhab-dir-006 kb 3412832 fm 1 [OK]
  taper: Slot 8 without label can be labeled
  taper: tape openHABian-openhab-dir-007 kb 478040 fm 1 [OK]


DUMP SUMMARY:
                                                           DUMPER STATS   TAPER STATS
HOSTNAME     DISK              L  ORIG-kB   OUT-kB  COMP%  MMM:SS   KB/s MMM:SS   KB/s
-------------------------------- ------------------------ -------------- -------------
openHABianPi /dev/mmcblk0      0 15159296 10712408   70.7   65:20 2732.9  65:19 2733.5
openHABianPi /etc/openhab2     1     2690     2690     --    0:01 2116.3   0:01 2690.0
openHABianPi /var/lib/openhab2 1     1370     1370     --    0:03  438.7   0:02  685.0

(brought to you by Amanda version 3.3.9)

I myself would need to dig the Amanda docs and try it for myself in order to be able to reliably answer your question, but yes, to save /var/lib/amanda/* and /etc/amanda/* using cp or tar to some off-openhabian location is probably a good idea so you can restore your backup index (without using Amanda) if in need after a crash/reinstall.

When I taked amanda backups in use first time I also tested amrecovery like also explained in the openhabian-amanda.md. As recovery worked fine, I belived to be safe. Just learned that recovery can’t be done without index files, which is situation after full crash. This can be surprise for most of the users and cause cold sweat after full crash. Luckily I just tried to ”recover” my openHAB configs to another VM.

So what is the reason why e.g. index files are not saved by default to backup storage (where slots are) rather than /var/lib?

Historically, backup storage is on tape, and you certainly don’t want to waste time searching your whole tape (sequential access only !) when your system is down.
Also, speaking from a generic point of view, backup storage is not necessarily any ‘safer’ (i.e. less likely to loose it) than is /var/lib.
If you happen to know it is in your specific case (e.g. because you use a SD card for Amanda indices and a NAS dir as the backup destination), you are free to change index location, but it certainly does not apply to everyone or even just a majority.
To take copies is a better strategy, and if you do anyway, it doesn’t really matter that much which medium your index is on.
Btw, you do can restore without index files, too, but granted you need to know how this works (ask G**gle), and it can be a hassle to find the right file if you don’t have indices.