What to do if OS SD card fails and using Amanda backups (RPi4)

    • Platform information:

    • Hardware: RPi4 8GB ram

      • OS: Rpi OS

      • openHAB version: 4.3.2

    • Issue of the topic:

Probably a noob question but I am running openHAB and the OS on one SD card and the Amanda backup on a separate SD Card as recommended.

I know these SD cards don’t last forever and I’m not sure what to do in case of a failure.

If the SD card holding the OS and openHAB completely fails, does the backup SD card (that Amanda writes to) contain a mirror of the OS SD card where I could just swap them out and replace the backup card?

I am including a daily backup email below for more info.

Your advice is appreciated!

Hostname: openhabian
Org     : openHABian openhab-dir
Config  : openhab-dir
Date    : March 25, 2026

These dumps were to tape openhab-dir-14.
The next 10 tapes Amanda expects to use are: openhab-dir-15, openhab-dir-01, openhab-dir-02, openhab-dir-03, openhab-dir-04, openhab-dir-05, openhab-dir-06, openhab-dir-07, openhab-dir-08, openhab-dir-09.


STATISTICS:
                         Total       Full      Incr.   Level:#
                       --------   --------   --------  --------
Estimate Time (hrs:min)     0:00
Run Time (hrs:min)          0:01
Dump Time (hrs:min)         0:01       0:00       0:00
Output Size (meg)          312.7      312.6        0.0
Original Size (meg)        342.2      341.9        0.3
Avg Compressed Size (%)     91.4       91.5        7.4
DLEs Dumped                    3          1          2  1:2
Avg Dump Rate (k/s)      10060.8    10838.2       11.4

Tape Time (hrs:min)         0:00       0:00       0:00
Tape Size (meg)            312.7      312.6        0.0
Tape Used (%)               15.6       15.6        0.0
DLEs Taped                     3          1          2  1:2
Parts Taped                    3          1          2  1:2
Avg Tp Write Rate (k/s)  10964.9    11039.6      130.0


USAGE BY TAPE:
 Label                 Time         Size      %  DLEs Parts
 openhab-dir-14        0:00      320175K   15.6     3     3


NOTES:
 planner: Last full dump of openhabian:/boot on tape openhab-dir-08 overwritten on this run.
 planner: Last full dump of openhabian:/etc on tape openhab-dir-13 overwritten in 1 run.
 planner: Last full dump of openhabian:/var/lib/openhab on tape openhab-dir-07 overwritten on this run.
 taper: tape openhab-dir-14 kb 320176 fm 3 [OK]


DUMP SUMMARY:
                                                       DUMPER STATS    TAPER STATS
HOSTNAME     DISK             L ORIG-KB  OUT-KB  COMP%  MMM:SS    KB/s MMM:SS    KB/s
------------------------------- ---------------------- --------------- --------------
openhabian   /boot            1      40       3    7.5    0:01     2.7   0:00    30.0
openhabian   /etc             1     310      23    7.4    0:01    19.6   0:00   230.0
openhabian   /var/lib/openhab 0  350060  320149   91.5    0:30 10838.0   0:29 11039.6

(brought to you by Amanda version 3.5.1)

It depends on how you have set things up.
There’s SD mirroring which is what you need for the secondary card to become the backup for a failing primary SD.

The standard recommendation is to get larger 2ndary SD card, to setup SD mirroring, and then to create a separate partition with the remaining space and setup Amanda to store its stuff there.

If you exclusively have Amanda on the 2nd card you should be getting a new, bigger card and re-setup to have both.
Else should your primary card fail you cannot restore as you need to have a working system with Amanda and its backup database history installed.

Ahh got it. it’s all coming back to me now. I think I am using both mirroring and Amanda but want to verify that the mirroring is working.

Here is my lsblk. you can see that I used an SD card thats twice the size as the boot card and it does have 2 partitions. Is there a way to do this?

openhabian@openhabian:~ $ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda           8:0    1 119.1G  0 disk 
├─sda1        8:1    1   512M  0 part 
├─sda2        8:2    1    59G  0 part 
└─sda3        8:3    1  59.6G  0 part /storage
mmcblk0     179:0    0  59.5G  0 disk 
├─mmcblk0p1 179:1    0   512M  0 part /boot/firmware
└─mmcblk0p2 179:2    0    59G  0 part /opt/zram/log.bind
                                      /opt/zram/influxdb.bind
                                      /srv/openhab-userdata
                                      /srv/openhab-sys
                                      /srv/openhab-conf
                                      /srv/openhab-addons
                                      /opt/zram/persistence.bind
                                      /
zram0       253:0    0     1G  0 disk [SWAP]
zram1       253:1    0   750M  0 disk /opt/zram/zram1
zram2       253:2    0   350M  0 disk /opt/zram/zram2
zram3       253:3    0     1G  0 disk /opt/zram/zram3

Okay so I just mounted the supposed mirror partition and found it to be an exact copy of the main boot partition so we are good! thanks for jogging my memory!

You should attempt to boot from that SD, just to be on the safe side.

I will do that. will booting from it ‘unsync’ it from the main SD or will any changes all be corrected the next time it goes to copy the mirror?

I think the latter but to be honest, I don’t know for sure. Find out and tell us.

I will do it this weekend and report back!

Thank you again for your assistance! this community is awesome!

1 Like

Okay so I tested it this weekend and had to make a couple changes in order for it to boot successfully from the backup SD Card.

The backup card has 3 partitions on it: tiny boot partition, mirror partition, and Amanda partition.

  1. I had to update the PARTUUID in the cmdline.txt file to match that of the mirror partition.
  2. I had to update /etc/fstab with the same UUID.

after that, I was able to boot from the mirror partition of the backup SD without issue!

did you put the backup card into the primary slot? If yes, tried to boot from USB?

Yes. I removed the primary SD card from the primary slot and put the secondary SD card into the primary slot.