NAND flash partition scheme

Started by oldpenguin, October 31, 2013, 01:53:16 PM

Previous topic - Next topic

oldpenguin

Hello

Is there any way to change the partition scheme of the nand flash on the A13 ?

Currently there seem to exist 4 partitions:

/dev/nanda 67MB (FAT16 ??)
/dev/nandb 2 MB (u-boot environment ?)
/dev/nandc 2277MB (ext4)
/dev/nandd 1636MB (free)

Actually I have managed to change the size of the 3rd partition by editing sys_config_linux.fex file on allwinner-tools/livesuit/default
But I would like to get rid of the 4th partition alltogether and use all available space on partition /dev/nandc

Has anyone done this ?


davidefa

I think that nand-part ( here is nand-part I crosscompiled for arm, so use at your own risk ) should be used.
How is nand-part used ( see this thread on cubieforum )?
Here is the result of the following commands on my board:

./nand-part -h
usage: ./nand-part nand-device 'name2 len2' ['name3 len3'] ...

./nand-part
check partition table copy 0: OK
check partition table copy 1: OK
check partition table copy 2: OK
check partition table copy 3: OK
partition  0: name =   bootloader, partition start =    32768, partition size =   131072
partition  1: name =          env, partition start =   163840, partition size =    32768
partition  2: name =       rootfs, partition start =   196608, partition size =  4448576
partition  3: name =        UDISK, partition start =  4645184, partition size =  3137216
4 partitions


I already loaded on the flash a debian image linked in another thread on this forum

Wondering:
- why you can specify only name2 len2... ( this means you can't resize partition1? )?
- is this len2 the size of partition2 ( as the name implies ) or is the starting point ( should solve the previouse question )?
- what is the 'dimension' if len2 ( bytes, blocks... )?

oldpenguin

Thank you Davide
Fascinating stuff. I wasn't even aware of nand-part.
My system configuration is a little different though (formatted by Livesuit):
root@debian:~# ./nand-part   
check partition table copy 0: OK
check partition table copy 1: OK
check partition table copy 2: OK
check partition table copy 3: OK
partition  0: name =   bootloader, partition start =     2048, partition size =   131072
partition  1: name =          env, partition start =   133120, partition size =     4096
partition  2: name =       rootfs, partition start =   137216, partition size =  4448576
partition  3: name =        UDISK, partition start =  4585792, partition size =  3196608
4 partitions

I wonder what the values mean. I'm looking right now to the source code and will try to understand how it works. At first glance the values seem to be 512 bytes blocks, because in sysconfig_linux.fex I have set my 3rd partition to 2224288 KBytes which translates exactly to 4448576.
I've also come across this interesting thread https://www.olimex.com/forum/index.php?topic=1628.0
There's also some information here http://linux-sunxi.org/Building_on_Debian#Installing_to_nand
So I'm surely going to blow some flash now  ;)
Thanks
António