Reply
Thread Tools
Posts: 62 | Thanked: 1 time | Joined on Dec 2005
#21
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.
 
Posts: 62 | Thanked: 1 time | Joined on Dec 2005
#22
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
 
Posts: 12 | Thanked: 1 time | Joined on Dec 2005
#23
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-dev...er/002029.html )?

thanks!

alessandro
 
Posts: 62 | Thanked: 1 time | Joined on Dec 2005
#24
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.
 
Posts: 62 | Thanked: 1 time | Joined on Dec 2005
#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-pol...tml#s-sysvinit

Last edited by pdafan; 2006-01-11 at 05:30. Reason: Added warning about not using USB after this mod
 
Posts: 62 | Thanked: 1 time | Joined on Dec 2005
#26
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.
 
Posts: 84 | Thanked: 5 times | Joined on Oct 2005
#27
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 !!!!!
 
Posts: 27 | Thanked: 1 time | Joined on Dec 2005 @ Sweden
#28
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!
 
Posts: 75 | Thanked: 1 time | Joined on Dec 2005
#29
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
 
Posts: 286 | Thanked: 259 times | Joined on Jan 2006 @ Cambridge, England
#30
Originally Posted by pdafan
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
 
Reply


 
Forum Jump


All times are GMT. The time now is 12:27.