• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: SD card problems on cold boot  (Read 5156 times)
Per
Newbie
*

Karma: 0
Posts: 3


View Profile
« on: November 01, 2009, 01:02:32 AM »

Hi, I don't know if anyone else has seen this but my Plug seems to have problems accessing the SD card during a cold start (power completely removed and restored).  If I reset it by pushing the reset button or by interrupting u-Boot and typing reset, it has no problems after that until the next time it loses power.  Here are my specifics:

Everything including the kernel and initrd are on a single partition of a Patriot 16G SDHC card.
U-boot 3.4.19
Fedora 11 ARM distribution
Kernel 2.6.31.5 cross-compiled from source using the config file from here as a starting point:
http://fedora.danny.cz/arm/kirkwood/
I needed a few extra options for iptables support, or I would have just used the already compiled image he's distributing.

When it comes up from a cold boot I get stuff like this shortly after / gets remounted read-write:
Code:
EXT3-fs error (device mmcblk0p1): read_inode_bitmap: Cannot read inode bitmap - block_group = 19, inode_bitmap = 622593
EXT3-fs error (device mmcblk0p1): read_inode_bitmap: Cannot read inode bitmap - block_group = 19, inode_bitmap = 622593
EXT3-fs error (device mmcblk0p1): read_inode_bitmap: Cannot read inode bitmap - block_group = 19, inode_bitmap = 622593
EXT3-fs error (device mmcblk0p1): ext3_find_entry: reading directory #154528 offset 0
/etc/rc.d/rc.sysinit: line 785: /sbin/pam_console_apply: Input/output error
EXT3-fs error (device mmcblk0p1): read_inode_bitmap: Cannot read inode bitmap - block_group = 19, inode_bitmap = 622593
EXT3-fs error (device mmcblk0p1) in ext3_new_inode: IO failure
/etc/rc.d/rc.sysinit: line 789: /var/run/utmp: Input/output error
/etc/rc.d/rc.sysinit: line 863: /sbin/getkey: Input/output error
EXT3-fs error (device mmcblk0p1): read_inode_bitmap: Cannot read inode bitmap - block_group = 19, inode_bitmap = 622593
/etc/rc.d/rc.sysinit: line 791: /bin/chgrp: Input/output error
chmod: cannot access `/var/run/utmp': No such file or directory
EXT3-fs error (device mmcblk0p1) in ext3_new_inode: IO failure
touch: cannot touch `/var/run/getkey_done': Input/output error
Enabling /etc/fstab swaps:  /etc/init.d/functions: line 519: /sbin/swapon: Input/output error

I've written a VERY kludgy patch for /etc/rc.sysinit that basically double-boots the machine to ensure a warm start:
Code:
--- rc.sysinit.orig 2009-06-08 08:08:43.000000000 -0700
+++ /etc/rc.sysinit 2009-11-01 00:25:16.000000000 -0700
@@ -630,6 +630,20 @@
   action $"Remounting root filesystem in read-write mode: " mount -n -o remount,rw /
 fi
 
+# Kludge for SheevaPlug SDMMC cold boot
+if [ -f /.sheevabootkludge ] ; then
+  echo $"Second boot, proceeding..."
+else
+  echo $"First boot, rebooting for Sheevaplug SDMMC kludge"
+  touch /.sheevabootkludge
+  touch /forcefsck # This is to keep from ever reaching max mounts
+ # without fsck because it could happen during a cold
+ # boot.
+  reboot -f
+  exit 1
+fi
+rm -f /.sheevabootkludge
+
 # Clean up SELinux labels
 if [ -n "$SELINUX_STATE" ]; then
    restorecon /etc/mtab /etc/ld.so.cache /etc/blkid/blkid.tab /etc/resolv.conf >/dev/null 2>&1

Note that this really results in THREE boots, because the first time around it can't actually write to the filesystem and it throws up a "journal commit I/O error" error message when it tries.  Fortunately the I/O is still sane enough at this point that the reboot command can read and execute.

Anyway, I'm sure there's a better way.  Is this something anyone else has seen?
Logged

Billy
Newbie
*

Karma: 0
Posts: 12


View Profile
« Reply #1 on: November 01, 2009, 03:24:05 AM »

I think this is the known problem on a power-on boot up!

So far the only thing that has worked is to have two mmcinit; commands.

See  MMC/SD support in u-boot

Posts: 23

Re: MMC/SD support in u-boot
Reply #50 on: September 20, 2009, 10:24:44 AM
   Reply with quoteQuote
Quote from: CqCn on September 18, 2009, 08:35:39 PM
westyd1982,  The solution to this problem in a slightly different context was given here by me ~1 week ago. I am in a bit of a hurry; search for recent msgs from me and you would see it.
CqCn -

I'm not sure I found your solution.  I tried adding rootdelay=10 to my bootargs_root.  It didn't make a difference.  So far the only thing that has worked is to have two mmcinit; commands.  On a power-on boot up, the first one fails, and the second one works.  On a reboot they both work.
Logged

Per
Newbie
*

Karma: 0
Posts: 3


View Profile
« Reply #2 on: November 01, 2009, 09:30:26 AM »

Actually I found and tried the double mmcinit solution, but it didn't work for me.

From u-Boot's perspective the card is present and initializes just fine the first time from cold boot.  But Linux gets into a tizzy when it tries to write to the card for the first time.
Logged

DamonHD
Full Member
***

Karma: 4
Posts: 169


View Profile WWW
« Reply #3 on: November 01, 2009, 11:52:52 AM »

Could you boot with them ro and remount rw somehow?

Are they actually getting mounted as ext3 the first time, rather than ext2?

Rgds
Damon
Logged

Per
Newbie
*

Karma: 0
Posts: 3


View Profile
« Reply #4 on: November 01, 2009, 04:40:24 PM »

Could you boot with them ro and remount rw somehow?

I think this is what happens when the initrd hands off to the system.  The mount ro works, the boot proceeds until the filesystem gets remounted rw and then shortly after that it blows up (but only on a cold boot as I explained earlier).

Quote
Are they actually getting mounted as ext3 the first time, rather than ext2?

My /etc/fstab has the filesystem as ext3, and the init script in my initrd has this line:
mkrootdev -t ext3 -o defaults,ro /dev/mmcblk0p1

So I'm pretty sure it's always mounted as ext3.
Logged

jeromux
Newbie
*

Karma: 0
Posts: 4


View Profile
« Reply #5 on: December 29, 2009, 09:49:09 AM »

hi

I have the same problem , did you find a solution ?
I am in multiboot SD,USB,Nand ( I try USB,SD,Nand it's the same)
the SD card is the same Patriot sdhc 16Go class 6
I'm running debian lenny
uBoot 3.4.19
the uImage and uInitrd loading good, Linux is starting and after 7-8 seconds it writes a lot of this message:

Quote
mmcblk0: error -110 sending read/write command, response 0x400d00, card status 0x400d00
end_request: I/O error, dev mmcblk0, sector 5800519
mmcblk0: retrying using single block read
INIT: cannot execute "/sbin/getty"

The Debian (same install from tarball) on USB stick starts everytime without problems

Any Ideas ?

Logged

UnaClocker
Full Member
***

Karma: 0
Posts: 131



View Profile WWW
« Reply #6 on: January 05, 2010, 05:10:09 PM »

I have a bootdelay of 5 seconds, and have never run into this.. Have you tried that?
Logged

SheevaPlug - 8gb class 4 SDHC primary drive, 4tb 3.5" media drive, Debian Wheezy, nginx, Samba, Shorewall

jeromux
Newbie
*

Karma: 0
Posts: 4


View Profile
« Reply #7 on: January 06, 2010, 01:26:04 PM »

hi
thanks for the reply Cheesy
but it's  the same i have a rootdelay=5 with 2 mmcinit , i change with bootdelay=5 and it's the same
it's a read problem i think, in console i can see

Code:
[   18.250000] EXT2-fs error (device mmcblk0p2): ext2_readdir: bad page in #180397
[   18.260000] Remounting filesystem read-only
[   18.260000] mmcblk0: retrying using single block read
[   18.270000] mmcblk0: error -110 sending read/write command, response 0x400d00, card status 0x400d00
[   18.280000] end_request: I/O error, dev mmcblk0, sector 6061408

can you show me you're "setenv parameters"

thanks


Logged

Pages: [1]
Print
Jump to: