1

I bought my SD-card in December last year (3 months of usage). And after an update and reboot it didn't start again. All I get when I try to log in via ssh is input/output error. I was running a version of Debian 7 and using it as a web server. I'm using Ubuntu on my laptop where I connect the sd-card. I Want to know the following:

  • What happened?
  • How can I fix it?
  • How can I prevent it from happening again?

my SD-card is a SanDisk Ultra SDHC at 16GB (CLASS 10), like this one.

after the fourth (!!!) reboot everything worked again. No idea why or what happened. I still want to know what's wrong with the SD-card!

  • Could it have become corrupted? – AwesomeUser Apr 14 '14 at 0:58
  • yes but how do I check that? – Alvar Apr 14 '14 at 8:21
  • Unfortunately, there isn't exactly a way to check that, more a way to fix it. If you don't have anything you want to keep on your pi, get a sd formatter ( sdcard.org/downloads/formatter_4 ) and wipe the card. Go to the RPi foundation and get a new copy of your choice OS. Flash it ( computers.tutsplus.com/articles/… ). You probably corrupted it by pulling the plug instead of typing 'sudo halt -p' – AwesomeUser Apr 14 '14 at 12:47
  • I never pulled the cord, it just didn't start after a reboot. No idea why. – Alvar Apr 14 '14 at 22:53
  • @AwesomeUser I stupidly pulled my cord while moving some furniture and my pi2 won't boot. (red light, no display, etc.) Didn't have a recent backup, any way to salvage my various configs and setups from the bad card? It mounts fine on a Mac. – Enrico Jun 21 '15 at 18:40
1

What happened?

Because booting worked, failed, then worked, sdcard corruption is unlikely, but maybe a file system check was forced slowing down the boot.

How can I fix it? / How can I prevent it from happening again?

It's inadvisable to change that behavior but you can do it early

sudo touch /forcefsck && sudo shutdown -r now

or disable it

tune2fs -c0 -i0 /dev/root

On recent official OS images this is disabled by default but likely you were using something else.

If you want to check for sd card corruption just copy a 10 GB file to your card and then md5 the original and the one on the card.

Plugging in a monitor to see what it's doing during boot is a good thing to try if this happens again.

  • Good answer but unfortunately this problem is long gone. I had it over a year ago. At the moment I can't even install the OS on the SSD, no idea why. But thanks for trying! – Alvar May 12 '15 at 15:29
  • If you can't install the OS try the md5 test to check for sd card corruption. – user1133275 May 12 '15 at 15:31
0

Try putting it in another Linux computer and running fsck drive/partition, or on a Mac, going into Disk Utility and running 'repair disk'.

  • 1
    I don't think an off-the-shelf Mac will handle Linux filesystems, but the Linux box idea is good. – Chris Stratton May 11 '15 at 22:54
  • @ChrisStratton It's just checking the file system. It's funny I only use my Macbook air and Linux Mint Dell Dimension. I did get my MB to run Ubuntu though... then I crashed the SSD. laughs in misery – Kachamenus May 12 '15 at 5:10
  • You can't check a filesystem on a system which doesn't understand that filesystem. There are ways to make a Mac do so, but off the shelf it won't. – Chris Stratton May 12 '15 at 5:14
  • You may have ext2/3/4 filesystem drivers added to your particular Mac. The stock configuration doesn't have those. Or maybe it didn't actually do anything. If you put the card in the Mac, can you actually see the Linux filesystem contents or only the little fat boot volume? If it is not recognized, be careful you don't accidentally format it as a Mac volume. – Chris Stratton May 12 '15 at 5:16
  • 1
    good sugestion, but a bit late. If you read the last two rows of the question you'll see that I solved it by rebooting a fourth time. And right now it's broken again, can't even install the OS at the moment (will only transfer a few files) – Alvar May 12 '15 at 15:30

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.