You are here: romanrm.net » Using the Allwinner A10/A20 as a home server » Installing the A10 Debian "Server" image to an USB or SATA HDD/SSD
Installing the A10 Debian "Server" image to an USB or SATA HDD/SSD
Summary
The A10 devices are very well known for their ability to load any compatible OS from a bootable SD card.
However there is now a possibility to run a GNU/Linux OS on these devices with root filesystem placed not on an SD card(which is prone to wear out from writes), but on a HDD or SSD drive connected via USB or SATA (in case of devices featuring a SATA connector or slot).
An SD card is still required for boot-up; the /boot
partition needs to be there. But the card will only contain u-boot, a couple of configuration files and the kernel. The rest of the OS will be on the HDD.
Scope
The following information is applicable to my Debian “server” image for the A10 devices:
The general principle should be the same, assuming you use a recent version of u-boot.
Step-by-step
1. Prepare a bootable SD card and boot from it
Follow all the instructions from the main article.
Even though you plan to boot from an HDD, you should first try booting up from the prepared SD card, to ensure that the image itself works fine for you in the first place, and any further problems you may face are specifically related to HDD/SSD set-up.
2. Prepare the HDD
Write the image to the HDD you plan to use, in the same way as you wrote it to the SD card:
bzip2 -dc a10-debian-server-2gb*.bz2 > /dev/sdX
Note that all data that previously was on the HDD will be lost. /dev/sdX
is its device name, e.g. /dev/sdj
(double-check you use the correct device name, to not overwrite data on a different HDD).
No need to do anything with boot-loader, script.bin
or kernel on “the HDD copy” of the image; all of those will be loaded from the SD card, not from the HDD.
3. Plug in your HDD
Plug in your HDD into your A10 device. Ensure it appeared as a device in /dev/
; can check by running ls -la /dev/sda*
. If nothing is returned, you can check if there are any errors by running dmesg
.
4. Switch the boot device for u-boot
On the first partition of the SD card, create a file named uEnv.txt
. It should contain this line:
root=/dev/sda2 ro rootwait
you can do this while your device is booted from the SD card. On my image, the first partition (/dev/mmcblk0p1
) is mounted by default as /boot/
, so you simply need to create /boot/uEnv.txt
.
5. Reboot
Enter reboot
on the command line in the SSH session; and after a reboot, you should notice that the HDD LED (if it has one) now flashes; your device should boot up from the root partition on it, congratulations! :)
6. Remove root partition from the SD card
To avoid any confusion regarding to what is where, and which root FS is actually used, I would recommend deleting 2nd partition (the 'old' root FS) from the SD card. This can be done e.g. with cfdisk
. After deleting it, you should reboot once more, to ensure the HDD boot-up still works, and you do actually boot from the HDD, and not SD.