Cubieboard2 and Lubuntu: How to expand the NAND partition to 4GB

If you want a quick install for Lubuntu 14.04, please, read this post ;)

We installed Lubuntu into a Cubieboard2. But the NAND is using just 2GB of 4GB available:
linaro@cubieboard2:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       2.0G  1.2G  698M  64% /
devtmpfs        406M  4.0K  406M   1% /dev
tmpfs            20M  4.0K   20M   1% /tmp
none             82M  208K   81M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            406M  4.0K  406M   1% /run/shm
none            100M   12K  100M   1% /run/user


linaro@cubieboard2:~$ cat /proc/partitions


major minor  #blocks  name

  93        0    3891200 nand
  93        1      65536 nanda
  93        2    2097152 nandb
  93        3    1712128 nandc


We need to work from a Live OS. Install Cubian into the microSD from its great wiki and connect to a monitor or you can use SSH too (There is a solved problem. You have to use the port 36000, user cubie, password cubie:
ssh -p 36000 cubie@The_Cubian_IP)

Discover your current NAND partition (as root):

root@Cubian:~# nand-part | tail
3 partitions
partition  1: class =         DISK, name =   bootloader, partition start =    32768, partition size =   131072 user_type=0
partition  2: class =         DISK, name =       rootfs, partition start =   163840, partition size =  4194304 user_type=0
partition  3: class =         DISK, name =        UDISK, partition start =  4358144, partition size =  3375104 user_type=0

We will play with the numbers now. See the colours ;)
nand-part -f a20 /dev/nand 32768 "bootloader 131072" "rootfs 7569408"
fsck -f /dev/nandb
resize2fs /dev/nandb


What did we do with nand-part?
  • We joined nandb & nandc.
  • -f a20: It's for the Cubieboard2, with its CPU A20
  • 32768: it's where is starting the first sector
  • bootloader 131072: Will not change, then we will put the same partition name/size
  • rootfs 7569408: This is the key: 
    4194304
     + 
    3375104 =
     7569408
Then you need to check the partition by errors with fsck and resize to the 4GB.
Reboot and you'll have Lubuntu into your Cubieboard2 with 4GB! :)

No comments:

Post a Comment