maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   Repartition the internal drive (https://talk.maemo.org/showthread.php?t=35122)

白い熊 2010-02-09 08:31

Re: Repartition the internal drive
 
Hahah, this is the first time I hear of GNU Stow...

Let me inspect, hope it doesn't work the same way as my infrastructure, lest I've wasted tons of time designing and working out this "incredible" :) system for nothing, only to reinvent the wheel.

ruskie 2010-02-09 08:33

Re: Repartition the internal drive
 
Ehh nothing wrong with reinventing the wheel. Apparently Nokia loves to do it as well ;)

白い熊 2010-02-09 08:55

Re: Repartition the internal drive
 
OK, fortunately GNU Stow is not very potent as it actually just symlinks all the stuff into root etc., that's no good, and it requires admin privileges.

So my solution is more elegant and better, as it doesn't mess with the base system at all and is more flexible, phew... :)

ruskie 2010-02-09 08:58

Re: Repartition the internal drive
 
There's a few other systems like this as well. Some of which work on both user and system level(I think Stow does as well)

titan 2010-02-09 22:00

Re: Repartition the internal drive
 
stow works for user level as well (-d and -t options).
A while ago I had also started a fork of stow called optstow to set the defaults
to /opt and /opt/maemo and fix a design issue of stow:
it symlinks the shared directories like share/man if they don't exist
in the /opt/maemo yet -> the symlinks of all subsequently installed packages
are stored in the directory of the first package. So I was planning to filter common
directories and to create instead of symlinking them.

j.s 2010-02-09 22:21

Re: Repartition the internal drive
 
Quote:

Originally Posted by ruskie (Post 517273)
Well found some new limitation. Maemo5 expects /usr available early init(/sbin/preinit relies on it). So if you do offload /usr and then rm the old /usr your device will stop booting up.

I guess I'll modify my script to use /usr/local for storage now.

Why not /opt/something/bin and reserve /usr/local for truly local?

ruskie 2010-02-09 22:23

Re: Repartition the internal drive
 
Because /opt is NOT meant for that. I wish people would actually read the FHS sometime(and no don't plan on going into the FHS arguments anymore... read it or not... I don't care)

And /usr/local is fine for this certainly better than /opt

Can't wait for some SANE distro to become available on the device.

ruskie 2010-02-10 06:15

Re: Repartition the internal drive
 
j.s. sorry for that outburst. Spillover from another thread and me being tired(and yes for me that qualifies as an outburst).

javispedro 2010-02-10 12:15

Re: Repartition the internal drive
 
Quote:

Originally Posted by 白い熊 (Post 517371)
lest I've wasted tons of time designing and working out this "incredible" :) system for nothing, only to reinvent the wheel.

Have you read of Gobolinux in user mode?

白い熊 2010-02-10 13:48

Re: Repartition the internal drive
 
Yeah, that was one of the starting points, that got me thinking. Gobolinux's file system structure, which is a bit strange IMO, aside, the thing is Gobolinux is a distribution.

However, I've arrived at a solution enabling you to implement it on top of any distribution, for any architecture. I.e. try installing Gobolinux on the N900? Possible?

titan 2010-02-10 13:54

Re: Repartition the internal drive
 
macports uses a similar approach and I like it
Quote:

Originally Posted by javispedro (Post 519256)
Have you read of Gobolinux in user mode?


dthoaforum 2010-02-13 21:27

Re: Repartition the internal drive
 
Sorry for nood question. Follow the guide of 白い熊, We will have 2GB FAT partition and the rest is ext3. If we save the data in ext3, how can Windows read that data? I'm Windows user, should I leave 6GB-10GB FAT partition.
thanks.

白い熊 2010-02-14 07:56

Re: Repartition the internal drive
 
You can read ext2/3 in Windoze, google for it.

If you wanna write to the partition from Windoze keep it at vfat.

titan 2010-02-14 10:28

Re: Repartition the internal drive
 
Quote:

Originally Posted by dthoaforum (Post 525153)
Sorry for nood question. Follow the guide of 白い熊, We will have 2GB FAT partition and the rest is ext3. If we save the data in ext3, how can Windows read that data? I'm Windows user, should I leave 6GB-10GB FAT partition.
thanks.

If you're a windows user, why do you need to repartition in the first place?
By default the ext3 /home would be USB exported to Windows,
but you must not try to access it from Windows because N900 and Windows
would access it simultaneously which would lead to fs corruption.
If you swap the first and second partition you'd need to modify the USB scripts as well.

dthoaforum 2010-02-21 00:01

Re: Repartition the internal drive
 
Since 2GB is not enough for me to install apps (easy debian is already about 1.5GB :-( ), I would like to increase that space. Could you please point me to any complete script/tutorial to do that? (I'm not afraid of reflashing device)
Thanks

CaSPeRFXX 2010-02-21 12:09

Re: Repartition the internal drive
 
canyou post pictures and instructions since i need to repartition mine aswell

Graham Cobb 2010-02-22 22:51

Re: Repartition the internal drive
 
I have been running with a loopback file for /home/user/MyDocs (and a large ext3 partition) for some time now. However, I have just discovered that the Backup application doesn't work any more!

/home/user/MyDocs/backups exists (and contains several previous backups) but when I run the backup application it displays "No memory card inserted" and doesn't show anything.

I can neither create a backup or restore one.

Anyone got any ideas?

yoush 2010-02-26 21:23

Re: Repartition the internal drive
 
Just in case somebody in this thread could be interested, I described my repartitioning experience at https://garage.maemo.org/plugins/wik...id=1382&type=g

That is about how to shrink MyDocs and use that space for extra partitions, while keeping the system as compatible with the original as possible.

Graham Cobb 2010-02-27 00:46

Re: Repartition the internal drive
 
Quote:

Originally Posted by Graham Cobb (Post 541847)
I have been running with a loopback file for /home/user/MyDocs (and a large ext3 partition) for some time now. However, I have just discovered that the Backup application doesn't work any more!

I still haven't worked out how to persuade osso-backup to look in the loopback /home/user/MyDocs but I have discovered that I can take backups to an SD card (as long as it has a VFAT filesystem on the first partition and gets mounted by the system as /media/mmc1). osso-backup seems to be very fussy as to where it is willing to look for backups.

titan 2010-02-28 11:17

Re: Repartition the internal drive
 
I've started summarizing everything I know about repartitioning at
http://wiki.maemo.org/Repartitioning_the_flash

dthoaforum 2010-03-11 22:34

Re: Repartition the internal drive
 
I successfully created two more partitions : 3G and 5G, but how can I use them :(
I also wonder why they are 3GB and 5GB but not 4-4 or 5-5. Could I just create one more partition 10GB?

Thanks.

白い熊 2010-03-17 06:37

Re: Repartition the internal drive
 
Quote:

Originally Posted by 白い熊 (Post 519398)
However, I've arrived at a solution enabling you to implement it on top of any distribution, for any architecture.

My solution to installing any program anywhere on any system, without needing root privileges.

You can observe FHS, or disregard it, or mix the approach, any program runnable from any directory, without messing with the base system:

http://kumatux.org/

AlMehdi 2010-04-13 06:16

Re: Repartition the internal drive
 
I am looking for someone with math skills... i am trying to repartition my n900 but do not get the numbers together.

I want a vfat = 16 gig, a swap = 786 mb and the rest (about 15 gig) in a ext3.

I think the partition table should look something like this?

Code:

/dev/mmcblk0p1 : start=      64, size = 30720000, id= 0
/dev/mmcblk0p2 : start= 30720064, size = 30236544, id=83
/dev/mmcblk0p3 : start= 60956608, size =  1572864, id=82


AlMehdi 2010-04-13 07:13

Re: Repartition the internal drive
 
Quote:

Originally Posted by AlMehdi (Post 607999)
I am looking for someone with math skills... i am trying to repartition my n900 but do not get the numbers together.

I want a vfat = 16 gig, a swap = 786 mb and the rest (about 15 gig) in a ext3.

I think the partition table should look something like this?

Code:

/dev/mmcblk0p1 : start=      64, size = 30720000, id= 0
/dev/mmcblk0p2 : start= 30720064, size = 30236544, id=83
/dev/mmcblk0p3 : start= 60956608, size =  1572864, id=82


No one knows?

AlMehdi 2010-04-13 10:49

Re: Repartition the internal drive
 
Solved it.. :)

Code:

/dev/mmcblk0p1 : start=      64, size = 38720000, Id= c
/dev/mmcblk0p2 : start= 38720064, size = 22105600, Id=83
/dev/mmcblk0p3 : start= 60825664, size =  1572864, Id=82
/dev/mmcblk0p4 : start=        0, size =        0, Id=0

I had some problems to make swap on partition 3 but solved it with:

Code:

sfdisk -c /dev/mmcblk0 3 82
I followed sollution #3 in this guide but recalculated the size.

I had to reflash to PR1.1 to make this work.. then i upgraded to PR1.2 OTA.

dthoaforum 2010-05-07 08:26

Re: Repartition the internal drive
 
@AlMehdi
Could you please tell me what you can do with that 10GB?
I knew that you will have more space to install apps, but how can you use that partition.
Thanks

Crogge 2010-05-28 23:48

Re: Repartition the internal drive
 
Is there a easy way to increase the size of the home partition to 3GB to install more applications? The thread here is a bit confusing to be honest.

pantera1989 2010-06-08 13:50

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.

http://img10.imageshack.us/img10/189...0060500125.png

http://img340.imageshack.us/img340/1...0060500151.png

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
http://i990.photobucket.com/albums/a...ent-S2VDMV.png

This is what you have to do next in fdisk:

1. Use 'd' command and then press '1' to delete partition 1;
http://i990.photobucket.com/albums/a...ent-3F3GMV.png

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.;
http://i990.photobucket.com/albums/a...ent-5QRDMV.png

3. Use 't' command, type '1' and then type '76' to set type of partition 1 to 76 (Unknown)
http://i990.photobucket.com/albums/a...ent-EGKGMV.png

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)
http://i990.photobucket.com/albums/a...ent-W4NBMV.png

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;
http://i990.photobucket.com/albums/a...ent-A8SKMV.png

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;
http://i990.photobucket.com/albums/a...ent-A7RAMV.png

3. Use 't' command, type '2' and then type '76' to set type of partition 2 to 76 (Unknown).
http://i990.photobucket.com/albums/a...ent-AZ79LV.png

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

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).
http://i990.photobucket.com/albums/a...ent-H9NIMV.png

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.

http://img218.imageshack.us/img218/6...0060815354.png

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.

gabby131 2010-06-10 19:55

Re: Repartition the internal drive
 
Hi! regarding this partitioning.

if i am successful and enjoying the benefits, but in some reason, needs to reflash my n900, will i re-do the whole process again? (im sorry if i may be or i am asking an answered question)

gabby131 2010-06-10 23:43

Re: Repartition the internal drive
 
im stuck at running fdisk.........permission denied, i got rootsh updated and installed........help!!!!!

titan 2010-06-11 05:43

Re: Repartition the internal drive
 
Quote:

Originally Posted by pantera1989 (Post 709284)
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. And maybe someone with more knowledge can fix a bit the process. Here's a link: http://talk.maemo.org/showthread.php?t=55549
So far 3 thanks but no replies. I have only tested this myself.

first of all, I suggest merging your new thread into this thread.

Some of the methods I described on
http://wiki.maemo.org/Repartitioning_the_flash
no longer work on PR1.2 as it is impossible to boot w/o /home.

An alternative method w/o reflashing could be:
* delete MyDocs partition
* create new home at the beginning of the free space
* copy old home to new home
* set old home's type to unknown
* reboot
* delete old home and create new MyDocs,
make sure MyDocs is partition 1 in the table (even though it's 2nd in the logical layout)

I always use sfdisk as I couldn't make fdisk align the partitions to multiples of 64K,
which is important for flash performance. It's also much easier to swap the table order with sfdisk.

pantera1989 2010-06-11 07:53

Re: Repartition the internal drive
 
Ok how do I merge it? Or only a mod can do it?

gabby131 2010-06-11 10:22

Re: Repartition the internal drive
 
Hi!

i made another 2 partitions, but why it does not show up when i type df -h?

xomm 2010-07-02 00:28

Re: Repartition the internal drive
 
Quote:

Originally Posted by pantera1989 (Post 709999)
Ok how do I merge it? Or only a mod can do it?

Done. Unfortunately, it merges chronologically (time posted.)

I've merged it to post #188 on page 19.

gandhii 2010-08-23 23:13

Re: Repartition the internal drive
 
Upon swapping the home and MyDocs partitions with each other, I have noticed how much nicer it would be if the 2gig Vfat partition was mounted to another folder within MyDocs such as .documents or such since so many programs put their large cache folders within MyDocs (gpodder). How would I go about that? The fact that fstab gets rewritten kind of throws me. Is there a script somewhere to adjust?

Bobbe 2010-08-31 02:51

Re: Repartition the internal drive
 
Guys, first:

AWESOME! Swear to God I was really excited to read this. Hacking and slashing at limitations at its best. Congratulations, really!

And just a question: do you guys envisage a future where it would be possible to repartition the internal memory so as to install other OSs in it? Say, NITDroid? Has anybody tried it? Is it possible as of today? Would multi-boot work on such a partition scheme?

Once again, thank you for all the effort you guys have been putting into this (ruskie, titan, guy with the chinese name I couldn't possibly type on my lowly western keyboard, and all the others. Far out!).

Bobbe 2010-08-31 17:46

Re: Repartition the internal drive
 
Nothing? Was really hoping someone had already tried this =///

Aranel 2010-10-29 13:31

Re: Repartition the internal drive
 
I am also searching for ways to repartition /home/ to 6 Gigabytes (because 2gig is not enough, I'm removing apps everday and I have lots of free space on MyDocs. I think It's stupid.) without reflashing, but I'm stuck :|

Any news about this?

iDont 2010-10-29 15:17

Re: Repartition the internal drive
 
Quote:

Originally Posted by Aranel (Post 856596)
I am also searching for ways to repartition /home/ to 6 Gigabytes (because 2gig is not enough, I'm removing apps everday and I have lots of free space on MyDocs. I think It's stupid.) without reflashing, but I'm stuck :|

Any news about this?

I've just submitted a new solution to the wiki which should allow you to do that:
http://wiki.maemo.org/Repartitioning..._compatible.29
You just need to adjust the partition table to make /home bigger and MyDocs smaller.

You will lose the content of MyDocs, but that folder is easy to backup (copy 'n paste). All your settings etc will be kept.
Please note I've applied that method to a cleanly PR1.3 reflashed device, though the method should work on a 'dirty' device as well.

Also possible: full eMMC as ext3 /home (with MyDocs as loopback file) + MicroSD as swap = :cool: :D

cedlmw 2010-10-29 15:31

Re: Repartition the internal drive
 
Quote:

Originally Posted by iDont (Post 856726)
I've just submitted a new solution to the wiki which should allow you to do that:
http://wiki.maemo.org/Repartitioning..._compatible.29
You just need to adjust the partition table to make /home bigger and MyDocs smaller.

You will lose the content of MyDocs, but that folder is easy to backup (copy 'n paste). All your settings etc will be kept.
Please note I've applied that method to a cleanly PR1.3 reflashed device, though the method should work on a 'dirty' device as well.

Also possible: full eMMC as ext3 /home (with MyDocs as loopback file) + MicroSD as swap = :cool: :D

Thanks a lot for this! I was just wondering whether this could brick your device..?


All times are GMT. The time now is 19:13.

vBulletin® Version 3.8.8