Poorly pi - boot problem

I've got a PI that has been quite happily working away since the spring. I'm not overly taxing it at the moment, but that should change.

It sends me an email once a day (triggered by cron) with some information it has gathered. Yesterday I didn't get the email, but didn't have time to investigate. Today, I've not had an email, so I decided to have a look.

The Pi is plugged into my TV, but to keep things tidy, I unplug the USB hub, so the keyboard and mouse are not usually attached. I reconnected the hub/keyboard/mouse, and then turned the TV on. I got the Pi desktop, but it wouldn't respond the mouse (pointer stayed mid screen) or keyboard, so I turned the power off to reboot.

Upon rebooting, it got so far through the sequence, then told me that there was a file system problem, and asked me to run fsck and reboot, which I did.

Fsck duly reported problems (which I didn't get a note of), giving me a large number of errors (numbers, so block numbers I assume), and then asked me if I want to fix, I typed y and return. From this point on, it had a bad habit of continuing to print the y character on the screen until I pressed return again.

Once fsck had finished, I ran shutdown -r now (the w character appeared across the screen many times). It started to reboot, and I got about a screen full of messages (which didn't seem to give any errors). Once the first screen full had appeared, it quickly cleared the screen, and all I got after that was a blank screen with a flashing cursor top left. Power cycling leads to a repeat of the above.

Any suggestions ?

TIA

Adrian

--
To Reply : 
replace "bulleid" with "adrian" - all mail to bulleid is rejected 
 Click to see the full signature
Reply to
Adrian
Loading thread data ...

New SD card, restore from backup.

Reply to
Roger Bell_West

I have a nasty feeling that will be the eventual solution, but in the mean time, I'm open to other ideas.

Is ~6 months a reasonable life expectancy for a SD card ?

Adrian

--
To Reply : 
replace "bulleid" with "adrian" - all mail to bulleid is rejected 
 Click to see the full signature
Reply to
Adrian

Is the keyboard auto-repeating keys? I've seen that on the odd occasion when going through a particular USB hub. Changing or eliminating the hub might help, or changing the keyboard.

--
Alan Adams, from Northamptonshire 
alan@adamshome.org.uk 
 Click to see the full signature
Reply to
Alan Adams

FSVO 'reasonable' yes.

--
Ineptocracy 

(in-ep-toc?-ra-cy) ? a system of government where the least capable to  
 Click to see the full signature
Reply to
The Natural Philosopher

In message , Alan Adams writes

Prior to today, it hasn't done it before, and now it doesn't go far enough through the boot sequence for the keyboard to become active.

The Pi is still powered up, and I do see the activity light come to life from time to time.

Adrian

--
To Reply : 
replace "bulleid" with "adrian" - all mail to bulleid is rejected 
 Click to see the full signature
Reply to
Adrian

Does the RPi get powered off when you turn the TV off? You don't say one way or another.

If turning the TV off kills the RPi then, if it happened to be writing to the SD card at the time, you'd corrupt the filing system on the SD card. If this is what happened, try reformatting the same card, reinstalling (presumably) Raspbian Linux and then put your backed up data, programs, etc. back in place. You do have a backup, don't you?

The only guaranteed safe way to shut down a vanilla[*] RPi setup running Linux is to stop Linux with the 'halt' command and then power the RPi off when shutdown is complete, i.e. when the green LED has made its last flash and only the red LED is still on.

  • Anything more clever than this needs the RPi to be powered separately from the TV, possibly via a rechargeable 5v supply that gets topped up when the TV is on. It also needs some way of detecting that the TV has been turned off and something like the Pi-supply switch which can stop Linux and then power the RPI off. Of course, you could also just leave the RPI powered up: it uses under 2.5 watts when its idle.
--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
 Click to see the full signature
Reply to
Martin Gregorie

Raspian uses ext4 by default, doesn't it? It ought to be relatively robust against flaws of that type. (Certainly my GPS-tracker setup doesn't seem to suffer from being shut down by power-off.)

Reply to
Roger Bell_West

In message , Martin Gregorie writes

The Pi is powered separately from the TV, the Pi being on 24*7, the TV as required. The HDMI lead between the two is always connected up.

Adrian

--
To Reply : 
replace "bulleid" with "adrian" - all mail to bulleid is rejected 
 Click to see the full signature
Reply to
Adrian

Agreed, and ext4 pretty resilient, but there are still fail points: what damage would happen if a journal block was being written or if the journal had been flushed at the end of a fs commit but the flash page was still being written back to the SD card? I admit I'm guessing. However, AFAIK ext4 doesn't adjust its disk block size to match the SD card's page size.

As a case where I've definitely seen more than one case of SD card corruption, when the user thought his program was inactive and either turned the satnav off without shutting it down or simply pulled the card out while the satnav was still powered up with its navigation program running. These cases involved a Binatone B.350, which uses Win CE 5 or 6 rather than Linux and were running LK8000 or XCSoar from the SD card instead of the built-in car navigation software, which runs on the internal flash memory. Both LK8000 and XCSoar are glider navigation and tracking programs: both write a minimal trace log and, while airborne, record a fix every second in an IGC format log file. Both logs are on the SD card.

--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
 Click to see the full signature
Reply to
Martin Gregorie

Fair enough. Is the power lead loose enough to glitch if disturbed? Micro- USB connections can wear or get bent. Is it possible that it glitched if something, say a cat, disturbed the HDMI cable. Same comments about the SD card. Apart from that I'm out of ideas.

--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
 Click to see the full signature
Reply to
Martin Gregorie

In message , Martin Gregorie writes

Thanks for the suggestions.

Whilst the Pi is out in the open, there is little to disturb it where it is, save the odd passing spider.

Looks like it is time to obtain a new SD card.

Adrian

--
To Reply : 
replace "bulleid" with "adrian" - all mail to bulleid is rejected 
 Click to see the full signature
Reply to
Adrian

In message , Adrian writes

Or is it ?

I've just had my daily email from it, so it is working to some extent. However, I can't get it to show anything on the TV. Looks like I'll have to try and connect another computer to it, and see if I can SSH in. A job for later today.

Adrian

--
To Reply : 
replace "bulleid" with "adrian" - all mail to bulleid is rejected 
 Click to see the full signature
Reply to
Adrian

I have a Pi that's in daily use for almost 18 months now - still on its original SD card.

Unless it's doing lots and lots of writes all the time (or you have an el-cheap SD card), then I suspect it's file system corruption rather than media damage - the issue then is where the corruption came from.

You can test the card using badblocks in another device that can read/write the card.

But re-image, restore from backup is the way forward, no matter what the outcome, (same or new SD card)

Also in the past 6 months there has been a few kernel and bootcode updates too - there have been SD card driver issues in the past, so if you've not been keeping up to date, it's possible this is what's bitten you (but really hard to be sure - for me, my SD card errors went away when I stopped overclocking them and used decent PSUs)

Gordon

Reply to
Gordon Henderson

In message , Adrian writes

I've connected the Pi up to a router, and plugged a Unix box into the same router. The network lights on the Pi come on, but there is no light on the corresponding port on the router (even after a reboot). So it looks as though I'm not able to log onto the Pi to try and find out what is happening.

The good news is that I've been able to read the SD card using another (non-Pi) machine, so I can at least pull back stuff from it that isn't backed up.

Adrian

--
To Reply : 
replace "bulleid" with "adrian" - all mail to bulleid is rejected 
 Click to see the full signature
Reply to
Adrian

(After you've done the backups) what does fsck on the other Linux box have to say about the partitions on the SD card?

If the LEDs don't look like you expect, can you learn anything from them? This explains what they mean:

formatting link

--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
 Click to see the full signature
Reply to
Martin Gregorie

I probably won't have time to have a look now until next weekend.

Will do.

Thanks for the suggestions.

Adrian

--
To Reply : 
replace "bulleid" with "adrian" - all mail to bulleid is rejected 
 Click to see the full signature
Reply to
Adrian

If the SD card is reordering the writes it may not be.

Many SSDs reorder, and/or transparently cache writes, I see no compelling evidence that some unknown and untested SD card is going to be better behaved.

--
?? 100% natural
Reply to
Jasen Betts

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.