Copy the data
Mount the partition, and use rsync to copy the contents of the SD card’s root directory to the SATA disk.
mount /dev/sda1 /mnt
rsync -ax / /mnt
Adjust boot parameters to use the new disk
The last step is to edit a file on the SD card’s boot partition which contains boot parameters. The file is /boot/uEnv.txt (on the Raspberry Pi the equivalent file is /boot/cmdline.txt). It contains a variable called ‘root’, and it needs to be adjusted to point to the new partition, /dev/sda1:
sudo nano /boot/uEnv.txt
The file should look like this once you’ve made the changes:
bootargs=console=ttyS0,115200 console=tty0 disp.screen0_output_mode=EDID:1280x720p50 hdmi.audio=EDID:0 console=tty1 root=/dev/sda1 rootfstype=ext4 elevator=deadline rootwait
aload_script=fatload mmc 0 0x43000000 bananapi/script.bin;
aload_kernel=fatload mmc 0 0x48000000 bananapi/uImage; bootm 0x48000000;
uenvcmd=run aload_script aload_kernel
Finally, restart your server. When it starts up again, it should use the hard disk as the root file system.