maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Upgrading (https://talk.maemo.org/forumdisplay.php?f=8)
-   -   How to upgrade the internal memory by extending the root filesystem to a memory card (https://talk.maemo.org/showthread.php?t=1165)

cantona 2006-02-02 02:28

It worked! THANK YOU ALL! I could not have done it without your help!

Wolfram Ravenwolf 2006-02-02 21:37

Since partitioning the memory card is the hardest step in extending the root filesystem, I'm trying to automate this process as well. Here's my first attempt. You'll require the "sfdisk" program which is part of the "util-linux" Ubuntu package (installed by default!) but probably available for other GNU/Linux distributions as well.

Connect the Nokia 770 to your Linux computer. Make sure the memory card's partition is auto-deteced but not mounted. If it's auto-mounted, unmount it. I'll use /dev/sda to refer to the memory card, but if it's a different device on your system, substitute it accordingly.

Code:

sfdisk /dev/sda -uM << EOF
,64,6
;
EOF
mkfs.vfat /dev/sda1
mkfs.ext3 /dev/sda2

With this set of commands (run as root - I recommend copy & paste!) you repartition the memory card (/dev/sda) so there's a 64 MB VFAT partition and the rest of the card space is allocated to the Extended Root Filesystem.

Please give this a try and report back how it worked for you - then I'll add it to the HOWTO.

Xyzo 2006-02-03 07:41

Step 1: advices request
 
Hi!
Thank you very much Wolfram for this step-by-step howto :-)
Yesterday I've received and configured my 1GB MMC-Mobile card: I think I've done it well as the system works but I'm not exactly sure whether what I've done at step 1 was right or not. See below.
I've used fdisk (on FC4) to partition the RSMMC card. Out of the box, it was shown as FAT16 by fdisk (type 6). In your tutorial, you mentioned VFAT: what does this exactly mean as I was not able to find it in supported formats by fdisk? Someone told me that formats specified by fdisk were just here for information, but the real partition type depends on what you use to format each partition: right? Well, I've removed the existing partition and created 2 brand new partitions using the original format (ie. FAT16). After this, the 1st partition (768MB, to be mounted on host when USB connecting the N770) has been formated using mkfs.vfat, and the 2nd partition (256MB, to be used for swap and extension of root filesystem) using mkfs.ext3: was all of this right? When I display the partition table using fdisk, the 2 partitions are still displayed as FAT16: should I simply ignore this?
TIA for your help!

Wolfram Ravenwolf 2006-02-03 08:15

Quote:

Originally Posted by Xyzo
I've used fdisk (on FC4) to partition the RSMMC card. Out of the box, it was shown as FAT16 by fdisk (type 6). In your tutorial, you mentioned VFAT: what does this exactly mean as I was not able to find it in supported formats by fdisk? Someone told me that formats specified by fdisk were just here for information, but the real partition type depends on what you use to format each partition: right?

Right! That's exactly the way it is. In the code posted above, the second line says ",64,6". "64" is the size in megabytes and "6" refers to the partition type FAT16. It becomes a VFAT filesystem once it's formatted with "mkfs.vfat".

Quote:

Originally Posted by Xyzo
Well, I've removed the existing partition and created 2 brand new partitions using the original format (ie. FAT16). After this, the 1st partition (768MB, to be mounted on host when USB connecting the N770) has been formated using mkfs.vfat, and the 2nd partition (256MB, to be used for swap and extension of root filesystem) using mkfs.ext3: was all of this right? When I display the partition table using fdisk, the 2 partitions are still displayed as FAT16: should I simply ignore this?

The second partition should be of type 83. You should be able to change it without destroying the partition. If you don't want to risk anything, you won't have to change it if it's working anyways, though.

Wolfram Ravenwolf 2006-02-03 21:35

extrootfs_1.0_arm.deb
 
To make it even easier, I've created a Maemo installer package: extrootfs_1.0_arm.deb

It bundles the script which creates the Extended Root Filesystem with utilities for partitioning and formatting the memory card (cfdisk, mke2fs, mkfs.ext2, mkfs.ext3, sfdisk). It's never been easier to extend the Nokia 770's root filesystem onto the memory card. Now you can repartition and reformat from within the device. I've also updated the HOWTO since the old Root.sh script has been deprecated and replaced with this release. Simply install the package and you've got everything you need to set it up.

Setup has become so simple:
Code:

sudo gainroot
umount /media/mmc1
/var/lib/install/sbin/cfdisk /dev/mmcblk0
mkfs.vfat /dev/mmcblk0p1
shutdown -r now

sudo gainroot
/var/lib/install/sbin/mkfs.ext3 /dev/mmcblk0p2
/var/lib/install/sbin/extrootfs

If you've already used the Root.sh shell script to set it up, you don't really need the package, but you can install it anyway. It's fully compatible. Just use /var/lib/install/sbin/extrootfs instead of the Root.sh script from now on.

By the way, "sfdisk" is included, too - so you can try that with the info I posed above instead of using "cfdisk" for automatic partitioning.

RogerS 2006-02-03 22:28

Wow. This is really something.

Thank you, Wolfram (or should we say, Thank you, Stefan Daniel?)

bahtaraigi 2006-02-03 22:48

Hi,

I get an error message in cfdisk when running:

/var/lib/install/sbin/cfdisk /dev/mmcblk0

FATAL ERROR: Bad primary partition 0: Partition ends in the final partial cylinder

I have root access, and mmc card is unmounted.

Any ideas?

bahtaraigi 2006-02-03 23:04

Never mind...I formatted it in ubuntu instead. :D

mk500 2006-02-05 09:25

Is there a command that lets you see how much swap is being used? I'm trying to guage the effects now that I've set up swap with swapon.

Jus 2006-02-05 11:28

the command free will show memory usage.


All times are GMT. The time now is 07:47.

vBulletin® Version 3.8.8