jslade
Posts: 2
Joined: Fri Jul 17, 2015 3:15 pm

RPi 2 boots but can't login -- SD card corruption?

Fri Jul 17, 2015 3:45 pm

I have a RPi 2 running raspbian, setup with postfix, apache, ... Everything was working fine for about 45 days, now it's gone a little crazy. It started with dovecot complaining about corruption in some of the mdbox files, but now I can't even login -- not via ssh, not via the console.

The pi boots up seemingly correctly - I can hit the web server and get a response. But trying to login at the console:
Raspbian GNU/Linux 7 pi1 tty1

pi1 login: root

Login incorrect

Login incorrect

Login incorrect

Login incorrect

Login incorrect
Maximum number of tries exceeded (5)
It tells me "Login incorrect" before prompting for a password. Same result for any username -- whether an actual user or a bogus name. So it looks to me like it's not even able to read /etc/passwd or something.

It's accepting connections on port 22 for ssh, but fails to login:
> ssh -vvv root@10.0.0.207
OpenSSH_6.7p1 Ubuntu-5ubuntu1, OpenSSL 1.0.1f 6 Jan 2014
...
debug1: Connecting to 10.0.0.207 [10.0.0.207] port 22.
debug1: Connection established.
...
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.0p1 Debian-4+deb7u2
debug1: match: OpenSSH_6.0p1 Debian-4+deb7u2 pat OpenSSH* compat 0x04000000
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.7p1 Ubuntu-5ubuntu1
...
debug1: Host '10.0.0.207' is known and matches the ECDSA host key.
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-dss blen 433
debug2: input_userauth_pk_ok: fp 34:64:dc:5a:cb:06:d0:4e:95:78:e8:25:d6:a3:46:31
debug3: sign_and_send_pubkey: DSA 34:64:dc:5a:cb:06:d0:4e:95:78:e8:25:d6:a3:46:31
Connection closed by 10.0.0.207
Any hints at how I might be able to get into the system to poke around or recover files? Some other things I've tried:

* Via the recovery console, I edited cmdline.txt to add "init=/bin/sh", and it will boot to a single-user shell, but I'm not able to mount the partition to do anything with it. Doesn't seem like I can do anything useful from there. I have a USB stick that I could use to copy files to, except the single-user shell doesn't seem rich enough to do that. I'm probably missing something.

* Using a Ubuntu live USB stick on a laptop with an SD card reader, I tried accessing files from the ext4 partition, but no luck there, either. "fdisk -l" shows me the expected partitions, it looks like the extended Linux partition is #2 and the logical Linux partition I want is #6 (sorry don't have the exact output now). But only /dev/mmcblk0 and /dev/mmcblk0p1 exist on the system (ubuntu), not /dev/mmcblk0p2 or /dev/mmcblk0p6 as I would expect.

I'm open to options to access the files via the RPi2. or via ubuntu, or windows. Obviously the sdcard is not entirely corrupted, since it will boot.


Thanks,
Jeremy

FM81
Posts: 518
Joined: Wed Apr 17, 2013 4:33 pm

Re: RPi 2 boots but can't login -- SD card corruption?

Sat Jul 18, 2015 9:03 am

jslade wrote:I have a RPi 2 running raspbian ...
Normally you should expect "/dev/mmcblk0p1" and "/dev/mmcblk0p2" in this case.
jslade wrote:Using a Ubuntu live USB stick on a laptop with an SD card reader, I tried accessing files from the ext4 partition, but no luck there, either. "fdisk -l" shows me the expected partitions, it looks like the extended Linux partition is #2 and the logical Linux partition I want is #6 (sorry don't have the exact output now). But only /dev/mmcblk0 and /dev/mmcblk0p1 exist on the system (ubuntu), not /dev/mmcblk0p2 or /dev/mmcblk0p6 as I would expect.
The output of

Code: Select all

fdisk -l
given by the Live-UBUNTU, could be very useful, please post it, if possible. May be, UBUNTU sees the SD-card-partitions as "/dev/sdb1" and "/dev/sdb2" or what ever.
If the card-data are very important for you, you can make a clone first via 'dd'-command BEFORE trying any other experiments ...

Greetings, FM_81
A: What does the command 'cat /dev/urandom', can you tell me please?
B: Yeah, that's very simple: It feeds your cat with radioactive material!

jslade
Posts: 2
Joined: Fri Jul 17, 2015 3:15 pm

Re: RPi 2 boots but can't login -- SD card corruption?

Mon Jul 20, 2015 2:46 pm

I was able to recover the files I needed from the SD card using Linux Reader from DiskInternals - http://www.diskinternals.com/linux-reader/

So not quite a resolution to the issue, but at least got me moving forward. One of the missing pieces of my last install was a backup solution - I use crashplan. I got stuck getting crasphlan working last time and never got back around to it. Not gonna happen this time.

Return to “Troubleshooting”