Earthenware
Posts: 10
Joined: Mon Jun 01, 2015 1:45 am

MicroSD Card corruption (again)

Fri Jan 15, 2016 4:49 pm

I realise that this is a common issue, but my problem seems to be a bit different.

I've never had any card corruption while booting, using or shutting down my Pi. The corruption has only happened when I've been backing-up the card.

To back up, I plug the card into an adaptor (brand name "Integral"), plug into a PC (Ubuntu 12.04) and issue the command "dd bs=4M if=/dev/sdc of=raspbian.img". The img file appears on the PC and no errors are reported. I always unmount the card before physically removing. I've used both USB2 and USB3 ports.

The next time I try to boot the Pi from the MicroSD, boot fails. Sometimes there is no boot at all, other times it reaches different stages in the boot process before hanging. I then have to rebuild the Pi (fortunately, I've learned to be scrupulous in backing up my data).

This happens on both of my MicroSD cards (Samsung Evo 32GB). One came with the Pi, the other off Ebay.

Is there something that I'm missing? All the other threads about card corruption talk about power failures, overclocking etc but my problem seems to be something in the backup process.

tpylkko
Posts: 409
Joined: Tue Oct 14, 2014 5:21 pm

Re: MicroSD Card corruption (again)

Fri Jan 15, 2016 5:13 pm

wait, are you trying to make the .img file on the sd-card?

Earthenware
Posts: 10
Joined: Mon Jun 01, 2015 1:45 am

Re: MicroSD Card corruption (again)

Fri Jan 15, 2016 5:25 pm

No, I'm trying to make an image file of the SD card.

I didn't make it clear, but when I issue the command "dd bs=4M if=/dev/sdc of=raspbian.img", it's from the destination directory on the PC.

i.e. "user@system/dir:~$ dd bs=4M if=/dev/sdc of=raspbian.img"

tpylkko
Posts: 409
Joined: Tue Oct 14, 2014 5:21 pm

Re: MicroSD Card corruption (again)

Fri Jan 15, 2016 5:33 pm

So, you also unmount before the dd? And when you say the boot fails after this process, you mean that after reading the card with dd, and not after reading and making an image and restoring that same image? In other words, when you do in fact restore that image, the image works, but the act of creating the image (reading the card) causes the problem? If you look at the card which no longer boots with fdisk on Ubuntu, what do you see. Is it mountable? Maybe that card reader is bad? Which kernel is that Ubuntu on?

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5618
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: MicroSD Card corruption (again)

Fri Jan 15, 2016 5:35 pm

What type of uSDHC card writer are you using on your PC? (ie. built-in or external USB - some built-in ones** are not fully SDHC compatible and that may not "show up" until the file size is >4Gb, IIRC).
Trev.
**SDHC requiring a uSDHC to SDHC adapter
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

Earthenware
Posts: 10
Joined: Mon Jun 01, 2015 1:45 am

Re: MicroSD Card corruption (again)

Fri Jan 15, 2016 5:41 pm

tpylkko wrote:So, you also unmount before the dd? And when you say the boot fails after this process, you mean that after reading the card with dd, and not after reading and making an image and restoring that same image? In other words, when you do in fact restore that image, the image works, but the act of creating the image (reading the card) causes the problem? If you look at the card which no longer boots with fdisk on Ubuntu, what do you see. Is it mountable? Maybe that card reader is bad? Which kernel is that Ubuntu on?
I don't even get as far as restoring (although that fails as well). It is the act of backing up that corrupts the card. And I always unmount before removing the card from the PC.

Earthenware
Posts: 10
Joined: Mon Jun 01, 2015 1:45 am

Re: MicroSD Card corruption (again)

Fri Jan 15, 2016 5:43 pm

FTrevorGowen wrote:What type of uSDHC card writer are you using on your PC? (ie. built-in or external USB - some built-in ones** are not fully SDHC compatible and that may not "show up" until the file size is >4Gb, IIRC).
Trev.
**SDHC requiring a uSDHC to SDHC adapter
I bought it from Maplins and it just says "Integral MicroSD HC". There are no other identifying marks.

If this was faulty it would explain a lot. Is there a recommended brand and model?

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5618
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: MicroSD Card corruption (again)

Fri Jan 15, 2016 5:58 pm

Earthenware wrote:
FTrevorGowen wrote:What type of uSDHC card writer are you using on your PC? (ie. built-in or external USB - some built-in ones** are not fully SDHC compatible and that may not "show up" until the file size is >4Gb, IIRC).
Trev.
**SDHC requiring a uSDHC to SDHC adapter
I bought it from Maplins and it just says "Integral MicroSD HC". There are no other identifying marks.
If this was faulty it would explain a lot. Is there a recommended brand and model?
FWIW, from my "Motley Collection"**, with a uSDHC to SDHC card adapter when necessary, the ones I've used on a regular basis to write (mainly Raspbian) images are 'D', 'H', N' & 'O' (my Acer Aspire one netbook, running Ubuntu, is too old to be sure it's buit-in SD card reader/writer is SDHC compatible). One of my older SDHC cards, bought for a digital camera, included 'D' with it. Similarily 'H' and 'O' were included with uSDHC cards.
** http://www.cpmspectrepi.webspace.virgin ... aders.html
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

Earthenware
Posts: 10
Joined: Mon Jun 01, 2015 1:45 am

Re: MicroSD Card corruption (again)

Fri Jan 15, 2016 6:16 pm

FTrevorGowen wrote:
Earthenware wrote:
FTrevorGowen wrote:What type of uSDHC card writer are you using on your PC? (ie. built-in or external USB - some built-in ones** are not fully SDHC compatible and that may not "show up" until the file size is >4Gb, IIRC).
Trev.
**SDHC requiring a uSDHC to SDHC adapter
I bought it from Maplins and it just says "Integral MicroSD HC". There are no other identifying marks.
If this was faulty it would explain a lot. Is there a recommended brand and model?
FWIW, from my "Motley Collection"**, with a uSDHC to SDHC card adapter when necessary, the ones I've used on a regular basis to write (mainly Raspbian) images are 'D', 'H', N' & 'O' (my Acer Aspire one netbook, running Ubuntu, is too old to be sure it's buit-in SD card reader/writer is SDHC compatible). One of my older SDHC cards, bought for a digital camera, included 'D' with it. Similarily 'H' and 'O' were included with uSDHC cards.
** http://www.cpmspectrepi.webspace.virgin ... aders.html
Looks great. Can you please recommend one for me to use to plug my MicroSD card into my PC?

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5618
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: MicroSD Card corruption (again)

Fri Jan 15, 2016 6:29 pm

Earthenware wrote: ...
FTrevorGowen wrote: FWIW, from my "Motley Collection"**, with a uSDHC to SDHC card adapter when necessary, the ones I've used on a regular basis to write (mainly Raspbian) images are 'D', 'H', N' & 'O' (my Acer Aspire one netbook, running Ubuntu, is too old to be sure it's buit-in SD card reader/writer is SDHC compatible). One of my older SDHC cards, bought for a digital camera, included 'D' with it. Similarily 'H' and 'O' were included with uSDHC cards.
** http://www.cpmspectrepi.webspace.virgin ... aders.html
Looks great. Can you please recommend one for me to use to plug my MicroSD card into my PC?
'N' is a generic "Poundstore" device - if you already have a uSDHC to SDHC adapter, cheap enough to "buy and try".
'H' and 'O' were purchased with a (compatible) uSDHC card (Transcend and Integral respectively) from a long-established** Jersey-based supplier.
Trev.
** >10 years, IIRC
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

Return to “Troubleshooting”