Author Topic: Sd Mount Problems On Boot  (Read 2982 times)

BeKind

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • http://www.seizurerobots.com
Sd Mount Problems On Boot
« on: May 02, 2005, 11:49:01 pm »
OZ 3.5.3.  SL 5500.

I've debugged this as much as I can on my own, and here's what I've come up with:

This happens every time on each 'halt' and each hard reset (battery switch), and every other time (this may be a clue) on 'reboot'.

First the error, then I'll describe "every other time" a little better.

The error manifests itself as missing directories in my /media/card mount point.  Sometimes I get this "ls: /media/card/packages Input/Output error", but all the other directories work fine.  Sometimes I get no directories, even though "mount" shows it as mounted.  If I get the first brand of error, dmesg contains the error "error:  ext2_read_inode unable to read inode_block - inode = 75186, block = 303107."  If the second brand of error happens, there are no unusual messages coming from /etc/sdcontrol in dmesg.

Remounting fixes these problems, except that certain symbolic links (in /usr/lib for instance) go away.  Running ipkg-link mount fixes this.

Now for the definition of "every other time."  If 'reboot' mounted everything correctly, then the next reboot (after a suspend, of course) will cause the error.  If the error manifested itself, then suspending, remounting and 'reboot'ing will never cause the error.

A couple of observations I have made while debugging this:  (this will not be new to many of you, but to me it was, so it might be helpful info to someone else)

1.  If all partitions on your sd are unmounted (including swap) and you suspend or pop the sd out and then back in, it will automatically mount my ext2 partition.

2.  rmmod sharp_mmcsd_m ALWAYS returns device or resource busy.

Now I open it up for outside help.
« Last Edit: May 04, 2005, 06:38:43 pm by BeKind »

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Sd Mount Problems On Boot
« Reply #1 on: May 03, 2005, 07:17:06 am »
Which Zaurus (and which Zaurus kernel)?

Have you run fsck.ext2 on your card?


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

BeKind

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • http://www.seizurerobots.com
Sd Mount Problems On Boot
« Reply #2 on: May 04, 2005, 05:37:32 pm »
OZ 3.5.3

SL-5500

I ran fsck.ext2 and fixed some errors on the card, but the problem happened exactly the same.

Fsck ALWAYS reports that the filesystem has errors and needs checking after a reboot, although it usually doesnt find any problems once the check is run.

Fsck reports the file system is clean, if you haven't rebooted.

Adding the option in fstabs to run fsck on the sd card, won't result in fsck being run at boot like I expected.

I found a work-around.  If I terminate Opie, turn off the swap, suspend, and then reboot or halt, the problem does not occur.  This obviously doesn't help for cases when a hard reset is required.

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Sd Mount Problems On Boot
« Reply #3 on: May 05, 2005, 07:28:25 am »
Oh, so you're running a swap file on the card are you?

As a guess - the card's not being umounted cleanly, hence the corruption. You may need to do some editing of the /etc/apm/ scripts to ensure that swap is turned off before you suspend.


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

BeKind

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • http://www.seizurerobots.com
Sd Mount Problems On Boot
« Reply #4 on: May 05, 2005, 10:15:01 am »
Thanks a lot, Si, I'll give it a look.

I removed /dev/apm_bios from /etc/device_table because of the power button bugs.  Will it still be able to use the /etc/apm scripts?

Now, why is it that certain links (e.g, those in the /usr/lib directory linking to /media/card) disappear when I reboot.  Could that be a repercussion of not unmounting cleanly?

MS3FGX

  • Newbie
  • *
  • Posts: 8
    • View Profile
Sd Mount Problems On Boot
« Reply #5 on: May 07, 2005, 12:37:08 am »
Not unmouting the card cleanly will almost always cause filesytem corruption, including garbled and missing files. It is certainly the cause of your problems, no mystery here.

Your only options are to force an unmount of all SD partitions in the shutdown scripts, or remount the SD partitions as read-only during the shutdown scripts.

Of course, that won't help you in the case of a hard reboot, there is nothing you can do to prevent damage to the FS on the SD in this event.

It sucks, I know. I have the same problems and have just had to learn to live with it.

Make regular backups, and prepare to restore to them fairly often.

BeKind

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • http://www.seizurerobots.com
Sd Mount Problems On Boot
« Reply #6 on: May 11, 2005, 04:31:55 pm »
Thanks for the tips.

I added links to "/etc/init.d/umountfs" to rc0.d and rc6.d and that fixed the problem.  I wonder why these links aren't there as default?  Maybe most people wouldn't use them, but maybe they can't hurt.  I don't know.

Zauruman

  • Newbie
  • *
  • Posts: 28
    • View Profile
Sd Mount Problems On Boot
« Reply #7 on: May 14, 2005, 06:54:48 am »
Quote
Thanks for the tips.

I added links to "/etc/init.d/umountfs" to rc0.d and rc6.d and that fixed the problem.  I wonder why these links aren't there as default?  Maybe most people wouldn't use them, but maybe they can't hurt.  I don't know.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=79319\"][{POST_SNAPBACK}][/a][/div]


Worked for me too - great tip that one. It was getting quite irritating when I accidentally turned it off with the button and had to go through the entire process again.
[span style=\'font-size:8pt;line-height:100%\']Zaurus SL-C750 - PdaXrom RC12
SanDisk 1Gb SD (ext2) - D-Link Air DCF-660W[/span]