Repartition the Kindle
Work in progress
Contents |
[edit] Rationale and Overview
The largest partition of the Kindle flash memory is the user store which runs a FAT file system. The idea is to shrink the user store partition to have free space for a independent partition.
To avoid any troubles and heavy modifications of the Kindle configuration and scripts it is best not to change partition numbering.
There are two different ways to use free space on the Kindle flash memory after shrinking user store partition:
- add a new partition after the user store partition
- resize diags partition
1. is simple, but
- one cannot directly boot into that new extended partition
- the diags partition cannot be used to increase the new partition
2. is more work because existing partitions have to be moved
Due to the shrinking of the user store partition this file system is destroyed and need to be backed-up first.
[edit] Adding a new partition after the user store partition
[edit] Resizing Diags Partition
[edit] First Preparations of the Kindle
On K4: Stop framework
/etc/init.d/framework stop
[edit] Back up User Store and preferably all other Partitions
It should be possible to copy only the files in the user store with something like "cp -r". But in order to prepare for possible undoing later it is better to dd the whole partition.
Setup dd receiver on PC:
nc -l -p 35689 | dd of=mmcblk0p4.img
On Kindle: send partition data to PC:
dd if=/dev/mmcblk0p4.img|nc <ip_add_of_PC> 35689
This transfer takes some time. On PC progress can be monitored with
ls -l mmcblk0p4.img
[edit] Make new User Store Partition with new Size
dd if=/dev/zero of=new_mmcblk0p4.img bs=1 count=<new_size> mkfs.vfat new_mmcblk0p4.img mkdir /mnt/new_kindle mount -o loop -t vfat new_mmcblk0p4.img /mnt/new_kindle mkdir /mnt/old_kindle mount -o offset=8192,loop -t vfat mmcblk0p4.img /mnt/old_kindle cp -r /mnt/old_kindle/<what_you_want> /mnt/new_kindle/ umount /mnt/old_kindle umount /mnt/new_kindle
[edit] Resize and Move User Store Partition
[edit] Move other Partitions
[edit] Resize Diags Partition
[2] Discussion