Unable connect to SBC due to accidental removal of iproute2 during uninstallation of PiHole

I previously searched for related content on the forum, but ultimately ended up re-flashing the SD card and reinstalling from scratch. I would like to know how to handle this situation if it happens again.

Here is my situation:

  • SBC model is NanoPi R2S
  • I have dietpi backup on SD card
  • Unable to connect to SBC via HDMI, serial port, or LAN
  • SD card storage can be accessed by other devices
  1. Is it possible to return to normal under existing conditions?
  2. Is there any way to copy the iproute2 or other missing file to SD card?
  3. Can the existing Dietpi shell script be used on other devices to restore the contents of an SD card from a backup file?
  4. Is it effective to create a script file in the directory /var/lib/dietpi/postboot.d and execute dietpi-backup -1?

Yes. We had a couple of cases where similar happen due to PiHole uninstall process and we where able to get system back online.

Best is to download the related Debian package and install the whole *.deb file

no

Something that never has been tested if this would be working.

What can I do in this situation?

  • When the system is running smoothly, make a backup onto a new USB stick, then follow the steps as you mentioned in these topic1 topic2
  • Create a full backup of the SD card as an image?
  • If I mount the SD card storage to another device and restore it using a script and backup files, is this method feasible? If so, where should I start?

Option 1 and 2 should be feasible.

#1 should be feasible. It is supported ootb by our scripts and initial setup process.

#2 should be feasible. creating an image regularly would need to be setup manually. Actually, we don’t have a tool who would create such images on a running system.

#3 theoretically it might work if you manually run/configure rsync for this.

1 Like

Thank you for your help and patient responses!

By the way, it would be much better not to remove the core packages like iproute2 :wink:

1 Like

Got it :smile: