Editing Repartitioning the flash

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 2: Line 2:
# 27 GiB VFAT [[MyDocs folder|MyDocs partition]] on <code>/dev/mmcblk0p1</code>. When Maemo is booted, this is mounted on /home/user/MyDocs, however it is unmounted and exposed when the N900 is connected to a PC in mass storage mode
# 27 GiB VFAT [[MyDocs folder|MyDocs partition]] on <code>/dev/mmcblk0p1</code>. When Maemo is booted, this is mounted on /home/user/MyDocs, however it is unmounted and exposed when the N900 is connected to a PC in mass storage mode
# 2 GiB <code>/home</code> partition on <code>/dev/mmcblk0p2</code>. This also contains the /opt folder (mounted on /home/opt) where optified apps are stored
# 2 GiB <code>/home</code> partition on <code>/dev/mmcblk0p2</code>. This also contains the /opt folder (mounted on /home/opt) where optified apps are stored
-
# 768 MiB swap partition <code>/dev/mmcblk0p3</code>
+
# 768 MiB swap partition <code>/dev/mmcblk0p2</code>
Total 32 GB (not GiB)
Total 32 GB (not GiB)
Line 16: Line 16:
* Partitions on flash memory should be aligned to flash block sizes, which are multiples of 2, for example 32 KB. To be on the safe side use 128 KB or even 1MB.
* Partitions on flash memory should be aligned to flash block sizes, which are multiples of 2, for example 32 KB. To be on the safe side use 128 KB or even 1MB.
-
==Using GParted - Resizing made simple==
+
==Using gparted==
 +
By far the simplest way to resize your partitions is to use a GParted live CD/USB, or parted on a Linux system. To gain access to the whole eMMC, install bootmenu or BackupMenu, and boot your N900 with the keyboard exposed. (Back up your rootfs and optfs to a microSD at this point.) This will give you an option to enter USB mass storage mode (read-write). If you boot into Maemo then only the MyDocs partition will be visible and you won't be able to partition properly.
-
By far the simplest way to resize your partitions is to use a GParted live CD/USB http://sourceforge.net/projects/gparted/files/gparted-live-stable/, or GParted on a Linux system or use the GParted-Live-CD in VirtualBox on Windows or MacOSX. To gain access to the whole eMMC, install BackupMenu or BackupMenu-Multiboot.
+
Because of hardcoding etc. it is easiest to leave your partitions in the same order and filesystem: MyDocs vfat(blk0p1 mounted on /home/user/MyDocs), /home ext3 (blk0p2), and swap (blk0p3). Generally you will want to shrink MyDocs and grow /home. You can also grow the swap space, which is easier than setting up a [[swap on microSD]]. However this may not really result in much benefit (see the linked page for more information). You can then create a 4th partition if you wish. To be safe keep the last 64M of the eMMC unallocated, as is the case on the default partitioning.
-
 
+
-
Boot your N900 with the keyboard exposed to load BackupMenu. At this point you should also back up your rootfs and optfs to a microSD. Press w to go into USB Mass Storage mode (read-write), and connect up to your computer. You will now be able to access the whole eMMC. If you boot into Maemo rather than BackupMenu, then only the MyDocs partition will be visible.
+
-
 
+
-
''It is also possible to access the full eMMC by loading the [http://wiki.meego.com/ARM/N900/Using_Rescue_Initrd Rescue Initrd and kernel]. This also gives you an option to enter USB mass storage mode (read-write).''
+
-
 
+
-
''It is a third option, to use NITdroid for accessing the full eMMC. If you have installed it to the SD Card, it can export the full eMMC as USB mass storage.''
+
-
 
+
-
Because of hardcoding etc. it is easiest to leave your partitions in the same order and filesystem: MyDocs vfat(/dev/mmcblk0p1 mounted on /home/user/MyDocs), /home ext3 (/dev/mmcblk0p2), and swap (/dev/mmcblk0p3). Generally you will want to shrink MyDocs and grow /home. You can also grow the swap space, which is easier than setting up a [[swap on microSD]]. However this may not really result in much benefit (see the linked page for more information). You can then create a 4th partition if you wish.
+
Align to MiB, not cylinders! When you are done, apply your changes then disconnect and reboot your N900 and everything should load as usual. It would be very unlikely for something to go wrong if you only resized MyDocs and /home. If something does go wrong, you will need to reflash the eMMC. You should try again at this point. If you want to give up then you will need to restore your optfs from the BackupMenu backup as well as copy the MyDocs files back over.
Align to MiB, not cylinders! When you are done, apply your changes then disconnect and reboot your N900 and everything should load as usual. It would be very unlikely for something to go wrong if you only resized MyDocs and /home. If something does go wrong, you will need to reflash the eMMC. You should try again at this point. If you want to give up then you will need to restore your optfs from the BackupMenu backup as well as copy the MyDocs files back over.
-
If you want to have more than 4 partitions, create an extended partition. Always keep MyDocs as the first partition, and the first ext3 partition as /home. (Not sure whether an ext3 inside an extended partition would count.) You can edit genfstab.awk (more proper way, resembling how Maemo does it natively) or rcS-late (in this case, system does "double work", as it first proceed genfstab.awk, then overwrite commands by rcS-late ones) to automount any new partitions, or just mount them normally. (Remember to use mount options noatime, and maybe nodiratime,nobh as well)
+
If you want to have more than 4 partitions, create an extended partition. Always keep MyDocs as the first partition, and the first ext3 partition as /home. (Not sure whether an ext3 inside an extended partition would count.) You can edit genfstab.awk or rcS-late to automount any new partitions, or just mount them normally. (Remember to use mount options noatime, and maybe nodiratime,nobh as well)
==Manual solutions==
==Manual solutions==
-
The rest of this page describes manual solutions.
+
The rest of this page describes manual solutions. You can perform these without turning the N900 off.
# [[#Solution .231: swap .2Fhome and MyDocs partition|Swap the 2 GB <code>/home</code> and 27GB MyDocs partition]] to get a 2 GB VFAT MyDocs and a 27 GB ext3 <code>/home</code>. No partition size need to be changed and only a single reboot is necessary. This is the least invasive solution and can be easily reverted. It leaves a smaller MyDocs partition for VFAT USB mass storage mode.
# [[#Solution .231: swap .2Fhome and MyDocs partition|Swap the 2 GB <code>/home</code> and 27GB MyDocs partition]] to get a 2 GB VFAT MyDocs and a 27 GB ext3 <code>/home</code>. No partition size need to be changed and only a single reboot is necessary. This is the least invasive solution and can be easily reverted. It leaves a smaller MyDocs partition for VFAT USB mass storage mode.
# [[#Solution .232: shrink MyDocs to add additional partitions|shrink MyDocs to add additional partitions]] (e.g., for other OS).  
# [[#Solution .232: shrink MyDocs to add additional partitions|shrink MyDocs to add additional partitions]] (e.g., for other OS).  
# setup an [[#Solution .233: arbitrary size for .2Fhome and MyDocs|arbitrary <code>/home</code> and MyDocs division of the space]]. this is a little bit more complicated.
# setup an [[#Solution .233: arbitrary size for .2Fhome and MyDocs|arbitrary <code>/home</code> and MyDocs division of the space]]. this is a little bit more complicated.
-
# [[#Solution .234: single large .2Fhome partition.2C loopback for USB|get rid of the MyDocs partition]], setup a single 31 GB ext3 partition, and replace MyDocs with loopback file(s) that could also be USB exported and have arbitrary size and filesystem. This is useful if you rarely need USB mass storage mode or if you want to export different filesystem images depending on the computer. However, the loopback files may be significantly slower.
+
# [[#Solution .234: single large .2Fhome partition.2C loopback for USB|get rid of the MyDocs partition]], setup a single 31 GB ext3 partition, and replace MyDocs with loopback file(s) that could also be USB exported and have arbitrary size and filesystem. This is useful if you rarely need USB mass storage mode or if you want to export different filesystem images depending on the computer. However, the loopback files may be significantly slower.  
== Some remarks ==
== Some remarks ==
Line 92: Line 85:
  mount /home/user/MyDocs # mount it
  mount /home/user/MyDocs # mount it
voila!
voila!
-
 
-
NB: To check size of new home partition
 
-
du -ch /home | grep total
 
==== How to revert ====
==== How to revert ====
Line 124: Line 114:
  umount /home/user/MyDocs
  umount /home/user/MyDocs
-
create a new partition layout in file "table". Here MyDocs (mmcblk0p1) is shrunk to 19GB (39854080*512)/(1024^3), and mmcblk0p2 is an 8GB extended partition containing ext3 partitions mmcblk0p5 and 6 (4.7GB and 3.3GB respectively). Swap is mmcblk0p4 (768MB) and /home is mmcblk0p3 (2GB).
+
create a new partition layout in file "table" (here 8 GB MyDocs were used for an extended partition with 3+5 GB partitions):
  unit: sectors
  unit: sectors
  /dev/mmcblk0p1 : start=      64, size= 39854080, Id= 0
  /dev/mmcblk0p1 : start=      64, size= 39854080, Id= 0
Line 233: Line 223:
''' Don't forget to repeat the "Start flasher" procedure with '''<code>sudo flasher-3.5 --disable-rd-mode</code> '''to disable R&D mode.'''
''' Don't forget to repeat the "Start flasher" procedure with '''<code>sudo flasher-3.5 --disable-rd-mode</code> '''to disable R&D mode.'''
-
=== Solution #7: Custom repartitioning from a linux PC without R&D mode ===
+
=== Solution #7: arbitrary size for /home and MyDocs (PR 1.2/3 compatible) ===
-
Shorter variant of #6, using a boot manager instead of R&D mode (no flasher on host required)
+
-
 
+
-
* Install backupmenu package first (see [http://talk.maemo.org/showthread.php?t=63975 Announce Thread] for details)
+
-
* If you want to change file systems (like ext3 to ext2), do that now
+
-
* Shut down N900
+
-
* Start with slider open, USB cable removed
+
-
* BackupMenu will show up.
+
-
* Insert USB cable. Press '''w''' to enable USB mass storage mode
+
-
* The internal memory will now show up as additional device on your computer, like /dev/sdb. Unmount if automounted and do your resizing.
+
-
* Remove device, press '''d''' on the N900 to disconnect
+
-
* Press '''q''' and close the slider immediately. The N900 will reboot and the job is done
+
-
 
+
-
=== Solution #8: arbitrary size for /home and MyDocs (PR 1.2/3 compatible) ===
+
This solution is based off solution #3. The key difference is that this solution uses a MicroSD card as a temporary /home, so Maemo will be able to reboot in the process, thus making this solution PR1.2 and 1.3 compatible. '''MyDocs will be deleted, make a backup of it!''' This solution is tested on a PR 1.3 reflashed device, but it should work on non-clean devices aswell. If done correctly, you won't lose any settings/calendar/etc (just MyDocs), but as repartitioning is a risky proces: '''backup everything!'''
This solution is based off solution #3. The key difference is that this solution uses a MicroSD card as a temporary /home, so Maemo will be able to reboot in the process, thus making this solution PR1.2 and 1.3 compatible. '''MyDocs will be deleted, make a backup of it!''' This solution is tested on a PR 1.3 reflashed device, but it should work on non-clean devices aswell. If done correctly, you won't lose any settings/calendar/etc (just MyDocs), but as repartitioning is a risky proces: '''backup everything!'''
Line 318: Line 295:
P.s. Solution #4 applies in the same way to this solution, as to #3
P.s. Solution #4 applies in the same way to this solution, as to #3
 +
=== Solution #8: The GUI-Solution for arbitrary size for /home and MyDocs using a Linux Live-CD (PR1.3 compatible) ===
 +
This  solution is inspired by the methods [http://talk.maemo.org/member.php?u=46122 sub7] was promoting in a couple of posts in the talk.maemo.org forum like [http://talk.maemo.org/showpost.php?p=933474&postcount=48 here]
 +
 +
Lets face it: You are using a Linux phone, so make familiar with Linux! Grab yourself a Debian or Ubuntu based Live-CD.
 +
 +
Personally i recommend using an aptosid KDE4 Live-CD http://aptosid.com You will find the Downloads behind the Downloads/Mirrors link in the upper left corner. The image size is some 450MB
 +
 +
You need some prerequisites installed on your N900: You need either Backup-Menu or Backup-Menu-Multiboot by [http://talk.maemo.org/member.php?u=40462 RobbieThe1st] installed.
 +
 +
Start your PC with the Linux-Live-CD. Make sure to choose a fitting localisation for your keyboard layout. Restart your phone now with the keyboard ejected. Connect the phone to your PC via the USB. Choose the BackupMenu item. A boot screen like this http://robbiethe1st.afraid.org/BackupMenu/IMGP2653-small.jpeg will greet you
 +
Choose 'w' from the menu of the N900, this will export the partitions of the N900 internal memory to the PC.
 +
 +
Now start the KDE-Partition-Manager from the menu, you will find it in the System section.
 +
 +
You will have to choose the N900 in the devices section to the left. It will open the device in the right. Click on the first partition (the MyDocs partition), choose resize/move from the toolbar. Select the handle to the right and resize the partition to the desired size. Now choose your second partition (the optfs partition, where you will have some more space for installable applications real soon :) ), resize it using the left handle and resize it to the available space.
 +
Now apply the actions you were preparing. This will take some time, so stay patient.
 +
 +
After the process is finished shut down the PC and reboot the phone with typing 'q' in the backup-menu.
 +
Voila, you are done!
 +
P.S. I have still to figure out how to upload some screenshots. Stay tuned.
== References ==
== References ==

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)