11-06-2012, 09:08 AM | #46 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
|
05-02-2016, 03:32 PM | #47 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
That is TOTALLY normal. In fact, a standard MBR partition table can only have FOUR primary partitions. Any additional partitions must be in an extended partition (which has its own partition table). This is exactly what you are seeing -- p4 is an extended partition. This is normal on anything with an MBR partition table (which works on pretty much any computer or embedded device, as opposed to GPT partitions which are typically restricted to large powerful devices).
|
Advert | |
|
05-05-2016, 08:11 PM | #48 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
As I mentioned above, adding a fifth primary partition to an MBR partition table is a bad idea. Leaving it as unused space and then using it anyway is an ugly hack. The right way is to shorten the first logical partition in the extend partition table in mmpblk0p4. I will list the master and extended partition tables here (this is on a K5):
Code:
[root@kindle us]# sfdisk -l /dev/mmcblk0
Disk /dev/mmcblk0: 120832 cylinders, 4 heads, 16 sectors/track
Units = cylinders of 32768 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System
/dev/mmcblk0p1 * 1024 12223 11200 358400 83 Linux
/dev/mmcblk0p2 12224 14271 2048 65536 83 Linux
/dev/mmcblk0p3 14272 15295 1024 32768 83 Linux
/dev/mmcblk0p4 15296 120831 105536 3377152 b W95 FAT32
[root@kindle us]# sfdisk -l /dev/mmcblk0p4 --force
Disk /dev/mmcblk0p4: 105536 cylinders, 4 heads, 16 sectors/track
Units = cylinders of 32768 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System
/dev/mmcblk0p4p1 0+ 105535 105536- 3377144 b W95 FAT32
/dev/mmcblk0p4p2 0 - 0 0 0 Empty
/dev/mmcblk0p4p3 0 - 0 0 0 Empty
/dev/mmcblk0p4p4 0 - 0 0 0 Empty
[root@kindle us]#
As shown above, the extended partition table (inside mmcblk0p4) has three empty extended partitions available. Placing multiple partitions inside mmcblk0p4 *should* allow them to be exported to some host operating systems (though windows tends to only show the first partition on USB flash devices). And just to prove that mmcblk0p4 is special (includes its own partition table), here is an example of trying to list the partitions in mmcblk0p3: Code:
[root@kindle us]# sfdisk -l /dev/mmcblk0p3 --force
Disk /dev/mmcblk0p3: 1024 cylinders, 4 heads, 16 sectors/track
sfdisk: ERROR: sector 0 does not have an msdos signature
/dev/mmcblk0p3: unrecognized partition table type
No partitions found
[root@kindle us]#
Last edited by geekmaster; 05-05-2016 at 09:17 PM. |
05-05-2016, 09:12 PM | #49 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
And the "userstore" script contains this code snippet (with env vars resolved):
PHP Code:
It might be a little more obvious what is going on here if they had created device nodes for the extended partitions, instead of loop mounting with offsets (though it helps that the offsets and sizes are calculated using partition information returned by sfdisk). It should be "relatively" easy to shrink mmcblk0p4p1 and add mmcblk0p4p2. And with a little luck, USB-exporting mmcblk0p4 would also automagically export its internal extended partitions (even though windows may choose to ignore all but the first). A sane OS like linux should see all the partitions defined in the extended partition table shared over USB. EDIT: I have been reading lots of kindle system (and installer update) scripts, trying to eduficate myself on this subject. This topic seemed appropriate to post these little notes to myself (and anybody else who may benefit from them). Last edited by geekmaster; 05-05-2016 at 09:29 PM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PRS-T1 Questions about repartitioning | simongee | Sony Reader Dev Corner | 47 | 11-06-2012 05:07 AM |
Kindle Touch: Bricked and readonly filesystem | pmugabi | Kindle Developer's Corner | 6 | 09-17-2012 01:50 AM |
PRS-T1 Completed guide for repartitioning. | homeos | Sony Reader Dev Corner | 20 | 04-05-2012 11:54 AM |
PB360 Filesystem error | ArchCarrier | PocketBook | 4 | 06-06-2010 08:46 AM |
Stock kindle 2 filesystem (2.0.3 or newer preferred) | eousphoros | Kindle Developer's Corner | 10 | 02-17-2010 08:40 PM |