2

I have a Raspbian installation on which I installed a lot of stuffs.

A few weeks ago, I bought a Class10 16Gb card and cloned my raspbian installation from my old Class4 4Gb SD card to this new SD card.

I did not expand the old FS to the whole 16Gb partition (I planned to create another partition later but this is not a problem for me).

The problem

Everything worked fine until yesterday:

  • impossible to log-in using SSH
  • after rebooting (connecting my TV screen and a keyboard) nothing happened
  • since that, every time I connect my power supply, the screen flashes but nothing happens
  • I tried to re-use my old Class4 SD: booting and running was OK
  • Connecting my Class10 SD card to another linux machine:
    • IO errors
    • unable to perform any fsck (due to errors)

When I shutdown my RPi, I always use "shutdown -h now" command. Yesterday, my RPi was up and running since 4 days.

What I already did

Testdisk

I ran testdisk and it indicated some errors

check_FAT: Unusual number of reserved sectors 16 (FAT), should be 1.
Warning: number of heads/cylinder mismatches 255 (FAT) != 1 (HD)
Warning: number of sectors per track mismatches 63 (FAT) != 1 (HD)
 1 * FAT16 LBA                   8192     122879     114688 [RPIBOOT16G]
 2 P Linux                     122880    7829503    7706624

I did not write modification to the SD card using it.

FS backup

I mounted my fs as read-only and tried to copy (cp -a) the whole files to another directory (this is because I made some changes since I cloned from Class4 to Class10 SD). Apparently, it finished without errors.

What should I do now ?

Now I have a backup of my files, but I don't know how to repair the failing SD card.

Should I rewrite partition table ? But how (which partition size for /boot, other partition to add, create a new MBR and how) ?

So what should I do now to restore my Class10 SD card with the backup I made ?

What tools, what procedure should I use ?

lauhub
  • 334
  • 3
  • 7
  • how did you back up your class 4 card? using 'dd' command you can easily make a 1:1 image from your card which results in a .img file – Gotschi Dec 11 '13 at 14:59
  • I know that, that is already used dd to clone it to the 16Gb card. What I want to know is how to recover my 16Gb backuped files. – lauhub Dec 11 '13 at 15:40
  • Just too rule out the obvious how are you powering your Pi? – Steve Robillard Dec 11 '13 at 16:36
  • I have a 2000mA power output which seems to work fine (no problem since 6 months). – lauhub Dec 11 '13 at 16:45
  • if your Class 10 card is still recognized and can be mounted, I don't think there's any problem. Corruption can happen and can (but not have to) lead to physical damage. – Gotschi Dec 11 '13 at 19:36
  • Are you overclocking your Pi? I had major corruption on my class 10 card that turned out to be caused by overclocking. See http://elinux.org/RPiconfig#SD_Card_Usage_with_Overclocking for more details on that. After restoring my SD card from a dd backup I noticed that there were SD write timeouts in syslog that were going unnoticed for some time. See [my SO question](http://raspberrypi.stackexchange.com/questions/12042/what-could-cause-the-ext4-root-file-system-to-become-unusable-after-a-reboot-or) for details on my issue. – HeatfanJohn Dec 11 '13 at 21:18
  • Can't you just redo what you did when you originally cloned it? – HeatfanJohn Dec 11 '13 at 21:33
  • @Gotschi: yes it can be mounted. But when I tried this, I had IO errors. But now it has not error anymore. I will retry to boot my RPi with it – lauhub Dec 12 '13 at 08:23
  • @HeatfanJohn: no overclocking there – lauhub Dec 12 '13 at 08:23
  • I made a new fsck on the corrupted volume. Although the first time, the fsck completed with errors, by now it said "disk clean" with no errors. So I try booting again this morning with my class10 SD card and... it worked ! Maybe be it just needed to sleep for a night ! – lauhub Dec 12 '13 at 08:26
  • Maybe the fsck did not work the first time because I performed it on an old machine. The second time, I used a brand new Debian virtual machine. – lauhub Dec 12 '13 at 09:21

0 Answers0