<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://bugs.maemo.com/skins/common/feed.css?207"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>maemo.org wiki - User contributions [en]</title>
		<link>http://bugs.maemo.com/Special:Contributions/62.12.64.189</link>
		<description>From maemo.org wiki</description>
		<language>en</language>
		<generator>MediaWiki 1.15.5-7</generator>
		<lastBuildDate>Sat, 04 Apr 2026 22:39:22 GMT</lastBuildDate>
		<item>
			<title>Repartitioning the flash</title>
			<link>http://bugs.maemo.com/Repartitioning_the_flash</link>
			<guid>http://bugs.maemo.com/Repartitioning_the_flash</guid>
			<description>&lt;p&gt;62.12.64.189:&amp;#32;/* Solution #6: Custom repartitioning from a linux PC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are several reasons why users might want to repartition their eMMC flash:&lt;br /&gt;
* many Maemo power users have a Linux background. They tend to prefer POSIX filesystems like ext3 over the ancient VFAT filesystem. However, VFAT can be accessed on most non-Linux computers and would be useful to keep a small VFAT partition for data exchange with USB mass storage. With a large ext3 partition you could install much more applications, store symlinks and permissions (e.g., for backup of your desktop PC), or create Linux chroot enviroments (e.g., for installing non-optified software or Debian).&lt;br /&gt;
* booting alternative operating systems (e.g., Mer, Moebian, Fedora) requires independent partitions&lt;br /&gt;
* loopback files for chroots (see [[Easy Debian]]) can be stored in VFAT MyDocs, but access is much slower than on a native partition. loopback files in MyDocs are not available during USB mass storage mode.&lt;br /&gt;
&lt;br /&gt;
==Default partition setup==&lt;br /&gt;
&lt;br /&gt;
By default the eMMC on the N900 (&amp;lt;code&amp;gt;/dev/mmcblk0&amp;lt;/code&amp;gt;) is partitioned as follows:&lt;br /&gt;
# 27 GB VFAT [[MyDocs folder|MyDocs partition]]&lt;br /&gt;
# 2 GB &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; partition&lt;br /&gt;
# 768 MB swap partition&lt;br /&gt;
&lt;br /&gt;
This page describes several possible solutions:&lt;br /&gt;
# [[#Solution .231: swap .2Fhome and MyDocs partition|Swap the 2 GB &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; and 27GB MyDocs partition]] to get a 2 GB VFAT MyDocs and a 27 GB ext3 &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt;. 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.&lt;br /&gt;
# [[#Solution .232: shrink MyDocs to add additional partitions|shrink MyDocs to add additional partitions]] (e.g., for other OS). &lt;br /&gt;
# setup an [[#Solution .233: arbitrary size for .2Fhome and MyDocs|arbitrary &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; and MyDocs division of the space]]. this is a little bit more complicated.&lt;br /&gt;
# [[#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. &lt;br /&gt;
&lt;br /&gt;
== What you should know before partitioning ==&lt;br /&gt;
&lt;br /&gt;
* '''BACKUP YOUR DATA''': a mistake during partitioning could brick your device, lead to complete data loss and could require reflashing. Use the Backup application to backup all settings etc. Backup this and the contents of MyDocs to your computer. Remove your optional SD card to prevent data loss. Following this tutorial should minimize your risk of data loss but '''repartitioning is at your own risk'''.&lt;br /&gt;
* make sure your battery is not nearly empty (rebooting costs a lot of power) or, even better, plug in your charger.&lt;br /&gt;
* All instructions must be executed [[root access|as root]] (either from [[Terminal]] or via ssh, type &amp;quot;root&amp;quot; as user to become root).&lt;br /&gt;
* copy &amp;amp; paste is recommended (typos are dangerous). For the table files use &amp;quot;vi&amp;quot; or &amp;quot;cat &amp;gt; table&amp;quot; and Ctrl+D to quit.&lt;br /&gt;
&lt;br /&gt;
== Some remarks ==&lt;br /&gt;
&lt;br /&gt;
* partitions on flash should be aligned to flash block sizes (AFAIK this is 32 KB, but some sources claims 64 KB or 128 KB). To be on the safe side use 128 KB.&lt;br /&gt;
* the only &amp;lt;code&amp;gt;fdisk&amp;lt;/code&amp;gt; utility on the device is &amp;lt;code&amp;gt;sfdisk&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;fdisk&amp;lt;/code&amp;gt; could be extracted from Debian packages but it aligns partitions based on virtual harddisk cylinders and not on flash blocks.&lt;br /&gt;
** to modify the whole partition table use&amp;lt;pre&amp;gt;sfdisk -d /dev/mmcblk0 &amp;gt; table&amp;lt;/pre&amp;gt;edit the file table, and overwrite the partition table with&amp;lt;pre&amp;gt;sfdisk --no-reread /dev/mmcblk0 &amp;lt; table&amp;lt;/pre&amp;gt;&lt;br /&gt;
** ids of single partitions can be changed with&amp;lt;pre&amp;gt;sfdisk -c /dev/mmcblk0 2 83&amp;lt;/pre&amp;gt;(this example changes the 2nd partition to 83=Linux).&lt;br /&gt;
* Maemo hardcodes the MyDocs partition as &amp;lt;code&amp;gt;/dev/mmcblk0p1&amp;lt;/code&amp;gt; in several applications. If you keep a VFAT partition, make sure it is the first partition (partitions in the table do not need to have the same order as on the disk). Otherwise you have to modified several scripts belonging to ke-recv. &lt;br /&gt;
* &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; is the first ext3 partition, swap can be any partition number.&lt;br /&gt;
* the most relevant scripts for partitioning are &amp;lt;code&amp;gt;/etc/event.d/rcS-late&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;/usr/sbin/osso-usb-mass-storage-enable.sh&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/usr/sbin/osso-usb-mass-storage-disable.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
* it is not a good idea to unmount &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; in a running system. umounting &amp;lt;code&amp;gt;/home/user/MyDocs&amp;lt;/code&amp;gt; is generally safe (if all applications are closed).&lt;br /&gt;
* you can boot without a &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; partition (for example, by commenting out the line in rcS-late or by change the partition ids to something other than 83). Maemo will create a default home (about 10 MB) on NAND. Most relevant settings (wifi, desktop) are stored on NAND anyway. Make sure to&amp;lt;pre&amp;gt;rm -rf /home/user&amp;lt;/pre&amp;gt; before reboot. This trick is useful if want to change the layout of the eMMC completely.&lt;br /&gt;
* ext3 partitions can be grown online, but not be shrinked.&lt;br /&gt;
* [http://www.gnu.org/software/parted/index.shtml parted] does not work on Maemo (it always crashed due to some mmap problem).&lt;br /&gt;
* if you don't want a VFAT MyDocs partition, you need to create MyDocs/DCIM directory with users permission for the camera app to work [https://bugs.maemo.org/show_bug.cgi?id=7160 proper permissions].&lt;br /&gt;
* you might want to do &amp;lt;code&amp;gt;tune2fs -c 0 -i 0 device&amp;lt;/code&amp;gt; on your new newly created ext3 filesystems so the fs is never fsck'd on boot (these are the settings on the default ext3 /home partition)&lt;br /&gt;
&lt;br /&gt;
== Solutions ==&lt;br /&gt;
&lt;br /&gt;
'''WARNING: The following instructions have not been tested thoroughly yet!'''&lt;br /&gt;
Please report problems, positive and negative feedback to [mailto:moebian-devel@garage.maemo.org this address].&lt;br /&gt;
&lt;br /&gt;
'''WARNING: Please have a look at [http://talk.maemo.org/showpost.php?p=709886&amp;amp;postcount=191 Titan's comments] Before Proceeding!'''&lt;br /&gt;
It seems that with [[Maemo 5/PR1.2|PR1.2]] release below methods do not work as it is impossible to boot without &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt;. Just so that someone who missed the post doesn't have to reflash 5-6 times after tries &amp;amp; retries only to find it will not work.&lt;br /&gt;
&lt;br /&gt;
Solution #1 Seems to be working fine as &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; is preserved.&lt;br /&gt;
&lt;br /&gt;
=== Solution #1: swap /home and MyDocs partition ===&lt;br /&gt;
TODO, see [http://talk.maemo.org/showpost.php?p=424811&amp;amp;postcount=66 how to swap FAT and ext3 parition]&lt;br /&gt;
&lt;br /&gt;
We assume you have the standard Nokia partition layout on your device.&lt;br /&gt;
&lt;br /&gt;
'''Warning: the contents of MyDocs will deleted. Perform a backup!'''&lt;br /&gt;
&lt;br /&gt;
 umount /home/user/MyDocs&lt;br /&gt;
 sfdisk -c /dev/mmcblk0 1 83 # optional (safer): change FAT to ext3 id &lt;br /&gt;
 mkfs.ext3 /dev/mmcblk0p1 # create ext3 on large partition&lt;br /&gt;
 mount /dev/mmcblk0p1 /mnt # mount new /home&lt;br /&gt;
 cp -a /home/* /mnt # copy contents of /home to large partition&lt;br /&gt;
 umount /mnt # unmount it&lt;br /&gt;
create the file &amp;quot;table&amp;quot;:&lt;br /&gt;
 unit: sectors&lt;br /&gt;
 /dev/mmcblk0p1 : start= 56631360, size=  4194304, Id= c&lt;br /&gt;
 /dev/mmcblk0p2 : start=       64, size= 56631296, Id=83&lt;br /&gt;
 /dev/mmcblk0p3 : start= 60825664, size=  1572864, Id=82&lt;br /&gt;
 /dev/mmcblk0p4 : start=        0, size=        0, Id= 0&lt;br /&gt;
continue with&lt;br /&gt;
 sfdisk --no-reread /dev/mmcblk0 &amp;lt; table # change partition table, swap p1 and p2&lt;br /&gt;
 reboot; exit # reboot to re-read new table&lt;br /&gt;
after reboot&lt;br /&gt;
 mkfs.vfat -F32 /dev/mmcblk0p1  # create VFAT on 2GB partition&lt;br /&gt;
 mount /home/user/MyDocs # mount it&lt;br /&gt;
voila!&lt;br /&gt;
&lt;br /&gt;
==== How to revert ====&lt;br /&gt;
'''Warning: /home must have less than 2 GB usage! MyDocs will be deleted!'''&lt;br /&gt;
&lt;br /&gt;
 umount /home/user/MyDocs&lt;br /&gt;
 sfdisk -c /dev/mmcblk0 1 83 # optional (safer): change FAT to ext3 id &lt;br /&gt;
 mkfs.ext3 /dev/mmcblk0p1 # create ext3 on smaller partition&lt;br /&gt;
 mount /dev/mmcblk0p1 /mnt # mount new /home&lt;br /&gt;
 cp -a /home/* /mnt # copy contents of /home to large partition&lt;br /&gt;
 umount /mnt # unmount it&lt;br /&gt;
create the file &amp;quot;table&amp;quot; (this is the original layout):&lt;br /&gt;
 unit: sectors&lt;br /&gt;
 /dev/mmcblk0p1 : start=       64, size= 56631296, Id=c&lt;br /&gt;
 /dev/mmcblk0p2 : start= 56631360, size=  4194304, Id= 83&lt;br /&gt;
 /dev/mmcblk0p3 : start= 60825664, size=  1572864, Id=82&lt;br /&gt;
 /dev/mmcblk0p4 : start=        0, size=        0, Id= 0&lt;br /&gt;
continue with&lt;br /&gt;
 sfdisk --no-reread /dev/mmcblk0 &amp;lt; table # change partition table, swap p1 and p2&lt;br /&gt;
 reboot; exit # reboot to re-read new table&lt;br /&gt;
after reboot&lt;br /&gt;
 mkfs.vfat -F32 -s64 /dev/mmcblk0p1  # create VFAT on 27GB partition&lt;br /&gt;
 mount /home/user/MyDocs # mount it&lt;br /&gt;
&lt;br /&gt;
=== Solution #2: shrink MyDocs to add additional partitions ===&lt;br /&gt;
TODO, see [https://garage.maemo.org/plugins/wiki/index.php?RepartitionInstructions&amp;amp;id=1382&amp;amp;type=g Repartitioning: create extended partitions]&lt;br /&gt;
&lt;br /&gt;
'''Warning: the contents of MyDocs will deleted. Perform a backup!'''&lt;br /&gt;
&lt;br /&gt;
 umount /home/user/MyDocs&lt;br /&gt;
create a new partition layout in file &amp;quot;table&amp;quot; (here 8 GB MyDocs were used for an extended partition with 3+5 GB partitions):&lt;br /&gt;
 unit: sectors&lt;br /&gt;
 /dev/mmcblk0p1 : start=       64, size= 39854080, Id= 0&lt;br /&gt;
 /dev/mmcblk0p2 : start= 39854144, size= 16777216, Id= 5&lt;br /&gt;
 /dev/mmcblk0p3:  start= 56631360, size=  4194304, Id=83&lt;br /&gt;
 /dev/mmcblk0p4 : start= 60825664, size=  1572864, Id=82&lt;br /&gt;
 /dev/mmcblk0p5 : start= 39854160, size=  9765680, Id=83&lt;br /&gt;
 /dev/mmcblk0p6 : start= 49619856, size=  7011504, Id=83&lt;br /&gt;
continue with&lt;br /&gt;
 sfdisk --no-reread /dev/mmcblk0 &amp;lt; table # change partition table&lt;br /&gt;
 reboot; exit # reboot to re-read new table&lt;br /&gt;
after reboot&lt;br /&gt;
 sfdisk -c /dev/mmcblk0 1 c # optional (safer): change FAT to ext3 id &lt;br /&gt;
 mkfs.vfat -F32 /dev/mmcblk0p1  # recreate VFAT on MyDocs&lt;br /&gt;
 mkfs.ext3 /dev/mmcblk0p5&lt;br /&gt;
 mkfs.ext3 /dev/mmcblk0p6&lt;br /&gt;
reboot and restore MyDocs&lt;br /&gt;
&lt;br /&gt;
=== Solution #3: arbitrary size for /home and MyDocs ===&lt;br /&gt;
TODO, see also [[User:Ruskie#Repartitioning]]&lt;br /&gt;
&lt;br /&gt;
'''Warning: /home and MyDocs will be deleted. Backup everything.'''&lt;br /&gt;
Backup all settings (to your computer or SD), reflash, restore the settings and install rootsh (no other applications!).&lt;br /&gt;
&lt;br /&gt;
create your new partition table layout in the file &amp;quot;table&amp;quot;.&lt;br /&gt;
Make sure all partitions are aligned to 32 KB and sizes are multiples of 32 KB.&lt;br /&gt;
The sectors are 512 bytes, so the block counts must multiplied by 2.&lt;br /&gt;
For example, 2GB= 4194304 blocks. Each partition should start at start+size of the previous partition.&lt;br /&gt;
The first partition must start at 64. Make sure to keep the swap partition (the number may be changed).&lt;br /&gt;
Initially set the id of your partition to 0 so that they are not mounted at reboot.&lt;br /&gt;
An example layout with 2 GB part1 and 27 GB part2:&lt;br /&gt;
 unit: sectors&lt;br /&gt;
 /dev/mmcblk0p1 : start=       64, size= 4194304 , Id=0&lt;br /&gt;
 /dev/mmcblk0p2 : start= 4194368, size=  56631296, Id=0&lt;br /&gt;
 /dev/mmcblk0p3 : start= 60825664, size=  1572864, Id=82&lt;br /&gt;
 /dev/mmcblk0p4 : start=        0, size=        0, Id= 0&lt;br /&gt;
(Optional) Dump your current partition table with the following command&lt;br /&gt;
 sfdisk -d /dev/mmcblk0 &amp;gt; table&lt;br /&gt;
continue with&lt;br /&gt;
 sfdisk --no-reread /dev/mmcblk0 &amp;lt; table # change partition table&lt;br /&gt;
 reboot; exit&lt;br /&gt;
The device creates a default /home in NAND.&lt;br /&gt;
Now change the parition ids and create the file systems&lt;br /&gt;
 sfdisk -c /dev/mmcblk0 1 c&lt;br /&gt;
 mkfs.vfat -F32 -s64 /dev/mmcblk0p1&lt;br /&gt;
 sfdisk -c /dev/mmcblk0 2 83&lt;br /&gt;
 mkfs.ext3 /dev/mmcblk0p2&lt;br /&gt;
if you have change to location or size of swap run&lt;br /&gt;
 mkswap &amp;lt;swap-partition&amp;gt;&lt;br /&gt;
finish with&lt;br /&gt;
 rm -rf /home/user&lt;br /&gt;
 reboot; exit&lt;br /&gt;
finally restore all your backups&lt;br /&gt;
&lt;br /&gt;
=== Solution #4: single large /home partition, loopback for USB ===&lt;br /&gt;
TODO, see [http://talk.maemo.org/showpost.php?p=425359&amp;amp;postcount=68 how to implement USB mass storage with a loopback file]&lt;br /&gt;
&lt;br /&gt;
like solution #3, but don't create a MyDocs partition.&lt;br /&gt;
&lt;br /&gt;
how to create a sparse 1GB loopback file:&lt;br /&gt;
 dd if=/dev/zero of=FAT1GB bs=1M seek=1024 count=0 # small 256MB image&lt;br /&gt;
 losetup /dev/loop0 FAT1GB&lt;br /&gt;
 mkfs.vfat -F32 /dev/loop0&lt;br /&gt;
 vi /etc/fstab # replace /dev/mmcblk0p2 with /dev/loop0&lt;br /&gt;
 mount MyDocs&lt;br /&gt;
&lt;br /&gt;
=== Solution #5: Edit eMMC image (works on PR1.2, by globalbus) ===&lt;br /&gt;
Backup MyDocs, we need to flash device.&lt;br /&gt;
Open eMMC image in hex editor, go to 0xcb, you will see this&lt;br /&gt;
 partition {size = 2048;fs_type = &amp;quot;ext3&amp;quot;;prefix = &amp;quot;home&amp;quot;;}&lt;br /&gt;
Edit size parameter (do not change the size of file! The number must be from 1000 to 9999) Flash it now.&lt;br /&gt;
&lt;br /&gt;
If MyDocs have incorrect size or it's not mounting automatically you need to format it and paste files from backup.&lt;br /&gt;
 umount /dev/mmcblk0p1&lt;br /&gt;
 mkfs.vfat -F32 -s64 /dev/mmcblk0p1&lt;br /&gt;
 mount /dev/mmcblk0p1&lt;br /&gt;
&lt;br /&gt;
=== Solution #6: Custom repartitioning from a linux PC ===&lt;br /&gt;
Taken from [http://wiki.meego.com/ARM/N900/Using_Rescue_Initrd Using Rescue Initrd - MeeGo Wiki].&lt;br /&gt;
&lt;br /&gt;
'''This way is only intended for users who have partitioned their systems before. Your files will not be affected unless you explicitly ask your partitioner to do so although there's nothing wrong with taking extra care and backing up your files'''&lt;br /&gt;
&lt;br /&gt;
Install [http://wiki.maemo.org/Documentation/Maemo_5_Developer_Guide/Development_Environment/Maemo_Flasher-3.5 flasher-3.5] on your box.&lt;br /&gt;
&lt;br /&gt;
Get the rescue kernel and initrd rpm and extract them in a directory:&lt;br /&gt;
  &amp;lt;pre&amp;gt;mkdir n900-rescue-initrd&lt;br /&gt;
cd n900-rescue-initrd&lt;br /&gt;
wget http://repo.meego.com/MeeGo/releases/1.0/core/repos/armv7l/packages/armv7l/nokia-n900-rescue-initrd-0.1-1.3.armv7l.rpm&lt;br /&gt;
wget http://repo.meego.com/MeeGo/releases/1.0/core/repos/armv7l/packages/armv7l/kernel-n900-2.6.33.3-11.2.armv7l.rpm&lt;br /&gt;
rpm2cpio nokia-n900-rescue-initrd-0.1-1.3.armv7l.rpm | cpio -vid &lt;br /&gt;
rpm2cpio kernel-n900-2.6.33.3-11.2.armv7l.rpm  | cpio -vid &amp;lt;/pre&amp;gt;&lt;br /&gt;
Now you're ready to boot the device:&lt;br /&gt;
&lt;br /&gt;
Turn off your N900 by removing the battery.&lt;br /&gt;
&lt;br /&gt;
Start flasher:&lt;br /&gt;
  &amp;lt;pre&amp;gt;sudo flasher-3.5 -k boot/vmlinuz-2.6.33.3-11.2-n900 -n boot/initrd.img-rescue-2.6.33.3-11.2-n900 -l -b&amp;quot;rootdelay=1 root=/dev/ram0&amp;quot; --set-rd-flags=no-omap-wd --set-rd-flags=no-ext-wd --enable-rd-mode&amp;lt;/pre&amp;gt;&lt;br /&gt;
Connect N900 to your PC.&lt;br /&gt;
&lt;br /&gt;
Press U on the keyboard and keep holding it.&lt;br /&gt;
&lt;br /&gt;
Put the battery back in.&lt;br /&gt;
&lt;br /&gt;
Wait for the device to boot and press U to enable USB storage mode. The device is now added to the list of your storage devices as an increment of /dev/sd.&lt;br /&gt;
&lt;br /&gt;
Partition it using your favorite partitioner (GParted recommended)&lt;br /&gt;
&lt;br /&gt;
''' Don't forget to repeat the &amp;quot;Start flasher&amp;quot; procedure with '''&amp;lt;code&amp;gt;sudo flasher-3.5 --disable-rd-mode&amp;lt;/code&amp;gt; '''to disable R&amp;amp;D mode.'''&lt;br /&gt;
&lt;br /&gt;
=== Solution #7: arbitrary size for /home and MyDocs (PR 1.2/3 compatible) ===&lt;br /&gt;
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!'''&lt;br /&gt;
&lt;br /&gt;
Prerequisites:&lt;br /&gt;
*Partition the MicroSD card so that it has a partition big enough to hold all data on /home (which is 2gb at its max). &lt;br /&gt;
*Format this partition as ext3. I'll assume you've only made one big partition (which will be /dev/mmcblk1p1 in Maemo).&lt;br /&gt;
*Make sure you've read and understood solution #3 completely, as this one is based on it&lt;br /&gt;
&lt;br /&gt;
This method involves moving /home. If you mess up the device names, format incorrectly or copy /home wrongly, Maemo will get into an infinite reboot loop, requiring a reflash to restore!!&lt;br /&gt;
&lt;br /&gt;
-Mount your freshly partitioned and formatted MicroSD card&lt;br /&gt;
 mount /dev/mmcblk1p1 /mnt&lt;br /&gt;
&lt;br /&gt;
-Unmount MyDocs (after backing it up ;)&lt;br /&gt;
 umount /home/user/MyDocs&lt;br /&gt;
&lt;br /&gt;
-Copy /home to your MicroSD card (assuming one big ext3 partition)&lt;br /&gt;
 cp -a /home/* /mnt&lt;br /&gt;
&lt;br /&gt;
-Open /usr/lib/genfstab.awk and comment out the following pieces of code&lt;br /&gt;
 start == 1 &amp;amp;&amp;amp; $6 == 83 &amp;amp;&amp;amp; !__home {&lt;br /&gt;
        printf &amp;quot;%s /home ext3 %s 0 0\n&amp;quot;, $1, home_opts            &lt;br /&gt;
         printf &amp;quot;/home/opt /opt none bind\n&amp;quot;&lt;br /&gt;
         __home++&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 start == 1 &amp;amp;&amp;amp; $6 == &amp;quot;c&amp;quot; &amp;amp;&amp;amp; !__fat {&lt;br /&gt;
        printf &amp;quot;%s /home/user/MyDocs vfat %s 0 0\n&amp;quot;, $1, fat_opts&lt;br /&gt;
        __fat++&lt;br /&gt;
 }&lt;br /&gt;
This will make sure the default /home and MyDocs won't get mounted on reboot.&lt;br /&gt;
&lt;br /&gt;
-Open /etc/event.d/rcS-late, find the line '-f /usr/lib/genfstab.awk &amp;gt; $tmp_fstab' and add this below it&lt;br /&gt;
 echo &amp;quot;/dev/mmcblk1p1 /home ext3 rw,noatime,errors=continue,commit=1,data=writeback 0 0&amp;quot; &amp;gt;&amp;gt; $tmp_fstab&lt;br /&gt;
 echo &amp;quot;/home/opt /opt none bind&amp;quot; &amp;gt;&amp;gt; $tmp_fstab&lt;br /&gt;
Maemo will then use the MicroSD ext3 partition (containing a copy of your /home) as the new /home after a reboot&lt;br /&gt;
&lt;br /&gt;
-Reboot your phone now. If all went well, you should notice no difference between now and the situation before you started, except for that MyDocs is unavailable. If it is available, you can unmount it with 'umount /home/user/MyDocs'&lt;br /&gt;
&lt;br /&gt;
-Now we can repartition the flash, as it is unused right now (except for the swap partition). An example layout with 2 GB MyDocs and 27 GB /home: &lt;br /&gt;
 unit: sectors&lt;br /&gt;
 /dev/mmcblk0p1 : start=       64, size= 4194304 , Id=c&lt;br /&gt;
 /dev/mmcblk0p2 : start= 4194368, size=  56631296, Id=83&lt;br /&gt;
 /dev/mmcblk0p3 : start= 60825664, size=  1572864, Id=82&lt;br /&gt;
 /dev/mmcblk0p4 : start=        0, size=        0, Id= 0&lt;br /&gt;
Save the above code as a plain text file (eg. as table)on your N900. Use Id=c for MyDocs (FAT), 83 for EXT partitions and 82 for swap partition.&lt;br /&gt;
&lt;br /&gt;
-Apply the partition table by running the following command in the same directory as the table file:&lt;br /&gt;
 sfdisk --no-reread /dev/mmcblk0 &amp;lt; table &lt;br /&gt;
&lt;br /&gt;
-Reboot the phone&lt;br /&gt;
&lt;br /&gt;
-Format the newly created large partition as ext3&lt;br /&gt;
 mkfs.ext3 /dev/mmcblk0p2&lt;br /&gt;
&lt;br /&gt;
-And the fresh smaller one as FAT for MyDocs&lt;br /&gt;
 mkfs.vfat -F32 -s64 /dev/mmcblk0p1&lt;br /&gt;
&lt;br /&gt;
-Mount the ext3 partition as /mnt&lt;br /&gt;
 mount /dev/mmcblk0p2 /mnt&lt;br /&gt;
&lt;br /&gt;
-Copy you /home back&lt;br /&gt;
 cp -a /home/* /mnt&lt;br /&gt;
&lt;br /&gt;
-Open /usr/lib/genfstab.awk again and uncomment the code you've previously commented.&lt;br /&gt;
&lt;br /&gt;
-Remove the lines from /etc/event.d/rcS-late you've added before&lt;br /&gt;
&lt;br /&gt;
Reboot again and you're done!. The great part is with the aid of a MicroSD card, you can truly partition exactly as you like. For example: you can also create a swap partition on the sd card, comment out the swap part of genfstab.awk, add an &amp;quot;echo &amp;quot;/dev/mmcblk1p'''X''' none swap sw 0 0&amp;quot; &amp;gt;&amp;gt; $tmp_fstab&amp;quot; to rcS-late (where X is the MicroSD swap partition). This will allow you to repartition the swap partition on the eMMC (or completely remove it, so that only the MicroSD card will be used as swap (for discussion about this see [http://talk.maemo.org/showthread.php?p=846082 this thread]. As long as you edit rcS-late and genfstab.awk correcly, you can partition without restrictions&lt;br /&gt;
&lt;br /&gt;
P.s. Solution #4 applies in the same way to this solution, as to #3&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [https://maemo.org/community/brainstorm/view/more_efficient_and_flexible_use_of_internal_flash brainstorm] and [http://talk.maemo.org/showthread.php?t=37869 discussion]&lt;br /&gt;
* [http://talk.maemo.org/showthread.php?t=35122 Repartitioning the flash]&lt;br /&gt;
&lt;br /&gt;
[[Category:Power users]]&lt;br /&gt;
[[Category:N900]]&lt;/div&gt;</description>
			<pubDate>Fri, 31 Dec 2010 13:39:26 GMT</pubDate>			<dc:creator>62.12.64.189</dc:creator>			<comments>http://bugs.maemo.com/Talk:Repartitioning_the_flash</comments>		</item>
		<item>
			<title>Repartitioning the flash</title>
			<link>http://bugs.maemo.com/Repartitioning_the_flash</link>
			<guid>http://bugs.maemo.com/Repartitioning_the_flash</guid>
			<description>&lt;p&gt;62.12.64.189:&amp;#32;/* Solution #6: Custom repartitioning from a linux PC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are several reasons why users might want to repartition their eMMC flash:&lt;br /&gt;
* many Maemo power users have a Linux background. They tend to prefer POSIX filesystems like ext3 over the ancient VFAT filesystem. However, VFAT can be accessed on most non-Linux computers and would be useful to keep a small VFAT partition for data exchange with USB mass storage. With a large ext3 partition you could install much more applications, store symlinks and permissions (e.g., for backup of your desktop PC), or create Linux chroot enviroments (e.g., for installing non-optified software or Debian).&lt;br /&gt;
* booting alternative operating systems (e.g., Mer, Moebian, Fedora) requires independent partitions&lt;br /&gt;
* loopback files for chroots (see [[Easy Debian]]) can be stored in VFAT MyDocs, but access is much slower than on a native partition. loopback files in MyDocs are not available during USB mass storage mode.&lt;br /&gt;
&lt;br /&gt;
==Default partition setup==&lt;br /&gt;
&lt;br /&gt;
By default the eMMC on the N900 (&amp;lt;code&amp;gt;/dev/mmcblk0&amp;lt;/code&amp;gt;) is partitioned as follows:&lt;br /&gt;
# 27 GB VFAT [[MyDocs folder|MyDocs partition]]&lt;br /&gt;
# 2 GB &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; partition&lt;br /&gt;
# 768 MB swap partition&lt;br /&gt;
&lt;br /&gt;
This page describes several possible solutions:&lt;br /&gt;
# [[#Solution .231: swap .2Fhome and MyDocs partition|Swap the 2 GB &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; and 27GB MyDocs partition]] to get a 2 GB VFAT MyDocs and a 27 GB ext3 &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt;. 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.&lt;br /&gt;
# [[#Solution .232: shrink MyDocs to add additional partitions|shrink MyDocs to add additional partitions]] (e.g., for other OS). &lt;br /&gt;
# setup an [[#Solution .233: arbitrary size for .2Fhome and MyDocs|arbitrary &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; and MyDocs division of the space]]. this is a little bit more complicated.&lt;br /&gt;
# [[#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. &lt;br /&gt;
&lt;br /&gt;
== What you should know before partitioning ==&lt;br /&gt;
&lt;br /&gt;
* '''BACKUP YOUR DATA''': a mistake during partitioning could brick your device, lead to complete data loss and could require reflashing. Use the Backup application to backup all settings etc. Backup this and the contents of MyDocs to your computer. Remove your optional SD card to prevent data loss. Following this tutorial should minimize your risk of data loss but '''repartitioning is at your own risk'''.&lt;br /&gt;
* make sure your battery is not nearly empty (rebooting costs a lot of power) or, even better, plug in your charger.&lt;br /&gt;
* All instructions must be executed [[root access|as root]] (either from [[Terminal]] or via ssh, type &amp;quot;root&amp;quot; as user to become root).&lt;br /&gt;
* copy &amp;amp; paste is recommended (typos are dangerous). For the table files use &amp;quot;vi&amp;quot; or &amp;quot;cat &amp;gt; table&amp;quot; and Ctrl+D to quit.&lt;br /&gt;
&lt;br /&gt;
== Some remarks ==&lt;br /&gt;
&lt;br /&gt;
* partitions on flash should be aligned to flash block sizes (AFAIK this is 32 KB, but some sources claims 64 KB or 128 KB). To be on the safe side use 128 KB.&lt;br /&gt;
* the only &amp;lt;code&amp;gt;fdisk&amp;lt;/code&amp;gt; utility on the device is &amp;lt;code&amp;gt;sfdisk&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;fdisk&amp;lt;/code&amp;gt; could be extracted from Debian packages but it aligns partitions based on virtual harddisk cylinders and not on flash blocks.&lt;br /&gt;
** to modify the whole partition table use&amp;lt;pre&amp;gt;sfdisk -d /dev/mmcblk0 &amp;gt; table&amp;lt;/pre&amp;gt;edit the file table, and overwrite the partition table with&amp;lt;pre&amp;gt;sfdisk --no-reread /dev/mmcblk0 &amp;lt; table&amp;lt;/pre&amp;gt;&lt;br /&gt;
** ids of single partitions can be changed with&amp;lt;pre&amp;gt;sfdisk -c /dev/mmcblk0 2 83&amp;lt;/pre&amp;gt;(this example changes the 2nd partition to 83=Linux).&lt;br /&gt;
* Maemo hardcodes the MyDocs partition as &amp;lt;code&amp;gt;/dev/mmcblk0p1&amp;lt;/code&amp;gt; in several applications. If you keep a VFAT partition, make sure it is the first partition (partitions in the table do not need to have the same order as on the disk). Otherwise you have to modified several scripts belonging to ke-recv. &lt;br /&gt;
* &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; is the first ext3 partition, swap can be any partition number.&lt;br /&gt;
* the most relevant scripts for partitioning are &amp;lt;code&amp;gt;/etc/event.d/rcS-late&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;/usr/sbin/osso-usb-mass-storage-enable.sh&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/usr/sbin/osso-usb-mass-storage-disable.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
* it is not a good idea to unmount &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; in a running system. umounting &amp;lt;code&amp;gt;/home/user/MyDocs&amp;lt;/code&amp;gt; is generally safe (if all applications are closed).&lt;br /&gt;
* you can boot without a &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; partition (for example, by commenting out the line in rcS-late or by change the partition ids to something other than 83). Maemo will create a default home (about 10 MB) on NAND. Most relevant settings (wifi, desktop) are stored on NAND anyway. Make sure to&amp;lt;pre&amp;gt;rm -rf /home/user&amp;lt;/pre&amp;gt; before reboot. This trick is useful if want to change the layout of the eMMC completely.&lt;br /&gt;
* ext3 partitions can be grown online, but not be shrinked.&lt;br /&gt;
* [http://www.gnu.org/software/parted/index.shtml parted] does not work on Maemo (it always crashed due to some mmap problem).&lt;br /&gt;
* if you don't want a VFAT MyDocs partition, you need to create MyDocs/DCIM directory with users permission for the camera app to work [https://bugs.maemo.org/show_bug.cgi?id=7160 proper permissions].&lt;br /&gt;
* you might want to do &amp;lt;code&amp;gt;tune2fs -c 0 -i 0 device&amp;lt;/code&amp;gt; on your new newly created ext3 filesystems so the fs is never fsck'd on boot (these are the settings on the default ext3 /home partition)&lt;br /&gt;
&lt;br /&gt;
== Solutions ==&lt;br /&gt;
&lt;br /&gt;
'''WARNING: The following instructions have not been tested thoroughly yet!'''&lt;br /&gt;
Please report problems, positive and negative feedback to [mailto:moebian-devel@garage.maemo.org this address].&lt;br /&gt;
&lt;br /&gt;
'''WARNING: Please have a look at [http://talk.maemo.org/showpost.php?p=709886&amp;amp;postcount=191 Titan's comments] Before Proceeding!'''&lt;br /&gt;
It seems that with [[Maemo 5/PR1.2|PR1.2]] release below methods do not work as it is impossible to boot without &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt;. Just so that someone who missed the post doesn't have to reflash 5-6 times after tries &amp;amp; retries only to find it will not work.&lt;br /&gt;
&lt;br /&gt;
Solution #1 Seems to be working fine as &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; is preserved.&lt;br /&gt;
&lt;br /&gt;
=== Solution #1: swap /home and MyDocs partition ===&lt;br /&gt;
TODO, see [http://talk.maemo.org/showpost.php?p=424811&amp;amp;postcount=66 how to swap FAT and ext3 parition]&lt;br /&gt;
&lt;br /&gt;
We assume you have the standard Nokia partition layout on your device.&lt;br /&gt;
&lt;br /&gt;
'''Warning: the contents of MyDocs will deleted. Perform a backup!'''&lt;br /&gt;
&lt;br /&gt;
 umount /home/user/MyDocs&lt;br /&gt;
 sfdisk -c /dev/mmcblk0 1 83 # optional (safer): change FAT to ext3 id &lt;br /&gt;
 mkfs.ext3 /dev/mmcblk0p1 # create ext3 on large partition&lt;br /&gt;
 mount /dev/mmcblk0p1 /mnt # mount new /home&lt;br /&gt;
 cp -a /home/* /mnt # copy contents of /home to large partition&lt;br /&gt;
 umount /mnt # unmount it&lt;br /&gt;
create the file &amp;quot;table&amp;quot;:&lt;br /&gt;
 unit: sectors&lt;br /&gt;
 /dev/mmcblk0p1 : start= 56631360, size=  4194304, Id= c&lt;br /&gt;
 /dev/mmcblk0p2 : start=       64, size= 56631296, Id=83&lt;br /&gt;
 /dev/mmcblk0p3 : start= 60825664, size=  1572864, Id=82&lt;br /&gt;
 /dev/mmcblk0p4 : start=        0, size=        0, Id= 0&lt;br /&gt;
continue with&lt;br /&gt;
 sfdisk --no-reread /dev/mmcblk0 &amp;lt; table # change partition table, swap p1 and p2&lt;br /&gt;
 reboot; exit # reboot to re-read new table&lt;br /&gt;
after reboot&lt;br /&gt;
 mkfs.vfat -F32 /dev/mmcblk0p1  # create VFAT on 2GB partition&lt;br /&gt;
 mount /home/user/MyDocs # mount it&lt;br /&gt;
voila!&lt;br /&gt;
&lt;br /&gt;
==== How to revert ====&lt;br /&gt;
'''Warning: /home must have less than 2 GB usage! MyDocs will be deleted!'''&lt;br /&gt;
&lt;br /&gt;
 umount /home/user/MyDocs&lt;br /&gt;
 sfdisk -c /dev/mmcblk0 1 83 # optional (safer): change FAT to ext3 id &lt;br /&gt;
 mkfs.ext3 /dev/mmcblk0p1 # create ext3 on smaller partition&lt;br /&gt;
 mount /dev/mmcblk0p1 /mnt # mount new /home&lt;br /&gt;
 cp -a /home/* /mnt # copy contents of /home to large partition&lt;br /&gt;
 umount /mnt # unmount it&lt;br /&gt;
create the file &amp;quot;table&amp;quot; (this is the original layout):&lt;br /&gt;
 unit: sectors&lt;br /&gt;
 /dev/mmcblk0p1 : start=       64, size= 56631296, Id=c&lt;br /&gt;
 /dev/mmcblk0p2 : start= 56631360, size=  4194304, Id= 83&lt;br /&gt;
 /dev/mmcblk0p3 : start= 60825664, size=  1572864, Id=82&lt;br /&gt;
 /dev/mmcblk0p4 : start=        0, size=        0, Id= 0&lt;br /&gt;
continue with&lt;br /&gt;
 sfdisk --no-reread /dev/mmcblk0 &amp;lt; table # change partition table, swap p1 and p2&lt;br /&gt;
 reboot; exit # reboot to re-read new table&lt;br /&gt;
after reboot&lt;br /&gt;
 mkfs.vfat -F32 -s64 /dev/mmcblk0p1  # create VFAT on 27GB partition&lt;br /&gt;
 mount /home/user/MyDocs # mount it&lt;br /&gt;
&lt;br /&gt;
=== Solution #2: shrink MyDocs to add additional partitions ===&lt;br /&gt;
TODO, see [https://garage.maemo.org/plugins/wiki/index.php?RepartitionInstructions&amp;amp;id=1382&amp;amp;type=g Repartitioning: create extended partitions]&lt;br /&gt;
&lt;br /&gt;
'''Warning: the contents of MyDocs will deleted. Perform a backup!'''&lt;br /&gt;
&lt;br /&gt;
 umount /home/user/MyDocs&lt;br /&gt;
create a new partition layout in file &amp;quot;table&amp;quot; (here 8 GB MyDocs were used for an extended partition with 3+5 GB partitions):&lt;br /&gt;
 unit: sectors&lt;br /&gt;
 /dev/mmcblk0p1 : start=       64, size= 39854080, Id= 0&lt;br /&gt;
 /dev/mmcblk0p2 : start= 39854144, size= 16777216, Id= 5&lt;br /&gt;
 /dev/mmcblk0p3:  start= 56631360, size=  4194304, Id=83&lt;br /&gt;
 /dev/mmcblk0p4 : start= 60825664, size=  1572864, Id=82&lt;br /&gt;
 /dev/mmcblk0p5 : start= 39854160, size=  9765680, Id=83&lt;br /&gt;
 /dev/mmcblk0p6 : start= 49619856, size=  7011504, Id=83&lt;br /&gt;
continue with&lt;br /&gt;
 sfdisk --no-reread /dev/mmcblk0 &amp;lt; table # change partition table&lt;br /&gt;
 reboot; exit # reboot to re-read new table&lt;br /&gt;
after reboot&lt;br /&gt;
 sfdisk -c /dev/mmcblk0 1 c # optional (safer): change FAT to ext3 id &lt;br /&gt;
 mkfs.vfat -F32 /dev/mmcblk0p1  # recreate VFAT on MyDocs&lt;br /&gt;
 mkfs.ext3 /dev/mmcblk0p5&lt;br /&gt;
 mkfs.ext3 /dev/mmcblk0p6&lt;br /&gt;
reboot and restore MyDocs&lt;br /&gt;
&lt;br /&gt;
=== Solution #3: arbitrary size for /home and MyDocs ===&lt;br /&gt;
TODO, see also [[User:Ruskie#Repartitioning]]&lt;br /&gt;
&lt;br /&gt;
'''Warning: /home and MyDocs will be deleted. Backup everything.'''&lt;br /&gt;
Backup all settings (to your computer or SD), reflash, restore the settings and install rootsh (no other applications!).&lt;br /&gt;
&lt;br /&gt;
create your new partition table layout in the file &amp;quot;table&amp;quot;.&lt;br /&gt;
Make sure all partitions are aligned to 32 KB and sizes are multiples of 32 KB.&lt;br /&gt;
The sectors are 512 bytes, so the block counts must multiplied by 2.&lt;br /&gt;
For example, 2GB= 4194304 blocks. Each partition should start at start+size of the previous partition.&lt;br /&gt;
The first partition must start at 64. Make sure to keep the swap partition (the number may be changed).&lt;br /&gt;
Initially set the id of your partition to 0 so that they are not mounted at reboot.&lt;br /&gt;
An example layout with 2 GB part1 and 27 GB part2:&lt;br /&gt;
 unit: sectors&lt;br /&gt;
 /dev/mmcblk0p1 : start=       64, size= 4194304 , Id=0&lt;br /&gt;
 /dev/mmcblk0p2 : start= 4194368, size=  56631296, Id=0&lt;br /&gt;
 /dev/mmcblk0p3 : start= 60825664, size=  1572864, Id=82&lt;br /&gt;
 /dev/mmcblk0p4 : start=        0, size=        0, Id= 0&lt;br /&gt;
(Optional) Dump your current partition table with the following command&lt;br /&gt;
 sfdisk -d /dev/mmcblk0 &amp;gt; table&lt;br /&gt;
continue with&lt;br /&gt;
 sfdisk --no-reread /dev/mmcblk0 &amp;lt; table # change partition table&lt;br /&gt;
 reboot; exit&lt;br /&gt;
The device creates a default /home in NAND.&lt;br /&gt;
Now change the parition ids and create the file systems&lt;br /&gt;
 sfdisk -c /dev/mmcblk0 1 c&lt;br /&gt;
 mkfs.vfat -F32 -s64 /dev/mmcblk0p1&lt;br /&gt;
 sfdisk -c /dev/mmcblk0 2 83&lt;br /&gt;
 mkfs.ext3 /dev/mmcblk0p2&lt;br /&gt;
if you have change to location or size of swap run&lt;br /&gt;
 mkswap &amp;lt;swap-partition&amp;gt;&lt;br /&gt;
finish with&lt;br /&gt;
 rm -rf /home/user&lt;br /&gt;
 reboot; exit&lt;br /&gt;
finally restore all your backups&lt;br /&gt;
&lt;br /&gt;
=== Solution #4: single large /home partition, loopback for USB ===&lt;br /&gt;
TODO, see [http://talk.maemo.org/showpost.php?p=425359&amp;amp;postcount=68 how to implement USB mass storage with a loopback file]&lt;br /&gt;
&lt;br /&gt;
like solution #3, but don't create a MyDocs partition.&lt;br /&gt;
&lt;br /&gt;
how to create a sparse 1GB loopback file:&lt;br /&gt;
 dd if=/dev/zero of=FAT1GB bs=1M seek=1024 count=0 # small 256MB image&lt;br /&gt;
 losetup /dev/loop0 FAT1GB&lt;br /&gt;
 mkfs.vfat -F32 /dev/loop0&lt;br /&gt;
 vi /etc/fstab # replace /dev/mmcblk0p2 with /dev/loop0&lt;br /&gt;
 mount MyDocs&lt;br /&gt;
&lt;br /&gt;
=== Solution #5: Edit eMMC image (works on PR1.2, by globalbus) ===&lt;br /&gt;
Backup MyDocs, we need to flash device.&lt;br /&gt;
Open eMMC image in hex editor, go to 0xcb, you will see this&lt;br /&gt;
 partition {size = 2048;fs_type = &amp;quot;ext3&amp;quot;;prefix = &amp;quot;home&amp;quot;;}&lt;br /&gt;
Edit size parameter (do not change the size of file! The number must be from 1000 to 9999) Flash it now.&lt;br /&gt;
&lt;br /&gt;
If MyDocs have incorrect size or it's not mounting automatically you need to format it and paste files from backup.&lt;br /&gt;
 umount /dev/mmcblk0p1&lt;br /&gt;
 mkfs.vfat -F32 -s64 /dev/mmcblk0p1&lt;br /&gt;
 mount /dev/mmcblk0p1&lt;br /&gt;
&lt;br /&gt;
=== Solution #6: Custom repartitioning from a linux PC ===&lt;br /&gt;
Taken from [http://wiki.meego.com/ARM/N900/Using_Rescue_Initrd Using Rescue Initrd - MeeGo Wiki].&lt;br /&gt;
&lt;br /&gt;
'''This way is only intended for users who have partitioned their systems before. Your files will not be affected unless you explicitly ask your partitioner to do so although there's nothing wrong with taking extra care and backing up your files'''&lt;br /&gt;
&lt;br /&gt;
Install [http://wiki.maemo.org/Documentation/Maemo_5_Developer_Guide/Development_Environment/Maemo_Flasher-3.5 flasher-3.5] on your box.&lt;br /&gt;
&lt;br /&gt;
Get the rescue kernel and initrd rpm and extract them in a directory:&lt;br /&gt;
  &amp;lt;pre&amp;gt;mkdir n900-rescue-initrd&lt;br /&gt;
cd n900-rescue-initrd&lt;br /&gt;
wget http://repo.meego.com/MeeGo/releases/1.0/core/repos/armv7l/packages/armv7l/nokia-n900-rescue-initrd-0.1-1.3.armv7l.rpm&lt;br /&gt;
wget http://repo.meego.com/MeeGo/releases/1.0/core/repos/armv7l/packages/armv7l/kernel-n900-2.6.33.3-11.2.armv7l.rpm&lt;br /&gt;
rpm2cpio nokia-n900-rescue-initrd-0.1-1.3.armv7l.rpm | cpio -vid &lt;br /&gt;
rpm2cpio kernel-n900-2.6.33.3-11.2.armv7l.rpm  | cpio -vid &amp;lt;/pre&amp;gt;&lt;br /&gt;
Now you're ready to boot the device:&lt;br /&gt;
&lt;br /&gt;
Turn off your N900 by removing the battery.&lt;br /&gt;
&lt;br /&gt;
Start flasher:&lt;br /&gt;
  &amp;lt;pre&amp;gt;sudo flasher-3.5 -k boot/vmlinuz-2.6.33.3-11.2-n900 -n boot/initrd.img-rescue-2.6.33.3-11.2-n900 -l -b&amp;quot;rootdelay=1 root=/dev/ram0&amp;quot; --set-rd-flags=no-omap-wd --set-rd-flags=no-ext-wd --enable-rd-mode&amp;lt;/pre&amp;gt;&lt;br /&gt;
Connect N900 to your PC.&lt;br /&gt;
&lt;br /&gt;
Press U on the keyboard and keep holding it.&lt;br /&gt;
&lt;br /&gt;
Put the battery back in.&lt;br /&gt;
&lt;br /&gt;
Wait for the device to boot and press U to enable USB storage mode. The device is now added to the list of your storage devices as an increment of /dev/sd.&lt;br /&gt;
&lt;br /&gt;
Partition it using your favorite partitioner (GParted recommended)&lt;br /&gt;
&lt;br /&gt;
''' Don't forget to repeat the &amp;quot;Start flasher&amp;quot; procedure with '''&amp;lt;code&amp;gt;sudo flasher-3.5 --disable-rd-mode&amp;lt;/code&amp;gt; '''to disable R&amp;amp;D mode.'''&lt;br /&gt;
&lt;br /&gt;
lol?&lt;br /&gt;
&lt;br /&gt;
=== Solution #7: arbitrary size for /home and MyDocs (PR 1.2/3 compatible) ===&lt;br /&gt;
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!'''&lt;br /&gt;
&lt;br /&gt;
Prerequisites:&lt;br /&gt;
*Partition the MicroSD card so that it has a partition big enough to hold all data on /home (which is 2gb at its max). &lt;br /&gt;
*Format this partition as ext3. I'll assume you've only made one big partition (which will be /dev/mmcblk1p1 in Maemo).&lt;br /&gt;
*Make sure you've read and understood solution #3 completely, as this one is based on it&lt;br /&gt;
&lt;br /&gt;
This method involves moving /home. If you mess up the device names, format incorrectly or copy /home wrongly, Maemo will get into an infinite reboot loop, requiring a reflash to restore!!&lt;br /&gt;
&lt;br /&gt;
-Mount your freshly partitioned and formatted MicroSD card&lt;br /&gt;
 mount /dev/mmcblk1p1 /mnt&lt;br /&gt;
&lt;br /&gt;
-Unmount MyDocs (after backing it up ;)&lt;br /&gt;
 umount /home/user/MyDocs&lt;br /&gt;
&lt;br /&gt;
-Copy /home to your MicroSD card (assuming one big ext3 partition)&lt;br /&gt;
 cp -a /home/* /mnt&lt;br /&gt;
&lt;br /&gt;
-Open /usr/lib/genfstab.awk and comment out the following pieces of code&lt;br /&gt;
 start == 1 &amp;amp;&amp;amp; $6 == 83 &amp;amp;&amp;amp; !__home {&lt;br /&gt;
        printf &amp;quot;%s /home ext3 %s 0 0\n&amp;quot;, $1, home_opts            &lt;br /&gt;
         printf &amp;quot;/home/opt /opt none bind\n&amp;quot;&lt;br /&gt;
         __home++&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 start == 1 &amp;amp;&amp;amp; $6 == &amp;quot;c&amp;quot; &amp;amp;&amp;amp; !__fat {&lt;br /&gt;
        printf &amp;quot;%s /home/user/MyDocs vfat %s 0 0\n&amp;quot;, $1, fat_opts&lt;br /&gt;
        __fat++&lt;br /&gt;
 }&lt;br /&gt;
This will make sure the default /home and MyDocs won't get mounted on reboot.&lt;br /&gt;
&lt;br /&gt;
-Open /etc/event.d/rcS-late, find the line '-f /usr/lib/genfstab.awk &amp;gt; $tmp_fstab' and add this below it&lt;br /&gt;
 echo &amp;quot;/dev/mmcblk1p1 /home ext3 rw,noatime,errors=continue,commit=1,data=writeback 0 0&amp;quot; &amp;gt;&amp;gt; $tmp_fstab&lt;br /&gt;
 echo &amp;quot;/home/opt /opt none bind&amp;quot; &amp;gt;&amp;gt; $tmp_fstab&lt;br /&gt;
Maemo will then use the MicroSD ext3 partition (containing a copy of your /home) as the new /home after a reboot&lt;br /&gt;
&lt;br /&gt;
-Reboot your phone now. If all went well, you should notice no difference between now and the situation before you started, except for that MyDocs is unavailable. If it is available, you can unmount it with 'umount /home/user/MyDocs'&lt;br /&gt;
&lt;br /&gt;
-Now we can repartition the flash, as it is unused right now (except for the swap partition). An example layout with 2 GB MyDocs and 27 GB /home: &lt;br /&gt;
 unit: sectors&lt;br /&gt;
 /dev/mmcblk0p1 : start=       64, size= 4194304 , Id=c&lt;br /&gt;
 /dev/mmcblk0p2 : start= 4194368, size=  56631296, Id=83&lt;br /&gt;
 /dev/mmcblk0p3 : start= 60825664, size=  1572864, Id=82&lt;br /&gt;
 /dev/mmcblk0p4 : start=        0, size=        0, Id= 0&lt;br /&gt;
Save the above code as a plain text file (eg. as table)on your N900. Use Id=c for MyDocs (FAT), 83 for EXT partitions and 82 for swap partition.&lt;br /&gt;
&lt;br /&gt;
-Apply the partition table by running the following command in the same directory as the table file:&lt;br /&gt;
 sfdisk --no-reread /dev/mmcblk0 &amp;lt; table &lt;br /&gt;
&lt;br /&gt;
-Reboot the phone&lt;br /&gt;
&lt;br /&gt;
-Format the newly created large partition as ext3&lt;br /&gt;
 mkfs.ext3 /dev/mmcblk0p2&lt;br /&gt;
&lt;br /&gt;
-And the fresh smaller one as FAT for MyDocs&lt;br /&gt;
 mkfs.vfat -F32 -s64 /dev/mmcblk0p1&lt;br /&gt;
&lt;br /&gt;
-Mount the ext3 partition as /mnt&lt;br /&gt;
 mount /dev/mmcblk0p2 /mnt&lt;br /&gt;
&lt;br /&gt;
-Copy you /home back&lt;br /&gt;
 cp -a /home/* /mnt&lt;br /&gt;
&lt;br /&gt;
-Open /usr/lib/genfstab.awk again and uncomment the code you've previously commented.&lt;br /&gt;
&lt;br /&gt;
-Remove the lines from /etc/event.d/rcS-late you've added before&lt;br /&gt;
&lt;br /&gt;
Reboot again and you're done!. The great part is with the aid of a MicroSD card, you can truly partition exactly as you like. For example: you can also create a swap partition on the sd card, comment out the swap part of genfstab.awk, add an &amp;quot;echo &amp;quot;/dev/mmcblk1p'''X''' none swap sw 0 0&amp;quot; &amp;gt;&amp;gt; $tmp_fstab&amp;quot; to rcS-late (where X is the MicroSD swap partition). This will allow you to repartition the swap partition on the eMMC (or completely remove it, so that only the MicroSD card will be used as swap (for discussion about this see [http://talk.maemo.org/showthread.php?p=846082 this thread]. As long as you edit rcS-late and genfstab.awk correcly, you can partition without restrictions&lt;br /&gt;
&lt;br /&gt;
P.s. Solution #4 applies in the same way to this solution, as to #3&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [https://maemo.org/community/brainstorm/view/more_efficient_and_flexible_use_of_internal_flash brainstorm] and [http://talk.maemo.org/showthread.php?t=37869 discussion]&lt;br /&gt;
* [http://talk.maemo.org/showthread.php?t=35122 Repartitioning the flash]&lt;br /&gt;
&lt;br /&gt;
[[Category:Power users]]&lt;br /&gt;
[[Category:N900]]&lt;/div&gt;</description>
			<pubDate>Fri, 31 Dec 2010 13:38:48 GMT</pubDate>			<dc:creator>62.12.64.189</dc:creator>			<comments>http://bugs.maemo.com/Talk:Repartitioning_the_flash</comments>		</item>
	</channel>
</rss>