PINE64
Successful boot from HDD - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: ROCKPRO64 (https://forum.pine64.org/forumdisplay.php?fid=98)
+--- Forum: Linux on RockPro64 (https://forum.pine64.org/forumdisplay.php?fid=101)
+--- Thread: Successful boot from HDD (/showthread.php?tid=6851)



Successful boot from HDD - mmatyas - 11-20-2018

So, following thing:

I have built a server with the RockPro64 and 4 HDDs. After my SD Card died due to frequent flashing of new images and the immense data writing due to kernel compilation, I have looked into how I could boot my RockPro64 from my HDDs.

Turns out, nothing easier than that!

Just install your (in my case Arch) Linux on the SD card. This will create different partitions, where mmcblk0p7 (or however your System will call the partitions on your SD card), the 7th partition is your root file system.

U-Boot WILL ALWAYS look in the boot/ folder on this partition for the kernel and the extlinux config. But not for the other parts, the root= flag in the extlinux.conf specifies where the kernel should boot the rootfs from.

So, create a partition on one of the HDDs (Raid and LVM should also work, just make sure to edit the mkinitcpio and recreate the kernel config before you continue), format it to ext4 and copy everything from the rootfs on the sdcard into this new partition on the HDD. Make sure you copy them with correct metadata, I recommend rsync.

After that, use fdisk to give a label for this partition, that you will not use any more on the system, like 'hddroot'.

Edit the /boot/extlinux/extlinux.conf on your SD card and change your rootfs to the specified partition label above: 'root=label=hddroot'

now, in the partition on the HDD, edit the etc/fstab to mount your original rootfs from the sdcard somewhere on your system. I created a folder called /sdroot for that. Set another fstab entry to bind mount /sdroot/boot to /boot. This is needed, so that /boot in your system points to /boot on your SDcard. Otherwise, kernel upgrades would install your new kernel on the HDD and U-Boot would still load the old one from the SD card. This way, a new kernel installed to /boot will always land on your SD card, minimizing the write load to kernel upgrades only.

That't it, you're good to go! This is running with a USB HDD and a SATA HDD on my system, I'll try packing the rootfs into a software raid and lvm later. Hopefully this way, my SD card will survive more than just a couple of weeks...

Have fun!


RE: Successful boot from HDD - alexvs - 10-09-2019

(11-20-2018, 06:46 PM)mmatyas Wrote: So, following thing:

I have built a server with the RockPro64 and 4 HDDs. After my SD Card died due to frequent flashing of new images and the immense data writing due to kernel compilation, I have looked into how I could boot my RockPro64 from my HDDs.

Turns out, nothing easier than that!

Just install your (in my case Arch) Linux on the SD card. This will create different partitions, where mmcblk0p7 (or however your System will call the partitions on your SD card), the 7th partition is your root file system.

U-Boot WILL ALWAYS look in the boot/ folder on this partition for the kernel and the extlinux config. But not for the other parts, the root= flag in the extlinux.conf specifies where the kernel should boot the rootfs from.

So, create a partition on one of the HDDs (Raid and LVM should also work, just make sure to edit the mkinitcpio and recreate the kernel config before you continue), format it to ext4 and copy everything from the rootfs on the sdcard into this new partition on the HDD. Make sure you copy them with correct metadata, I recommend rsync.

After that, use fdisk to give a label for this partition, that you will not use any more on the system, like 'hddroot'.

Edit the /boot/extlinux/extlinux.conf on your SD card and change your rootfs to the specified partition label above: 'root=label=hddroot'

now, in the partition on the HDD, edit the etc/fstab to mount your original rootfs from the sdcard somewhere on your system. I created a folder called /sdroot for that. Set another fstab entry to bind mount /sdroot/boot to /boot. This is needed, so that /boot in your system points to /boot on your SDcard. Otherwise, kernel upgrades would install your new kernel on the HDD and U-Boot would still load the old one from the SD card. This way, a new kernel installed to /boot will always land on your SD card, minimizing the write load to kernel upgrades only.

That't it, you're good to go! This is running with a USB HDD and a SATA HDD on my system, I'll try packing the rootfs into a software raid and lvm later. Hopefully this way, my SD card will survive more than just a couple of weeks...

Have fun!

Hello.
I am using the stretch-openmediavault-rockpro64-0.9.14-1159-armhf.img image.
I used your instruction to port rootfs to hdd.
The transfer of rootfs to hdd is successful, after which the system boots up, but openmediavault no longer works.
For transfer I used the rsync -ax / / mnt / command. Probably it is necessary to use something else?