maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Upgrading (https://talk.maemo.org/forumdisplay.php?f=8)
-   -   USB storage access after MMC boot (https://talk.maemo.org/showthread.php?t=17689)

rhkuo 2008-03-09 05:34

USB storage access after MMC boot
 
There is an issue related to booting from mmc and USB storage access. After MMC boot and plugging in the USB cable, I would get an error and was not able to access the FAT partitions.

The solution was summarized in this post by fanoush, which involves modifying (as root) /usr/sbin/osso-mmc-umount.sh

However, on my n800 running OS2008, the file actually contained different code. It might be related to the OS2008 version (not sure how to figure this out - if someone could let me know I would appreciate it).

I made similar modifications to the file as follows, changing the second line below. It seems to work fine now.

from:

Code:

if [ $? = 0 ]; then
  umount $MP 2> /dev/null
fi
  RC=$?
else
  # it is not mounted
  RC=0
fi


to:
Code:

if [ $? = 0 ]; then
  if [ "$MP" != "/" ] ; then umount $MP 2> /dev/null ; fi
  RC=$?
else
  # it is not mounted
  RC=0
fi

Hope this helps someone. Thanks to Fanoush for the initial solution.

fanoush 2008-03-09 07:46

Re: USB storage access after MMC boot
 
Yes the script is much simpler in OS2008 but same workaround can be applied.

Just beware to not to write to the partition you boot from over USB too. This is not problem with Windows but many Linux distributions now helpfully automount every partition on the card including the one you boot from so it is very easy to cause data corruption. People solved it by modifying some script on tablet that exports the card over USB so that it only exports specific (the first, FAT) partition instead of whole card. Don't have direct link now, search this forum for more details.

rhkuo 2008-03-09 23:39

Re: USB storage access after MMC boot
 
Fanoush, are you saying that *any* write to the boot partition over USB will cause problems? I am running from Linux desktop -- can one load files directly to Mydocs/.documents? I assumed that only overwriting or modifying the system files would corrupt the partition.

fanoush 2008-03-10 06:56

Re: USB storage access after MMC boot
 
USB storage exports card on block level. If you boot from some partition and mount it from PC over USB too, you have two ext2 filesystem drivers in two independent computers using same device. This is deadly since they will potentially overwrite each other's changes in filesystem structures. This is a big no no. Even just mounting it in read/write mode with no write done by you is dangerous. You should prevent linux system to mount it over usb. If needed, it can be mounted in read-only mode (mount -o ro ....) which may still get bad/old data sometimes but at least will not corrupt filesystem layout.

rhkuo 2008-03-11 14:58

Re: USB storage access after MMC boot
 
Thanks for your explanation, Fanoush. You just saved me from crashing my system!

I managed to find the solution you mentioned, which prevents the Linux desktop from automounting the IT root filesystem. For the record, here's the procedure.

The file to be modified (as root) is: /usr/sbin/osso-usb-mass-storage-enable.sh

1. add "DEVICE=${1}p1" at the beginning of the file after the comments.

2. replace all occurences of "$1" (about 5 of them) with "$DEVICE"

The solution was found here.

Laughing Man 2008-05-03 18:36

Re: USB storage access after MMC boot
 
The linked blogger post no longer exists. I assume however, you do not need the " "s since they are only used to identify what you need to enter seperate from your post rhkuo?

cheve 2008-05-04 03:01

Re: USB storage access after MMC boot
 
Quote:

Originally Posted by Laughing Man (Post 177582)
The linked blogger post no longer exists. .....


Click the link and then shorten the address to http://tabletoid.blogspot.com and then select link "finally got a clean way..." at the right under the BLOG Archive '2008 / Jan '. That's how I locate the article, good luck.

davos1 2008-05-04 11:07

Re: USB storage access after MMC boot
 
Don't worry the link doesn't work because there is a . after the .html. Here is a good one: http://tabletoid.blogspot.com/2008/0...boot-from.html

Laughing Man 2008-05-05 03:19

Re: USB storage access after MMC boot
 
Odd, I've tried both and whenever I plug in my USB cable it just says both cards are unaccessible now.

codeMonkey 2008-07-03 15:14

Re: USB storage access after MMC boot
 
Quote:

Originally Posted by Laughing Man (Post 177989)
Odd, I've tried both and whenever I plug in my USB cable it just says both cards are unaccessible now.

I found that this happened to me when I made a typo in the script. Works fine for me on n800, OS2008 diablo.


All times are GMT. The time now is 16:15.

vBulletin® Version 3.8.8