PDA

View Full Version : 770 no longer mounts RS-MMC card


Milhouse
2005-12-06, 22:42
Just playing with some videos on my 770 and while swapping the RS-MMC card (1GB) it failed to mount in the 770. This card works fine in a PC memory card reader (and has done since I got my 770 on Nov 6).

I tried to mount the bundled Nokia 64Mb DV RS-MMC card and that fails to be recognised as well. Have reformatted my 1GB card to be sure it wasn't corrupt, but it made no difference.

I have rebooted and also power cycled (removed battery) the 770 several times, all to no avail.

Anyone got any ideas? Has my 770 developed a faulty MMC socket? :(

Milhouse
2005-12-06, 22:51
Forget this post - I just discovered you have to close the door on the MMC slot before the card is recognised... argggghhh! :) :o :o :o

Hedgecore
2005-12-06, 23:40
Thanks for posting the 'solution'... I can guarantee you that when I get mine, it would've been me posting (I think things look much cooler when you can see their insides) :rolleyes:

daf
2005-12-11, 15:30
i can't access to my mmc card anymore... it say : "no memory card inserted"
please someone help me ! :)

daf
2005-12-11, 19:13
the mmc partition is wrong, i can make a partition with mkfs.vfat -F 32 /dev/mmcblk0
i can mount this partition but it isn't recognised in the nokia 770 file manager...
i can't mount partition via usb, it say there is no card...

the default partition is /dev/mmcblk0p1 so i think there is a primary partition created with fdisk. But there is no fdisk on nokia 770 :'(
What can i do ?

andymulhearn
2005-12-11, 19:21
daf,

have you tried using a card reader on windows and formatting it there, either from the command line or explorer? Then try it in the 770.

daf
2005-12-11, 19:39
i don't have card reader unfortunately...

daf
2005-12-11, 20:06
i found fdisk for nokia 770 here : http://repository.maemo.org/pool/maemo/ossw/u/util-linux/util-linux_2.12-7osso2_arm.deb
i have installed it with root on xterm : dpkg -x util*.deb /
and now i have fdisk :)
i repair the mmc partition with fdisk (type n p 1 enter enter w) and created my fat with mkfs.vfat -F 32 :)
now, i will try to have a swap partition to have more memory for the nokia 770 :)

mk500
2005-12-11, 20:23
i found fdisk for nokia 770 here : http://repository.maemo.org/pool/maemo/ossw/u/util-linux/util-linux_2.12-7osso2_arm.deb
i have installed it with root on xterm : dpkg -x util*.deb /
and now i have fdisk :)
i repair the mmc partition with fdisk (type n p 1 enter enter w) and created my fat with mkfs.vfat -F 32 :)
now, i will try to have a swap partition to have more memory for the nokia 770 :)

If you get the swap working, could you please post a walk-through of the commands you used? I think a swap partition could make a HUGE difference on this device (and probably clear up a lot of the problems people are having), but I haven't seen anyone post about being successful in setting one up yet.

daf
2005-12-11, 20:28
i create a swap partition, i activate it but the nokia didn't use the swap...
i still search for this because i know this could be good :)

andymulhearn
2005-12-11, 21:43
i create a swap partition, i activate it but the nokia didn't use the swap...
i still search for this because i know this could be good :)

Bummer about the reader :(

Did you something like mkswap and swapon?

I tried this with a swap file and got a security problem at the swapon stage...

As mk500 says, a step-by-step list of instructions would be much appreciated.

daf
2005-12-11, 21:48
i create a swap partition on mmc with fdisk (type Linux swap)
i use mkswap to create swap on this partition
i use swapon on this partition
and it's not working...

we must search another way... i didn't know why it doesn't work...
maybe some maemo developer could see this and give us the solution :D

daf
2005-12-11, 23:35
i found on mailing list this :
http://maemo.org/pipermail/maemo-developers/2005-December/002029.html
launch theses commands as root :
dd if=/dev/zero of=/media/mmc1/extraswap bs=1024 count=16384
(you must wait a lot for this....)
mkswap /media/mmc1/extraswap 16384
swapon /media/mmc1/extraswap
and it works :)

i open a lot of window of internet pdf video etc and here is my free memory :
/home/user # free
total used free shared buffers
Mem: 61828 60376 1452 0 20
Swap: 16376 12696 3680
Total: 78204 73072 5132

i've try with 32768 but the nokia reboot... 16Mo more are very good for the nokia :) but if we can add more...
i think we must add swapon on the startup of the nokia if we want to have it always but i want to test more before doing this...

PS : if you swapoff, it bug and if you plug usb, it bug (when you plug usb, the mmc card is umount...)

bradb
2005-12-12, 01:42
daf-

Great work - both the find of the mailing list post (I did a search but failed to read all the articles) as well as the cfdisk package (I'd found the source package but ignored it because of the utf8 references - I didn't think there would be other useful bits).

I was excited to post that I'd gotten swap working but I see I'm a bit late.

This is much easier than what I did: I partitioned my MMC into a 32MB swap and 32MB ext2fs and am in the process of mounting it at /var/lib/install so all packages get installed on the MMC.

I saw a few odd things at first - the box reported no free memory right after I did a swapon and it shutdown once. You said you had problems with 32MB as well?

I'm not sure I've done everything correctly though - my configuration looks like this:

/home/user # cat /etc/fstab
rootfs / rootfs defaults,errors=remount-ro,noatime 0 0
/dev/mmcblk0p1 none swap sw 0 0
/dev/mmcblk0p2 /brad ext3 defaults 0 0

/home/user # fdisk -l /dev/mmcblk0

Disk /dev/mmcblk0: 64 MB, 64225280 bytes
4 heads, 32 sectors/track, 980 cylinders
Units = cylinders of 128 * 512 = 65536 bytes

Device Boot Start End Blocks Id System
/dev/mmcblk0p1 1 488 31216 82 Linux swap
/dev/mmcblk0p2 489 980 31488 83 Linux

I still need to add 'swapon /dev/mmcblk0p1' somewhere though, and sort out why I have to manually mount my ext2fs file system but otherwise... I'm getting there :-)

bradb
2005-12-12, 02:59
daf-

Well, it worked before but I'm going to try and stick with a 16MB swap now - I hacked the startup sequence to issue a swapon before it mounted my ext2fs partition and the result....well... let's say I now have the pleasure of redoing everything again from scratch.

So I'm going to try and keep better notes :-)

daf
2005-12-12, 20:00
i don't know why nokia bug when i swapon a 32Mo directly but i've found a solution to fix this problem. I have created a 1Mo swap, swapon on this 1Mo, after swapon on a 32Mo swap file and swapoff the 1Mo swap file and it's working well...
for example, my free mem is now :
free
total used free shared buffers
Mem: 61828 60412 1416 0 16
Swap: 32760 23896 8864
Total: 94588 84308 10280

I will buy a 1Go RS-MMC and test with larger swap after...
i will just add this to the startup i think :
swapon /media/mmc1/1Mo
swapon /media/mmc1/swap
swapoff /media/mmc1/1Mo
with some tests i think...

bradb
2005-12-12, 23:58
daf-

Until I can get a bigger card I'm going to use 24MB of swap (thanks for the workaround on 32MB, I'll be interested in your results).

I'm pretty sure I know the commands to use I'm just not sure where to put them in the startup.... I've tried /etc/rc2.d/S20bradshack (as well as S99bradshack) but I'm not sure what's correct. That's why the script is named 'hack'.

daf
2005-12-14, 10:12
swapon /media/mmc1/1Mo
swapon /media/mmc1/swap
swapoff /media/mmc1/1Mo

between the two swapon, we must wait or it doesn't work...

putkowski
2005-12-15, 01:22
daf-

Until I can get a bigger card I'm going to use 24MB of swap (thanks for the workaround on 32MB, I'll be interested in your results).

I'm pretty sure I know the commands to use I'm just not sure where to put them in the startup.... I've tried /etc/rc2.d/S20bradshack (as well as S99bradshack) but I'm not sure what's correct. That's why the script is named 'hack'.

Hey Brad,

There should be an rc.local... (I'm charging now, so I can't check..) This is run after the "other" scripts for that runlevel.

now here's now it's supposed to work:

It's call Sys V init for the unix loins from which it sprang. There are several "runlevels." The default "runlevel" is in /etc/inittab as are the scripts/directories to run when the machine comes up in that "runlevel"

example runlevels:

1 - single user command prompt only - great for fixing things when graphics get broken.
2 - single user with X
5 - full multiuser with X
6 - shut your *** down (when a linux box is "shutdown" with the "shutdown" command, another command called telinit is issued, specifically "telinit 6" this tells the kernel to switch to runlevel 6 - shutdown...


init.d (directory) has the actual scripts

rc(x).d have links (shortcuts) to the script in init.d
the number allows some startups to run before others... your inclination to use 99 is right.

so different rc(x).d folders can start different "services" based-on the needs of the "runlevel." They are processed numerically by their links (shortcuts.)

Sorry if you already knew this. All these folders (and most other interesting things) are in the /etc directory.

Paul

bradb
2005-12-15, 03:54
Paul-

Well put. I actually didn't ask the right question, but you helped :-)

I was really wondering how soon in the boot process I should stuff my changes - and in general, S99 is right. But in my (unstated) case:

1. I was tinkering with mounting over /var/lib/install, and I saw that the dropbear ssh server runs at S20. I've found that creating a symbolic link to a directory that isn't mounted yet is a quick trip to a restore.

So, I needed to wedge in and S20bradhack worked well for that - at least for this application. Of course I've now decided that I'd rather mount over /home, but that's another thread ;-)

2. Mounting swap - I'd think you'd want to do it as soon as possible, right? I ended up doing that at S20, since it seemed safe. Or do you think thats bad? (and again, due to what I've been told, I'm not sure swapping to the MMC is a good idea - at least for expensive MMC cards).

pdafan
2006-01-04, 05:55
I have recently repartitioned my original 64MB RSMMC card per the instructions
in various posts. Here is what I did:

To partition MMC card:

- Make sure nothing is accessing the MMC
- Plug in USB cable
(it will now be visible to your linux host)
- On linux: fdisk /dev/sda
- Proceed to partition the MMC. I did:
First 40MB = type Linux (0x83)
Last 24MB = type Linux Swap (0x82)

- Save the partition table.

- On linux: mkswap /dev/sda2 (the 24MB partition)
- On linux: mkfs -t ext3 /dev/sda1 (the 40MB partition)

Change /etc/fstab on 770 to look like this:

rootfs / rootfs defaults,errors=remount-ro,noatime 0 0
# ext3 partition
/dev/mmcblk0p1 /media/mmc1 ext3 defaults 0 0
# swap partition, 24MB
/dev/mmcblk0p2 none swap sw 0 0


This is all fine, and I can now manually mount the ext3 partition. However,
there are the following problems:
1) This partition is no longer automounted (others have seen this as well)
2) The "Memory card" link in File Manager, and all file requesters, is no longer
visible! This is no problem for the FM since I don't use it anyway, but I would like to download onto the MMC from websites when I select a file link.
3) By default the 'user' could not write to the new partition for some reason. I had to chown user /media/mmc1, and that fixed it.

If anyone figures out how to fix the automount problem and especially the invisible card problem, please reply! I won't bother with partitioning my new 1G card until all these mounting problems are solved.

pdafan
2006-01-04, 06:21
Followup on last post: the same thing happens even if I change the type to ext2,
ie. File Manager does not show the card.

However, this time I can have more options in the /etc/fstab whereas ext3 would
only accept 'defaults':

/dev/mmcblk0p1 /media/mmc1 ext2 rw,noauto,nodev,noexec,nosuid 0 0

alexxx
2006-01-04, 08:22
It seems to me that the problem (swap on MMC) is still not completely unsolved.

Anyway, since I'm a newbie, could somebody at least suggest the differences there could be between going for swap on a MMC partition (as described in this thread), and going for swap on a file (as described here: http://maemo.org/pipermail/maemo-developers/2005-December/002029.html )?

thanks!

alessandro

pdafan
2006-01-04, 23:17
I've played with this some more, and having created the soft link
in the MyDocs directory, I am at least satisfied that I can get
access to the flash card despite the efforts of the File Manager.

However, I seem to have some kind of file access problem from the "Images" application. If I store a photo on the ext2 partition, I can see it in the preview pane, but it won't actually load - I get an error "No Images".

I thought that it might be related to the ext2 partition itself, so I created a new VFAT partition and tried the same thing there. Same error!

The picture (a .jpg) still loads from the internal flash when I try to read it out of /home/user. In addition I can 'cd' to the ext2 partition in xterm and dump the file, so I don't think it's a pure R/W permissions problem. It seems to be inherent to the Images app itself.

Anyone else seen this behaviour?

Thanks.

pdafan
2006-01-05, 15:25
I'm using a Kingston 1G DV MMC Mobile card. Here is how I migrated my /home/user
data to the card and set up swap. Assumptions:

- you have root on the 770
(see here to gain root:
http://maemo.org/maemowiki/HowDoiBecomeRoot
Windows users, first download linux from here and burn it onto a CD to try this method:
http://www.knoppix.org/)

- vim installed. Download: http://www.bleb.org/software/770/#vim

- xterm installed. Download: http://770.fs-security.com/xterm/

- It helps to have SSH in place too for easier editing

- a linux box for partitioning the card, but there are other ways; search this site for alternatives. Windows users can download and burn a Knoppix CD and try it that way instead of installing linux: http://www.knoppix.org

Notes:
- In this file, "#" means you are performing an action as root!
- You can vary the number and size of the partitions to your liking. This is only an example.
- You can mess up your 770 if you don't know what you are doing. At the worst you will have to reflash.

Create init script for mounts, swap
-----------------------------------
(770)
# vi /etc/init.d/mountmmc

(script) (pretty print this to your liking, it got messed up with my cut'n'paste)

-------------------- cut here -------------------------

#!/bin/sh
#
# Mount MMC partitions at boot, manage swap on MMC
#

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

case "$1" in
start)
echo -n "Mounting MMC partitions, turning on swap..."
mount /media/mmc1
mount /media/mmc2
swapon /dev/mmcblk0p3
echo "done."
;;
stop)
echo -n "Unmounting MMC partitions, turn off swap..."
umount /media/mmc1
umount /media/mmc2
swapoff /dev/mmcblk0p3
echo "done."
;;
force-reload|restart)
echo -n "Remounting MMC partitions..."
umount /media/mmc1
umount /media/mmc2
mount /media/mmc1
mount /media/mmc2
echo "done."
;;
*)
echo "Usage: /etc/init.d/mountmmc {start|stop|restart|force-reload}"
exit 1
;;
esac
exit 0

-------------------- cut here -----------------------------

# cd /etc/rc2.d
# ln -s ../init.d/mountmmc S90mountmmc
# cd /etc/rc6.d
# ln -s ../init.d/mountmmc K01mountmmc

(note: I start mountmmc toward the end of RC2, but I don't know when the correct time really is. S90 works, S28 produced tiny fonts in the Power Button menu.)

Partition card
--------------
(770)
- Make sure you are not using /media/mmc*
- Plug in USB cable

(linux box)
# fdisk /dev/sda
- Create partition table. In the end it should look something like this:
(740MB for user, 256MB for apps, two 24MB partitions for swap - one is spare)
(NOTE: the user partition must be bootable for it to appear in the File Manager!
This way you still see the "Memory card" link)
Command (m for help): p

Disk /dev/sda: 1043 MB, 1043857408 bytes
10 heads, 41 sectors/track, 4972 cylinders
Units = cylinders of 410 * 512 = 209920 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 3526 722809+ 83 Linux
/dev/sda2 3527 4747 250305 83 Linux
/dev/sda3 4748 4862 23575 82 Linux swap
/dev/sda4 4863 4972 22550 82 Linux swap


# mkfs -t ext3 /dev/sda1
# mkfs -t ext3 /dev/sda2
# mkswap /dev/sda3
# mkswap /dev/sda4

(unplug the USB at this point and reboot the 770 - otherwise the
new partitions may not be properly visible)


Update /etc/fstab
-----------------
(770)
# vi /etc/fstab

(here is the file)
# Root file system located in internal flash
rootfs / rootfs defaults,errors=remount-ro,noatime 0 0

# First ext3 partition, 740MB for home
/dev/mmcblk0p1 /media/mmc1 ext3 defaults 0 0

# Second ext3 partition, 256MB for apps
/dev/mmcblk0p2 /media/mmc2 ext3 defaults 0 0

# Primary swap partition, 24MB
/dev/mmcblk0p3 none swap sw 0 0

# Backup swap partition, 24MB
/dev/mmcblk0p4 none swap sw 0 0



Create mount point for /home/user directory
-------------------------------------------
(770)
(This is needed because the default permissions after running fdisk on my
linux box won't allow 'user' to write to the directories)
# cd /media
# mkdir mmc1
# mkdir mmc2
# chmod 750 mmc1
# chmod 750 mmc2
# chown user mmc1
# chown user mmc2
# chgrp users mmc1
# chgrp users mmc2

(at this point you are ready to test the init script like this:
# /etc/init.d/mountmmc start
# /etc/init.d/mountmmc stop
# /etc/init.d/mountmmc start
(Run lots of applications after starting it to make sure your new
swap is working. Don't make a huge swap, 32MB will cause crashes as others
have also seen)

Move user data over to mmc card
-------------------------------
(770)
# cd /media
# mkdir mmc1/users
# cd mmc1
# chmod 750 user
# chown user user
# chgrp users user
# cd /home
# tar -cvf user.tar user/
# cd /media/mmc1
# tar -xvf /home/user.tar
# rm /home/user.tar

Remove old user data dir
------------------------
(770)
# cd /home
(make sure you are not using /home/user at the moment)
# mv user _user
(Later you can # rm -rf user once things are working)
# ln -s /media/mmc1/user user


That's it! So far even the troublesome 'Image' application is behaving well and doesn't seem to know it's reading the files from the MMC. It is best to reboot after these changes.

I haven't yet moved /var/lib/install over, but I think my approach will be similar to what I did with /home/user. If anyone has thoughts on this, please post a reply.

Updates:
1) Remember, you must not use the USB again unless you have first unmounted the new partitions and also turned off swap! Strange things will happen otherwise.
2) I am no longer using this exact setup. For the most part it is still the same, with swap enabled and with a large ext3 partition, except I no longer have my /home/user mounted on the flash card. Instead, I created a link from ~/MyDocs/flash to /media/mmc1. My machine has been stable with the swap and ext3.

Best regards,

- Ari

References:
http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit

pdafan
2006-01-08, 05:43
This setup was stable for about a week. After experimenting with the correct time to mount the drive during the startup process, my 770 got the dreaded "reboot forever" disease and I had to reflash it. I'm probably going to give up on mounting the /home/user dir on flash and just settle for the swap partition for now.

philmcneal
2006-01-08, 06:30
the first command works, and i see the swap file in the mmc card. but when i try to do the mkswap and swapon commands i always get a 'not found' error.


Help !!!!!

fresta
2006-01-09, 19:21
I followed your instructions and installed a 24 MB swap on my 1 GB mmc, with the rest as one ext3 partition. I did not move the home dir or create an application partition since I don't feel the need (yet). Works wonderfully!

The only glitch was that I had to reboot for the file manager to access the memory card. Also, remember to change ownership to user:users.

Thanks for the excellent instructions!

myet01
2006-01-09, 20:34
For us idiots (me included) it would be nice if someone would put all of this in a neat little package (One document) someplace to include:

a - What other applications are needed.
b - Where to get those applications.
c - How to setup those applications.
d - How to setup this file.
e - And put everything in Laymans terms.
f - Or, write a script that you could run and it would setup everything for you!

Just a thought for us windows folks....

Thanks,

Tony

richie
2006-01-10, 20:31
This setup was stable for about a week. After experimenting with the correct time to mount the drive during the startup process, my 770 got the dreaded "reboot forever" disease and I had to reflash it. I'm probably going to give up on mounting the /home/user dir on flash and just settle for the swap partition for now.

Hi

Running home/ on rs-mmc sounds cool, do you reckon the reboot could be a coincidence? Has anyone else had any success running home on the rs-mmc?

thanks
Richie

pdafan
2006-01-11, 05:33
For us idiots (me included) it would be nice if someone would put all of this in a neat little package (One document) someplace to include:

a - What other applications are needed.
b - Where to get those applications.
c - How to setup those applications.
d - How to setup this file.
e - And put everything in Laymans terms.
f - Or, write a script that you could run and it would setup everything for you!

Just a thought for us windows folks....

Thanks,

Tony

I edited the file to include some links. Spend some time searching the forums in this site to gain an understanding of what you are going to do before you try it. You can download Knoppix linux from here and burn it to a CD if you don't have linux installed somewhere: http://www.knoppix.org

pdafan
2006-01-11, 05:41
Hi

Running home/ on rs-mmc sounds cool, do you reckon the reboot could be a coincidence? Has anyone else had any success running home on the rs-mmc?

thanks
Richie

I don't know why my machine rebooted! As I think I mentioned elsewhere, my application installer crashed when I was installing GPE PIM and after that the machine was never the same again. I had to reflash the machine and after that I went to a reduced partition setup. I had no problems with /home/user on flash for many days at first.

Right now I have a large ext3 partition on the flash card (975MB) and a 24MB swap file. The machine runs great, mounts the ext3 partition at boot time and the flash disk is visible under "Memory Card" in the file manager and all file requestors. I left /home/user in internal memory for now, but store all my files on the flash card (eg. pics, mp3 etc.)

The OS is still somewhat unstable and so are the apps (browser, app installer, etc.) There will be better OS updates in the future so I figured it wasn't time to customize things too much just yet.

fresta
2006-01-28, 00:06
For some reason swap didn't get activated at boot with this method, I had to do it manually. I removed the mountmmc script and used the method described in the wiki (http://maemo.org/maemowiki/ExtendedRootFilesystem) instead. Simply run the following as root on the Nokia 770:
# sed -i '/exit/iswapon -a 2>/dev/null' /etc/init.d/minircS
# sed -i '/umount/iswapoff -a 2>/dev/null' /etc/init.d/minireboot /etc/init.d/minishutdown
That takes care of swap. I use fat16 for the other partition so that works without changes. But note that the fat16 partition has to be the first partition created, it is not sufficient to put it first on the disk.