XO-1 SD card access during boot-up

Mikus Grinbergs mikus at bga.com
Sun May 27 11:22:59 EDT 2012

DISCLAIMER:  I am not asking for help;  I'm sharing my experiences.

Encountered an interesting situation on one XO-1 with os11 (12.1.0):  On 
completely random occasions, the boot-up sequence stops because of i/o 
errors on device mmcblk0.  Without making any changes whatsoever, the 
very next boot-up runs fine.

[EDIT:  I've now put os12 on that system.  Problem has not re-occurred.]

[I've discussed with Kevin the question of "when during boot-up is it a 
good time to mount an SD card?"  In my case, I need Sugar to find 
resources located on that card -- so I need that card to be already 
accessible when Sugar is starting up.]

For three years now, as part of my XO customization I've had an 
initialization script in /etc/rc.d/init.d/ that issues an explicit 
'mount' of my "permanent" SD card -- and that script has always worked 
well.  [For historical reasons, my mount point is to a subdirectory in 
/media.]  Now I'm starting to see these random errors after that script 
is installed.  [I've reinstalled os11 on that system several times from 
scratch -- since the problem keeps coming back it is NOT due to an 
operator mistake while installing.]

The closest I have to a clue is that /media appears to be empty.  I'm 
speculating that after my initialization script tests for the existence 
of my mount point subdirectory (and creates that subdirectory if need 
be), something is wiping /media.  And that the 'mount' command (or a 
subsequent bash 'test -f' command) is getting errors because the inode 
it looks for is not present.

[I don't think the errors occur before my initialization script gets 
run.  If the system were accessing the SD card, it would do so whether 
my script was there or not.  Yet the errors only show up after my script 
has been installed - so its presence must have an influence.]

So far, I've put os11 on only a couple of XO-1s.  This is the only 
system on which I'm having this problem.  I'm guessing that there is 
some sort of a race condition - such that ordinarily my mount point 
subdirectory gets left alone after my initialization script has created 
it.  But on random occasions with this particular system, something 
seems to be happening WHILE my initialization script is running -- and 
that interference results in my customized boot-up sequence now seeing 
i/o errors with device mmcblk0.


p.s.  [If this problem persists, I'll experiment with allocating my 
mount point elsewhere.  But that means changing a number of scripts -- I 
don't want to make such modifications unless absolutely m=necessary.]

pps.  This is one of the XO-1 systems on which I can get randomly 
occurring "Bad read of .img file" messages while using 'OFW to 
copy-nand' a build image from an USB stick.  The same USB stick works 
well with "non-sensitive" XOs.

More information about the Devel mailing list