====== Server Rootfs To Sata Drive ======
//__About this Article__//
* **Author**: benn --- benn@cubietech.com --- 2013/10/20 22:47
* **Copyrights**: [[http://creativecommons.org/licenses/by-sa/3.0/|CC Attribution-Share Alike 3.0 Unported]]
* **Contributors**: [[http://cubieboard.org/|Cubieboard Community]] : ...
===== Abstract =====
Allwinner's A20 SoC doesn't support booting from sata drive directly. But we can still install linux distro to sata drive on cubietruck, by putting bootloader/kernel onto nandflash, and rootfs to sata drive, making a really mini computer. This manual will tell you how to install lubuntu desktop/server on cubietruck.
===== How We Implement It ?=====
* Add a bootsata boot parameter, and parse it at ramdisk
* Write bootloader / kernel to nandflash
* When there is no sata, system will use the rootfs on nand
===== What We Can Benefit From It? =====
====Much more storage space====
Easily up to 2TB storage
====Better performance with SSD drive====
Much more IO read/write throughput and IOPS, resulting in system more smoothly
===== Supported Firmwares =====
====Lubuntu Desktop====
Because we need to modify ramdisk and boot parameter, so not all the firmwares support sata drive installation.
* [[http://dl.cubieboard.org/software/a20-cubietruck/lubuntu/obsolete/ct_lubuntu_desktop_12.10_20131018/ct_lubuntu_desktop-hdmi.img.gz|ct_lubuntu_desktop-hdmi.img.gz(20131018-build) - default HDMI output]]
* [[http://dl.cubieboard.org/software/a20-cubietruck/lubuntu/obsolete/ct_lubuntu_desktop_12.10_20131018/ct_lubuntu_desktop-vga.img.gz|ct_lubuntu_desktop-vga.img.gz(20131018-build) - default VGA output]]
====Lubuntu Server====
* [[http://dl.cubieboard.org/software/a20-cubietruck/lubuntu/obsolete/ct_lubuntu_server_13.06_20131018/ct-lubuntu-server-hdmi.img.gz|ct-lubuntu-server-hdmi.img.gz(20131018-build) - default HDMI output]]
* [[http://dl.cubieboard.org/software/a20-cubietruck/lubuntu/obsolete/ct_lubuntu_server_13.06_20131018/ct-lubuntu-server-vga.img.gz|ct-lubuntu-server-vga.img.gz(20131018-build) - default VGA output]]
===== Installation Guide =====
We take this [[http://dl.cubieboard.org/software/a20-cubietruck/lubuntu/obsolete/ct_lubuntu_desktop_12.10_20131018/ct_lubuntu_desktop-hdmi.img.gz|ct_lubuntu_desktop-hdmi.img.gz(20131018-build) - default HDMI output]] image as example. The following steps demonstrates on installing lubuntu desktop to sata drive.
==== Download Firmware ====
$wget http://dl.cubieboard.org/software/a20-cubietruck/lubuntu/ct_lubuntu_desktop_20131018/ct_lubuntu_desktop-hdmi.img.gz
$gzip -d ct_lubuntu_desktop-hdmi.img.gz
==== Flash the Image to Nandflash ====
Refer to this [[http://docs.cubieboard.org/tutorials/ct1/installation/cb3_lubuntu-12.10-desktop_nand_installation_20130910-build|Installation Guide]] to flash the image to nand with livesuit.
==== Write rootfs to SATA drive ====
After flashing the image to nandflash, your board can run lubuntu desktop already, next we just copy the rootfs to sata drive's 1st partition
- Start up lubuntu desktop system on nand
- Plug in sata drive
- Create a new partition for your sata drive
- Copy rootfs to the 1st partition
#dd if=/dev/nandd of=/dev/sda1 bs=1M
#sync
#reboot
===== See Also =====
{{tag>Cubieboard Cubietruck}}