SD Card corrupted - How can I backup the

Hello,

I've a problem with my pihole, the web interface is not available anymore.
I've tried to debug without succes and after some test I think my sd card is corrupted and I will need to reinstall from scratch.

Is someone can confirme the diagnosis ?
Is there are something that I can backup (/etc/pihole is already backup) ?

Debug Token:

I can not create a token, I've the error

[✓] ** FINISHED DEBUGGING! **

   * The debug log can be uploaded to tricorder.pi-hole.net for sharing with developers only.

[?] Would you like to upload the log? [y/N] y
    * Using curl for transmission.
    * curl failed, contact Pi-hole support for assistance.
    * Error message: curl: (6) Could not resolve host: tricorder.pi-hole.net

[✗] There was an error uploading your debug log.
   * Please try again or contact the Pi-hole team for assistance.
   * A local copy of the debug log can be found at: /var/log/pihole/pihole_debug.log

See the full debug on this file, I've removed the DHCP informations.
pihole terminal output.txt (43.4 KB)

Here is more logs about error that I've encounter.

pi@raspberrypi:~ $ pihole -a -t
PHP Warning:  SQLite3Result::fetchArray(): Unable to execute statement: database disk image is malformed in /var/www/html/admin/scripts/pi-hole/php/teleporter.php on line 59
PHP Warning:  SQLite3::query(): Unable to execute statement: database disk image is malformed in /var/www/html/admin/scripts/pi-hole/php/teleporter.php on line 50
PHP Fatal error:  Uncaught Error: Call to a member function fetchArray() on bool in /var/www/html/admin/scripts/pi-hole/php/teleporter.php:59
Stack trace:
#0 /var/www/html/admin/scripts/pi-hole/php/teleporter.php(585): archive_add_table()
#1 {main}
  thrown in /var/www/html/admin/scripts/pi-hole/php/teleporter.php on line 59
pi@raspberrypi:~ $ ^C
pi@raspberrypi:~ $ cat  /etc/dnsmasq.d/02-pihole-dhcp.conf
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒pi@raspberrypi:~ $
pi@raspberrypi:~ $
pi@raspberrypi:~ $

pi@raspberrypi:~ $ pihole -r

  [✓] Root user check

        .;;,.
        .ccccc:,.
         :cccclll:.      ..,,
          :ccccclll.   ;ooodc
           'ccll:;ll .oooodc
             .;cll.;;looo:.
                 .. ','.
                .',,,,,,'.
              .',,,,,,,,,,.
            .',,,,,,,,,,,,....
          ....''',,,,,,,'.......
        .........  ....  .........
        ..........      ..........
        ..........      ..........
        .........  ....  .........
          ........,,,,,,,'......
            ....',,,,,,,,,,,,.
               .',,,,,,,,,'.
                .',,,,,,'.
                  ..'''.

  [i] SELinux not detected
  [✗] Update local cache of available packages
   Error: Unable to update package cache. Please try "sudo apt update"
pi@raspberrypi:~ $ sudo apt update
Err :1 http://raspbian.raspberrypi.org/raspbian bullseye InRelease
  Erreur temporaire de résolution de « raspbian.raspberrypi.org »
Err :2 http://archive.raspberrypi.org/debian bullseye InRelease
  Erreur temporaire de résolution de « archive.raspberrypi.org »
Lecture des listes de paquets... Erreur !
W: Impossible de récupérer http://raspbian.raspberrypi.org/raspbian/dists/bullseye/InRelease  Erreur temporaire de résolution de « raspbian.raspberrypi.org »
W: Impossible de récupérer http://archive.raspberrypi.org/debian/dists/bullseye/InRelease  Erreur temporaire de résolution de « archive.raspberrypi.org »
W: Le téléchargement de quelques fichiers d'index a échoué, ils ont été ignorés, ou les anciens ont été utilisés à la place.
E: Impossible de traiter le fichier /var/lib/apt/lists/raspbian.raspberrypi.org_raspbian_dists_bullseye_main_binary-armhf_Packages (1)
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/raspbian.raspberrypi.org_raspbian_dists_bullseye_non-free_binary-armhf_Packages
E: Les listes de paquets ou le fichier « status » ne peuvent être analysés ou lus.


2023-05-07 02:21:46: server.c.1513) server started (lighttpd/1.4.59)
2023-05-07 02:21:46: gw_backend.c.475) unlink /run/lighttpd/pihole-php-fastcgi.socket-0 after connect failed: Connection refused

You certainly had a lot of errors there relating to database consistency and availability. You can try to do a backup using Settings > Teleporter > Backup or the command pihole -a -t but you may find the very same problems prevent it from working, so I'd suggest also taking screenshots or photos, and copy/paste into a text file for your settings, adlists, rules, etc. A bit messy but better than nothing.

It may be possible to try and fix all that but it doesn't take very long to do a clean install on a freshly imaged card, so I think that would be preferable if you can.

Have you had any further progress with it?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.