OESF Portables Forum
Everything Else => Zaurus Distro Support and Discussion => Distros, Development, and Model Specific Forums => Archived Forums => Angstrom & OpenZaurus => Topic started by: BeKind 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.
-
Which Zaurus (and which Zaurus kernel)?
Have you run fsck.ext2 on your card?
Si
-
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.
-
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
-
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?
-
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.
-
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.
-
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.