View Single Post
pantera1989's Avatar
Posts: 577 | Thanked: 699 times | Joined on Feb 2010 @ Malta
#188
Updated

I updated this tutorial due to various requests.

----------------------------------------------------------------------------------

I have successfully repartitioned the device to increase the home partition how much I want. But I need testers before I submit it to the wiki. If someone feels they can improve this, please do so.

How to increase /home/ size for applications

Why increase the /home/ partition? 2GB is a little bit small for installation. Now more ports of games are coming which take from 100-300 MB. That means only 6 - 20 games will fit maximum.

Why use this method? There is a wiki about how to repartition the device (http://wiki.maemo.org/Repartitioning_the_flash), but not how to specifically decide how much you want in each partition. I did not post this to the wiki because I feel this is an unfinished method.

This is 100% Safe. Remember to backup of course and you will have to reflash. I tested it myself. I have a 5.91GB /home/ partition. If someone with more linux knowledge than me can improve this, please don't be shy. This can be as good as the community does it. I have been running this setup for some months now and I even upgraded to PR 1.3 with no problems. To revert changes you can flash the eMMC image.





Pre-requisites - Rootsh installed, fdisk, flasher-3.5, latest firmware (.bin) and some guts.

If you don't know how to reflash see here:
http://wiki.maemo.org/Updating_the_firmware

I suggest that you save rootsh and fdisk on the root of the microsd card. Quicker this way. Here's a link to the tools: http://www.mediafire.com/file/uyn02m...epartition.zip If you do that first install rootsh normally using the file manager. Then to install fdisk use this code:
Code:
root
mkdir -p /home/user/util-linux /home/user/bin
cd /home/user/util-linux
cp /media/mmc1/util-linux_2.13.1.1-1_armel.deb /home/user/util-linux/
dpkg-deb -x util-linux_2.13.1.1-1_armel.deb root
cp root/sbin/fdisk /home/user/bin/
cd ..
rm -rf util-linux
/home/ and MyDocs use the same chip. So no speed loss will occur here. You have to do this by repartitioning the 32GB flash chip of the N900.

First you need to decrease MyDocs size. You can decrease it as much as you point. 1MB = approximately 32 Blocks. So 32x1024MB = 32768 Blocks for 1GB.

You do the math. Now I wanted a 6GB /home/ and the rest for MyDocs. So I had to split 4GB from MyDocs so that I would have a total of 6GB for /home/ (4 + the existing 2). So I saw the first block occupiet by Partition 2 (home) and did 884866 - 131072. 131072 is approx 4GB.

Start the Process

1. Backup everything. You need to reflash your device after this process. I think that one could make a backup using 'backup menu' and restore it later on. In theory it should work but I have not tried it myself.

2. Obtain fdisk utility

N900 filesystem contains sfdisk utility, but it is a bit inconvenient in my taste. I suggest to use good old fdisk instead, that may be taken from Debian Lenny util-linux armel binary package. Here is how to extract it directly on network-connected N900.

Code:
 mkdir -p /home/user/util-linux /home/user/bin
 cd /home/user/util-linux
 wget http://ftp.de.debian.org/debian/pool/main/u/util-linux/util-linux_2.13.1.1-1_armel.deb
 dpkg-deb -x util-linux_2.13.1.1-1_armel.deb root
 cp root/sbin/fdisk /home/user/bin/
 cd ..
 rm -rf util-linux
This will result in /home/user/bin/fdisk binary available on N900.

3. Alter /dev/mmcblk0 partition table

Now unmount /home/user/MyDocs (as root) using:
Code:
umount /home/user/MyDocs
And open fdisk using:
Code:
/home/user/bin/fdisk /dev/mmcblk0


This is what you have to do next in fdisk:

1. Use 'd' command and then press '1' to delete partition 1;


2. Use 'n' command and type 'p' to choose primary partition. Then type '1' and then for block range type: '2' for the first block and '753793' to recreate primary partition 1 in 2 - 753793 block range. You can change these numbers as you wish. Your numbers for existing partions might not be the same as mine because I already did this process.;


3. Use 't' command, type '1' and then type '76' to set type of partition 1 to 76 (Unknown)


Setting partition type to Unknown will prevent N900 original system from trying to use these partitions on reboot.

Now this process is just before the point of no-return. Are your backups ok? If unsure, you may still quit fdisk without saving and keep your original system by typing 'q'.

To continue, type 'w' command. This will write updated partition table to device. Sorry no image here.

4. Now reboot.
The phone should come up normally but won't recognize MyDocs.

5. Restore MyDocs
To restore MyDocs open fdisk utility using:
Code:
root
/home/user/bin/fdisk /dev/mmcblk0
In fdisk type: 't', and then '1' and then 'c' to restore MyDocs as W95 FAT32 (LBA)


Type 'w' to save.

Then in root type:
Code:
mkfs.vfat /dev/mmcblk0p1
MyDocs now works but is smaller. You can reboot (optional) again to to get MyDocs added to /etc/fstab (that is regenerated at each reboot) with original mount options.

6. Delete /home/ partition.
This is quite risky..but I have found no other solution.

Open fdisk utility once more using:
Code:
root
/home/user/bin/fdisk /dev/mmcblk0
In fdisk:

1. Use 'd' command and then press '2' to delete partition 2;


2. Use 'n' command and then type 'p' to choose primary partition. Then type '2' and then for block range type: '753794' for the first block and '950401' to recreate primary partition 2 in 753794 - 950401 block range. You can change these numbers as you wish. Your numbers for existing partions might not be the same as mine because I already did this process;


3. Use 't' command, type '2' and then type '76' to set type of partition 2 to 76 (Unknown).


Press 'w' to save. Congratulations. You just bricked you device. It's time to reflash .

7. Reflash
Reflash using flasher-3.5 to the latest firmware. Only use the FIASCO image. Flashing the eMMC will result in the usual partitions (which you can use to revert back to original partitioning).

The device should boot up but your /home/ partition doesn't work.

8. Fix /home/

Now install rootsh and fdisk again using and open it using:

Code:
root
/home/user/bin/fdisk /dev/mmcblk0
In fdisk:

Use 't' command, type '2' and then type '83' to set type of partition 2 to 83 (Linux).


Press 'w' to save.

Then do:
Code:
mkfs.ext3 /dev/mmcblk0p2
Reboot.

Now you have 6GB for applications. You can reflash again (optional) to free up about 2MB from rootfs.

------------------------------------------------------------------------------------------------------------------------------------------------------------------------

This is an image after installing many apps and games. It shows 3.46GB of usage, not possible before.



I have been running this setup for quite some time successfully. It is very neccessary in my opinion and I don't know how I'd survive with only 2GB. This tutorial shouldn't contain errors and should be fairly simple. It is 15 - 30mins tops. Goodluck to you.

A big thanks goes to yoush (http://talk.maemo.org/member.php?u=28311) who was a very big help.

Last edited by pantera1989; 2010-11-15 at 23:09.
 

The Following 20 Users Say Thank You to pantera1989 For This Useful Post: