0

I did apt update && apt upgrade as root and now my Raspbian system is corrupt and won't boot anymore. After some debugging I noticed there's the package raspi-copies-and-fills.

Fortunately, my Pi isn't damaged, only the system is corrupt (verified by booting fresh Raspbian on my spare microSD cards). I want to recover this system, is it possible?

I have both Windows and Ubuntu at hand and microSD card readers, which I suppose should be up for a recovery job.

  • 3
    Just restore from the backup you made before upgrade – Milliways Mar 16 at 5:36
  • @Milliways I don't have backup. I flashed fresh Raspbian to spare SD cards just for verifying that the hardware isn't damaged. – iBug Mar 16 at 5:57
  • @Milliways - that makes me laugh every time - it'd be nice if such a backup didn't take 30 minutes or more, or require removing the SD card from the pi to do it quicker :p – Jaromanda X Mar 19 at 11:53
  • @JaromandaX It only takes 15 minutes to image a 16GB card, but there are other backup strategies (including SD Card Copier to duplicate a SD Card). The recovery method, listed in the Answer, often works but I am amazed by the users who claim to have valuable data but no backup. – Milliways Mar 20 at 0:55
3
  • Put the sd card into a card reader in Ubuntu system
  • Now the tricky part is finding the device in Ubuntu, it could be /dev/sdb or something like that - one way to determine is to check the output of dmesg, you should see a message regarding the new device being attached
  • assuming it's /dev/sdb:
  • Repair the second partiton with e2fsck -f /dev/sdb2
  • Then mount this partition: sudo mount /dev/sdb2 /mnt
  • Then run sudo rm /mnt/etc/ld.so.preload
  • And sudo umount /dev/sdb2

/etc/ld.so.preload contains /usr/lib/arm-linux-gnueabihf/libarmmem.so. This is the only significant file in raspi-copies-and-fills package.

Now insert the sd card back into the pi, and when you've booted, you can apt update && apt upgrade again since the offending package has been upgraded again and should now NOT break your pi

  • Why deleting /mnt/etc/ld.so.preload? For what is this file used? On my RasPi it doesn't contain anything about raspi-copies-and-fills. – Ingo Mar 19 at 11:35
  • 2
    Mine contains /usr/lib/arm-linux-gnueabihf/libarmmem.so ... this is the only significant file in raspi-copies-and-fills package – Jaromanda X Mar 19 at 11:37
  • yeah, I probably should've mentioned that in the answer @Ingo - otherwise it may look like I'm trying to do something nefarious :p thanks for the edit – Jaromanda X Mar 19 at 11:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.