Need help resurrecting my Pi

My PiAware stopped reporting a few weeks ago and I finally got around to hooking the Pi up to an HDMI monitor. It seems to hang at the PiAware 3.3.0 graphic screen and there’s “initramfs” and a blinking underline cursor on the top left.

I’m only slightly *nix savvy, but I have mounted the SD card in a Kali Linux virtual machine running on my MacBook and I can see all of the files. I’m hoping that I can replace/delete/copy a corrupted file or two and be back in business. If that’s the case, would anyone know which files they might be? I’d hate to have to recreate everything from scratch.

Thanks!

This is true for most persons who are tech minded and *nix savvy.

However my approach is different. I dont want to have headache of debugging, so in such situations, I simply format microSD card, download latest version of Piaware image, and write it to microSD card.

I’ve added Virtual Radar Server and all sorts of modifications, so I’m reluctant to start over from scratch, especially since I doubt I’d remember how to get it all working again. It’s my own fault for not having a backup image, so no matter the outcome, that’ll be rectified in the future.

Not sure what specifically has failed, but it’s failing very early on - you’re getting dropped into a diagnostics shell from the initramfs.
This is a very minimal environment but it does have enough that you can try to see what’s going on.

you could try:

  1. edit /boot/cmdline.txt, remove any “splash” or “quiet” args and add “debug nosplash” at the end
  2. boot it on the Pi;
  3. “cat /run/initramfs/initramfs.debug” if the error isn’t obvious from previous output

which may give you a better idea of what’s failing

See wiki.debian.org/InitramfsDebug for a somewhat more complete explanation

What’s the secret to editing the cmdline.txt file? I’ve edited it in TextEdit on my MacBook and in vi and nano on the virtual machine (sudo) and even when I see that the file has changed, when I mount it again it has reverted to the original file. I guess I’m not as smart as I thought.

Not true. You are just not as far along the learning curve as you will be. You’re smart enough to ask good questions.

I would create a backup image of where it is right now. Then using a new sdcard I would copy the image to it and reboot.

That would be a quick check that the sdcard itself is not the problem. I usually replace an sdcard after a year. The speeds are always improving, and you only get so many writes.

I personally wouldn’t put any kind of webserver on a Pi. Especially VRS. It is a heavy disk writer, and every time you write to an sdcard it is one step closer to the end of life :slight_smile:

I’m probably a worry-wart, but sdcards are cheap. I usually buy them 5 at a time.

No secret, it should “just work”. Make sure you unmount the drive cleanly.
If the changes are not taking, I would start suspecting a damaged sdcard (which could also explain the boot failure).

hi

my approach to similar issues (for a pi3b without monitor etc - remote SSH) is:

a. write the latest piaware image to a usb dongle 8gb or more.
b. mount it to a virtual machine
c. use ‘gparted’ (from the VM) to resize the dongle 2nd partition to max.
d. set the /etc/network/interfaces and the /etc/wpa_supplicant/wpa_supplicant.conf, to use a static IP and note it.
e. in the ‘cmdline.txt’ (boot partition of the SD card) replace the boot device from root=/dev/mmcblkp02 to root=/dev/sda2
(sda2 being the 2nd dongle partition). dongle seems to be faster than SD happily performing reads/writes.
f. to have a semi-GUI while SSHing, I install Midnight Commander and also use its built-in editor (sudo apt-get install -y mc).
g. then I mount the 2nd partition of the SD ( mount /dev/mmcblkp02 /mnt ) and start the forensics… :wink:
while my system is feeding FA through the dongle.

HTH and will not find it complicated or advanced…

PS plug the usb dongle directly to pi, not through usb hub (even if powered).

sometimes running a fix sdcard errors on w
Linux machine with a sdcard reader solve the problem, I have experienced that for two times one with success another unfortunately without success and I have started from scratch…
good luck

Sent from my SM-N910F using Tapatalk