A20 Olinuxino Micro SATA boot

This forum is for supported devices using an ARMv7 Allwinner SoC.

A20 Olinuxino Micro SATA boot

Postby frederik » Thu Jun 21, 2018 9:09 am

I followed instructions on https://archlinuxarm.org/platforms/armv ... xino-micro to boot into Arch from SD card. The instructions on how to have the main system reside on SATA are not entirely clear though. The section on how to boot from SATA only mentions /dev/sdX - at what point should the system be moved on the SATA drive, which can't be accessed until the system first boots? Shouldn't there be mention of /dev/sdY for that?

With the system fully residing on the SD card, I can boot into Linux and get the following for $this->bbcode_second_pass_code('', 'fdisk -l')

$this->bbcode_second_pass_quote('', '
')Disk /dev/mmcblk0: 29.7 GiB, 31914983424 bytes, 62333952 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xaf7f19a1

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 2048 62333951 62331904 29.7G 83 Linux


Disk /dev/sda: 232.9 GiB, 250059350016 bytes, 488397168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x6f20736b

Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 34814 32767 16M 83 Linux
/dev/sda2 34816 488397167 488362352 232.9G 83 Linux



/dev/sda is partitioned from a Debian install before, and contains some data on /dev/sda2, which I could back up before overwriting the partition if needs be.

Has anyone done this before that could explain how to interpret the instructions?
frederik
 
Posts: 3
Joined: Thu Jun 21, 2018 8:59 am

Re: A20 Olinuxino Micro SATA boot

Postby nobodySpecial » Mon Jun 25, 2018 6:33 pm

Hey there,
i just installed Arch on the Cubietruck, also with a sata-ssd for the rootfs.
I got problems, following up the instructions to, on the offical arch site too, for my Truck.
But i found a solution.

You got already the Arch on the SD-Card working so should do the following steps:
- pacman-key --init
- pacman-key --populate archlinuxarm
- pacman -Syu uboot-a20-olinuxino-micro
- move the rootfs from sd-card to sata-device via dd
dd if=/dev/<sd-card><rootfs-partition> of=/dev/<sata-device><rootfs-partition> bs=1M

then you need to change the rootfs boot parameter
After the uboot installation you have, under the boot directory, the boot.scr and something like boot.txt or boot.cmd perhaps.
Basically you need to modify the boot.txt or .cmd file and execute the .mksrc, also in the same directory.
This should overwrite the boot.scr. I just edit the boot.scr directly anyway. No problems there doing it this way.
Mine looks like this:
$this->bbcode_second_pass_code('', '
if test -n ${distro_bootpart}; then setenv bootpart ${distro_bootpart}; else setenv bootpart 1; fi
part uuid ${devtype} ${devnum}:${bootpart} uuid

setenv bootargs console=${console} root=/dev/sda1 rw rootwait

if load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /boot/zImage; then
if load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /boot/dtbs/${fdtfile}; then
if load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} /boot/initramfs-linux.img; then
bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r};
else
bootz ${kernel_addr_r} - ${fdt_addr_r};
fi;
fi;
fi
')
That's all.
Hope this helps you
nobodySpecial
 
Posts: 8
Joined: Tue Jun 12, 2018 8:15 pm

Re: A20 Olinuxino Micro SATA boot

Postby frederik » Tue Jun 26, 2018 10:54 am

Thank you, great to have this clarified.

I ended up doing a similar thing - installed and booted from SD card as described in the first part of the installation instructions. Instead of copying the rootfs, I ended up at that point re-installing on the SSD drive as per the instruction step 3 in the second part of the instructions, detailing how to install to SATA. Once that was done, I reconfigured the SD card to only contain the U-boot bootloader anymore, per step 1 and 2 in that instruction set.

Out of curiosity, did your approach require you to resize the rootfs partition on the SATA drive afterwards?
frederik
 
Posts: 3
Joined: Thu Jun 21, 2018 8:59 am

Re: A20 Olinuxino Micro SATA boot

Postby nobodySpecial » Sat Jul 07, 2018 10:11 am

I had to resize it to the full disk space with resize2fs
nobodySpecial
 
Posts: 8
Joined: Tue Jun 12, 2018 8:15 pm


Return to Allwinner

Who is online

Users browsing this forum: No registered users and 4 guests