Handhelds.org - Open source for handheld devices

UserPreferences

HowToMountExtraPartition


Mounting the extra Flash in some iPAQs

 ~# cat /proc/mtd
 dev:    size   erasesize  name
 mtd0: 00040000 00040000 "bootldr"
 mtd1: 01fc0000 00040000 "root"
 mtd2: 00fc0000 00040000 "second H3XXX root jffs2"
 mtd3: 00040000 00040000 "second asset"
 ~# unlock /dev/mtd/2
 ~# eraseall /dev/mtd/2
 ~# mount -t jffs2 /dev/mtdblock/2 /mnt/bank2/
The /mnt/bank2 diretory was created first. Do df to check if everything is right, and change /etc/fstab if you want changes to be saved or mounted at boot time.

- NB: you will need the mtd-tools package for this, which isn't included in familiar 0.7.2 by default: http://ipkgfind.handhelds.org/details.phtml?package=mtd-utils - I also had to manually modprobe mtdchar, and mknod /dev/mtd0 c 90 0 ; mknod /dev/mtd1 c 90 1, etc aswell - Wes In newer images the package is called 'mtd' -koen eraseall did not work on my IPAQ 3970: it failed with "invalid ioctl". There are alternative instructions for using the extra partition at ExtraMb, they worked for me. -PatrickOhly

pay attention to the nodes in mknod:

/dev/mtd:
drwxr-xr-x    1 root     root            0 Jan  1  1970 .
drwxr-xr-x    1 root     root            0 Jan  1  1970 ..
crw-rw-rw-    1 root     root      90,   0 Jan  1  1970 0
cr--r--r--    1 root     root      90,   1 Jan  1  1970 0ro
crw-rw-rw-    1 root     root      90,   2 Jan  1  1970 1
cr--r--r--    1 root     root      90,   3 Jan  1  1970 1ro
crw-rw-rw-    1 root     root      90,   4 Jan  1  1970 2
cr--r--r--    1 root     root      90,   5 Jan  1  1970 2ro
crw-rw-rw-    1 root     root      90,   6 Jan  1  1970 3
cr--r--r--    1 root     root      90,   7 Jan  1  1970 3ro

/dev/mtdblock:
drwxr-xr-x    1 root     root            0 Jan  1  1970 .
drwxr-xr-x    1 root     root            0 Jan  1  1970 ..
brw-rw-rw-    1 root     root      31,   0 Jan  1  1970 0
brw-rw-rw-    1 root     root      31,   1 Jan  1  1970 1
brw-rw-rw-    1 root     root      31,   2 Jan  1  1970 2
brw-rw-rw-    1 root     root      31,   3 Jan  1  1970 3

- NB2: mount -t jfss2 /dev/mtdblock/2 /mnt/bank2/ do not work for me but:

-Pierre


Whith new image v0.8 these instructions have to be upgraded.

To mount the extra ROM (for example as /usr/local):

Install the mtd package with the command:

~# ipkg install mtd
Create the mount point:
~# mkdir /usr/local
Load the mtd interface module:
~# modprobe mtdchar
Unlock the ROM to be written:
~# flash_unlock /dev/mtd/2
Erase the ROM:
~# flash_eraseall /dev/mtd/2
Mount the device in the mountpoint:
~# mount /dev/mtdblock/2 /usr/local
Verify it all went well with df:
~# df
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/root                32512     26500      6012  82% /
/dev/mmc/part1           61922     26310     35612  42% /mnt/card
/dev/mtdblock/2          16128      1028     15100   6% /usr/local
tmpfs                    64092        44     64048   0% /var
tmpfs                    64092         0     64092   0% /mnt/ram
And now, if you want to get the ROM mounted each reboot, yuou have to add the mount line in the /etc/fstab file, for example wth the command:
~# echo /dev/mtdblock/2 /usr/local      jffs2   defaults        1  1 >> /etc/fstab
As the mtdchar module is needed only to unlock and clear the ROM, it is not needed to get it loaded at every boot, adding a file in /etc/modutils.

- Stefano