Strange SD Card Problems
#1
Hi,

I have Problems with SD card flashing that I cannot explain. Basically I have run Raspis for years, am comfortable with command line (Developer), have written lots of images to SD cards and mostly things worked as expected. Up to my pinephone. Basically I download images and write them to a 16GB card with dd like such:

Code:
/mnt/cloud/images# dd bs=128K if=Manjaro-ARM-phosh-pinephone-beta5.img of=/dev/sdd conv=fsync status=progress

On this one 16GiB card that I have lying around I can successfully do this with Manjaro Posh/KDE Images, Mobian and Arch for Arm. All work as expected. Now I have a bunch of 32GiB cards I'd like to use. But writing to those cards with the same dd command will result in boot failure. The LED on the pinephone turns red and that is iit. I have tried zeroing out the cards before write, bought new ones. None of the 32GiB cards work. I tried using different SD card readers etc. Nothing works. Except the trusty old 16Gib Sandisk Card. The 32Gib Cards are SanDisk and Transcend cards. If I flash for example Manjaro KDE, I get sensible values (to me) when checking the card with sfdisk like:

Code:
sfdisk -uS -d /dev/sdf
label: dos
label-id: 0x198aa440
device: /dev/sdf
unit: sectors

/dev/sdf1 : start=      62500, size=      437501, type=c
/dev/sdf2 : start=      500001, size=    9617119, type=83

The start sector of looks to be a bit far into the card, but it is the same as in the image:

Code:
fdisk -l Manjaro-ARM-plasma-mobile-pinephone-beta2.img
Disk Manjaro-ARM-plasma-mobile-pinephone-beta2.img: 4.8 GiB, 5174722560 bytes, 10106880 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xdc868f53

Device                                        Boot  Start      End Sectors  Size Id Type
Manjaro-ARM-plasma-mobile-pinephone-beta2.img1      62500  500000  437501 213.6M  c W95 FAT32 (LBA)
Manjaro-ARM-plasma-mobile-pinephone-beta2.img2      500001 10106879 9606879  4.6G 83 Linux

Any help or pointer would be really appreciated as to what could be the reason for this. Next stop is getting a UART Adapter so I can see what the bootloader is doing I guess.

Best Regards,

anhilde
  Reply
#2
I finally managed to boot from a 32GB card. How did I do it? First I wrote the image to a new card. It did not boot... Then I tried again, this time pressing on the SD slot from the outside. I will check with my calipers later if that old 16GB card is actuall slightly thicker than the new ones...
  Reply
#3
(02-18-2021, 11:34 AM)anhilde Wrote: I finally managed to boot from a 32GB card. How did I do it? First I wrote the image to a new card. It did not boot... Then I tried again, this time pressing on the SD slot from the outside. I will check with my calipers later if that old 16GB card is actuall slightly thicker than the new ones...

That does sound a bit odd. But sdcards are finnicky ime.

Try overwriting it with random data instead of /dev/zero.

Use:

Code:
sudo dd if=/dev/urandom of=/dev/mmcblk0 bs=8M status=progress

After doing the above random overwrite, flash your image again. If the card is still alive it should work (not the same longevity as other storage). I had an issue where overwriting with 0's booted the previous OS, or wouldn't boot. Since using /dev/urandom I have had no problems, and for one reason or another, seems to fix most sdcard issues others have had.

Hope this helps. Smile
- RTP

"In the beginner's mind there are many possibilities, in the expert's mind there are few." -Shunryu Suzuki


[ Pinephone Original | Pinetab v1 / v2 Enjoyer ]


Linux Device Privacy / Security Playlist



  Reply
#4
Thanks, I will try random instead of zeros. Seems that it was not the pressing on the slot. I tried once again writing an image. First try, booting failed, tried again, booting failed again. Then restarted my laptop without cardreader attached (thinkpad t420s) and wrote the same image once again and then it booted. Not sure if is coincidence, but I do remember restarting my laptop before the previous successful attempt. I do not understand how this could affect the write though. Perhaps it is just coincidence.

Best Regards,

anhilde
  Reply
#5
(02-18-2021, 11:34 AM)anhilde Wrote: I finally managed to boot from a 32GB card. How did I do it? First I wrote the image to a new card. It did not boot... Then I tried again, this time pressing on the SD slot from the outside. I will check with my calipers later if that old 16GB card is actuall slightly thicker than the new ones...

Are you referring to the slot in your laptop or card reader, or to the slot in your PinePhone?
  Reply
#6
Assuming these 32GB cards are new, have you tested them?  Counterfeits are so rampant, we had to put some information in our Wiki about it.[0]

[0] I come from Armbian, which is why I am very familiar with our links / wiki as well as common problems.  If there are similar resources here I have just not found them yet, still learning my way around Pine docs / wiki, etc.
Cheers,
TRS-80

What is Free Software and why is it so important for society?

Protocols, not Platforms

For the most Linux-y experience on your Linux phone, try SXMO!

I am (nominally) the Armbian Maintainer for PineBook Pro (although severely lacking in time these days).
  Reply
#7
(02-19-2021, 10:12 AM)dsimic Wrote:
(02-18-2021, 11:34 AM)anhilde Wrote: I finally managed to boot from a 32GB card. How did I do it? First I wrote the image to a new card. It did not boot... Then I tried again, this time pressing on the SD slot from the outside. I will check with my calipers later if that old 16GB card is actuall slightly thicker than the new ones...

Are you referring to the slot in your laptop or card reader, or to the slot in your PinePhone?

I refer to the slot on the pinephone.

(02-19-2021, 01:41 PM)TRS-80 Wrote: Assuming these 32GB cards are new, have you tested them?  Counterfeits are so rampant, we had to put some information in our Wiki about it.[0]

[0] I come from Armbian, which is why I am very familiar with our links / wiki as well as common problems.  If there are similar resources here I have just not found them yet, still learning my way around Pine docs / wiki, etc.

Thanks for the link, I will test them. They are originally packaged and ordered from amazon. So I would hope they are originals.
  Reply
#8
Amazon has a lot of hinky sellers, it's almost like buying from eBay at this point. Even if the product was sold directly by Amazon it is not unusual for major retailers to be hit with a shipment of counterfeit items. The problem is rampant.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  PinePhone Beta Edition will not boot from MicroSD card Timothy_Ecc 27 28,190 01-29-2023, 12:20 PM
Last Post: skandigraun
  Pinephone won't boot from SD card arkadione 3 4,265 05-25-2022, 03:26 PM
Last Post: sfb
  Largest supported micro SD card? zooidic 2 2,477 01-08-2022, 06:01 AM
Last Post: zooidic
  Red LED when trying to boot from SD card. Need advice. サーバント 5 5,140 10-20-2021, 09:40 AM
Last Post: biketool
  camera firmware problems kqlnut 25 25,428 09-02-2021, 07:49 PM
Last Post: Zebulon Walton
  Fragile SIM card connector hakkou 1 2,121 08-25-2021, 07:44 AM
Last Post: wibble
  camera + megaixel and strange behavior streak 0 1,914 06-02-2021, 06:45 AM
Last Post: streak
  Sd card slot death? Hurrikan 7 7,689 05-17-2021, 03:55 PM
Last Post: jrballesteros05
  WARNING to future users ~ Order yourself a SIM Card Extender Bonesdog 3 4,580 05-03-2021, 10:06 AM
Last Post: Bonesdog
  Fastest SD card happybot-4678 9 9,932 02-20-2021, 01:08 AM
Last Post: dsimic

Forum Jump:


Users browsing this thread: 1 Guest(s)