What You Need
Pine A64/A64+ Board
External Disk Drive
An Additional Power Source For The Drive
Step 1 Preparation
This tutorial assumes that you have already installed a Linux distrobution using the methods described in the Getting Started - Linux
At this point login to your Linux OS by either remotely logging in via ssh or directly with a monitor/keyboard hooked up to your Pine 64.
Once logged in execute the following:
You should see output similar to what's shown in the following screen.
What we are looking for are disks named "sdx" (in this example sda) to partition and transfer the current rootfs over to. We will be setting up a root partition and a swap partition for the Pine64 in this tutorial. As a general rule be sure to set your swap partition size to double the size of your RAM (if you have 512MB then make the swap partition 1GB).
The utility we will be using to partition the disk is called cfdisk as it is quite easy to use for even the most novice of users.
This is what cfdisk looks like.
We need to create the first partition by selecting "[ New ]" (located at the bottom of the UI) with the "arrow keys" followed by pressing "enter". At this point you will be required to type in the size you want the partition to be.
In this scenario my hard disk is 931.5GB in size and I want to ensure I have 2GB partition set aside for swap (I am using an A64+ with 1GB RAM) so I will be entering "929.5G" followed by selecting "[ primary ]".
With the new partition selected scroll to the "[ Type ]" option and select "83 Linux" from the list followed by the "[ Write ]" option. At this point you will be required to type in the "yes" in order to write the partition to disk.
Now for the swap partition you must scroll down to "Free space" then to "[ New ]" followed by "2G" (or whatever your remaining free space is) and finally "[ extended ]".
Now go to the "[ Write ]" option then type "yes" to write the new extended partition.
Finally we set will setup the swap partition. Scroll down to "Free space" then select "[ New ]" followed by "2G" (or whatever your remaining free space is).
Now select "[ Type ]" followed by "82 Linux swap / Solaris".
Finally we write the partition to disk by selecting "[ Write ]" then type "yes" followed by "[ Quit ]".
Finally we set/format the partitions for use (in this case sda1 is the new rootfs and sda5 is the new swap area to be used).
Let's proceed with transferring and setting up the new rootfs.
Step 2 Transfer & Setup The RootFS
Now we mount the new rootfs and transfer the current contents of the rootfs (SD card) to it after we clear out some files (This example uses Debian/Ubuntu you may need to tweak it to work for other Linux distributions).
mount /dev/sda1 /tmp/newrootfs
cp -ax / /tmp/newrootfs
Once the rootfs has been copied over we need to set a few things up with fstab and uEnv.txt in order for things to work.
echo 'root=/dev/sda1' >> /boot/uEnv.txt
echo 'rootwait' >> /boot/uEnv.txt
echo '/dev/mmcblk0p1 /boot vfat defaults 0 2' > /tmp/newrootfs/etc/fstab
echo '/dev/sda1 / ext4 defaults,noatime 0 1' >> /tmp/newrootfs/etc/fstab
echo '/dev/sda5 none swap sw 0 0' >> /tmp/newrootfs/etc/fstab
Once rebooted you should be running things off the external drive.