İçeriğe geç

pcDuino | Backup NAND Flash Memory to MicroSD Card for Boot from microSD

pcDuino has an onboard NAND of 2 GB. When we are doing heavy duty project development, we can easily eat up all the space. When that happens, we need a way to move all the program and data from NAND to as SD of larger capacity and make that SD bootable.

The key function we are going to use is:

make_mmc_boot “Clone system from nand to mmc card”

This function will copy the entire content in NAND to a SD card. This is equivalent to flash an mmc-boot image. The benefit is that users still keep their own program / data. When the space NAND is not enaugh, we can use the SD card to replace the system in NAND.

When this article written, the latest image release is 2013-05-31. In the original image 2013-05-31, the above mentioned function is not there in board-config. We need to do an update in board-config to make it avaliable.

There are two ways to run board-config. One is to run that after reset. The other is to run it in terminal.

In the following, we are going to use the second approach. We type:

$sudo board-config.sh

Next, we are going to choose ‘Update’:

Then we choose ‘config’:

After that, pcDuino will check for update:

Press ‘Y’, and after the update is down, exit and re-run:

$sudo board-config.sh

The option “make_mmc_boot” will display in the menu:

Plug in a SD card (in our case, a card of 16GB) to the SD slot, and press “ENTER”:

It takes some time to backup:

After a long wait, we will get the following message:

We reboot pcDuino, and check the storage space using:

$df –h

In the above figure, we can see that although the SD card is of capacity 16GB, it only shows up as 2GB.

We are going to use a script to expand the file system to the whole SD card.

$wget https://s3.amazonaws.com/pcduino/SampleCode/System/expandFS/expand_sdcard_rootfs.sh

$sudo bash ./expand_sdcard_rootfs.sh

After the expansion, we reboot pcDuino by:

$sudo reboot

After reboot, we run:

sudo resize2fs /dev/mmcblk0p2

Check the storage space again using

$df -h

We can see that we get a full access to the SD card.


İlk Yorumu Siz Yapın

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir