I have a CubieBoard 1 with a A10 CPU.
Install Ubuntu into the NANDYou can install a distro into a microSD card or into the internal NAND memory. For the best performance install Ubuntu into the NAND, you'll have 4GB and you can attach an external hard disk or the integrated microSD too.
You can install an Ubuntu image into the NAND with the LiveSuit app. I installed Lubuntu Server with LiveSuit app for Windows (My Cubie didn't enter in the FEL Mode with LiveSuit for Linux).
Resize the NAND partitions
Current layoutThe system has a really strange partitions:
$ sudo sfdisk -s
$ sudo df -h Filesystem Size Used Avail Use% Mounted on /dev/nandc 1009M 495M 469M 52% / none 405M 0 405M 0% /tmp /dev/nandd 497M 295M 178M 63% /lib none 4.0K 0 4.0K 0% /sys/fs/cgroup none 81M 236K 81M 1% /run none 5.0M 0 5.0M 0% /run/lock none 405M 0 405M 0% /run/shm none 100M 0 100M 0% /run/user
I'm losing 2GB in the nande partition :O
I'd like to have nandc (/), nandd (/lib) & nande together. We have to do this from a distro running from the microSD card. I'll use Cubian (Debian) because it has preinstalled the tool for that.
Run Cubian from SD cardInstall Cubian from its great wiki and connect to Cubian by SSH. There is a solved problem. You have to use the port 36000, user cubie, password cubie:
ssh -p 36000 cubie@The_Cubian_IP
Make a backup into your SD:
sudo su -
dd if=/dev/nand conv=sync,noerror bs=64K | gzip -c -9 > /nand.ddimg.gz
Discover your current NAND partition (as root):
root@Cubian:~# 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 = 2097152 partition 3: name = libs, partition start = 2234368, partition size = 1048576 partition 4: name = UDISK, partition start = 3282944, partition size = 4696064 5 partitionsWell, well... we're in the hard step.
The Ubuntu system is using the partition 3 as /lib, we have to backup it, because it will be erased (as root too):
mkdir /lib_aux ; mkdir /media/lib
mount /dev/nandd /media/lib
We'll join the partition 2, 3 and 4 with this command (as root too):
nand-part /dev/nand "env 4096" "rootfs 7841792"
fsck -f /dev/nandc
The explanation is this (follow the colours): you will run the command: nand-part over the NAND memory: /dev/nand. And you'll set your new layout. You'll omit the first boot size partition (131072) because nand-part will autoreserve that partition:
"env 4096"Same label/size for avoid changes in the Ubuntu boot.
rootfs 7841792"This is the final partition for Ubuntu (~4GB): 2097152 + 1048576 + 4696064. This will preserve your Ubuntu system from the "rootfs" partition, but it'll delete the contents of "libs" and "DISK".
Now, restore your /lib in Ubuntu (as root too):
cp -rp /lib_aux/*
vi /etc/mtab # Remove inside the file the line with /lib string
Reboot your UbuntuThe resize is done :D Poweroff and extract your microSD. Ubuntu will boot with all the space in the NAND:
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/nandc 3.7G 856M 2.7G 24% /
none 405M 0 405M 0% /tmp
none 4.0K 0 4.0K 0% /sys/fs/cgroup
none 81M 216K 81M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 405M 0 405M 0% /run/shm
none 100M 0 100M 0% /run/user