====== Cb3 A20-android System Boot From Sata ======
//__About this Article__//
* **Author**: james --- james@cubietech.com --- 2013/11/04 09:34
* **Copyrights**: [[http://creativecommons.org/licenses/by-sa/3.0/|CC Attribution-Share Alike 3.0 Unported]]
* **Contributors**: [[http://cubieboard.org/|Cubieboard Community]] : ...
===== Copy the System File =====
At first , connect Cubietruck by USB ,and open terminal:
$adb shell
So you will input the Android-Shell Command-Line,and see where the system file mounted:
$mount
{{:tutorials:ct1:build_net01_069.png|}}
You can see the block /dev/block/system mount on /system,
then you connect SATA with Cubietruck,and see what block is the SATA:
$ls /sys/devices/platform/sw_ahci.0/ata1/host0/target0:0:0/0:0:0:0/block
You will see the SATA block(maybe it's sdb, sdc or sdd,but it's no problem):
{{:tutorials:ct1:build_net01_072.png|}}
Now you know the block,use this command:
$dd if=/dev/block/system of=/dev/block/sda(Your SATA block)
Just wait for about 1 minutes,it will success:
{{:tutorials:ct1:build_net01_073.png|}}
===== Modify the SDK =====
After you copy the system file to SATA,you should modify SDK:
$cd V2.0_A20/android/devices/softwinner/sugar-cubietruck/ && ls
$vim init.sun7i.rc
And "mount ext4 /dev/block/system" changes to "mount ext4 /dev/block/sda",like that:
{{:tutorials:ct1:build_net01_-work-cubietruck_android-android42-device-softwinner-sugar-cubietruck_074.png|}}
Save and quit,complie the android image.If you don't konw how to complie,refer to [[http://docs.cubieboard.org/tutorials/ct1/installation/cb3_a20-compiling_android_image_for_cubietruck|here]]
**After compile success,do this:**
*Install the new image to Cubietruck.
*Connect the SATA first( must first! If you don't do this it wouldn't boot)
*Charge it with electricity,you will see it Boot from SATA.
{{tag>Cubieboard Cubietruck}}