Successful boot from HDD
#1
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!
#2
(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?


Possibly Related Threads…
Thread Author Replies Views Last Post
  Boot/Shutdown on timer captainmorgan 8 5,784 11-01-2023, 12:08 PM
Last Post: Nikolay_Po
Question How do I compile an arbitrary kernel for U-Boot? Valenoern 3 991 06-16-2023, 10:54 AM
Last Post: CounterPillow
  RockPro64 boot questions misterc 3 1,462 01-13-2023, 06:21 PM
Last Post: misterc
  Is some u-boot required on the SPI for installing debian with the official installer? callegar 1 1,273 10-25-2022, 10:07 AM
Last Post: ratzzupaltuff
  How I Got Fedora Linux to Boot From eMMC (or microSD, for that matter) whitecat23 4 4,076 01-03-2022, 10:32 AM
Last Post: whitecat23
  Overlays not loading at boot - ROCKPRO64 on Armbian rookieone 0 1,275 09-28-2021, 04:10 AM
Last Post: rookieone
Question cannot boot openSUSE - what am I doing wrong? Mentaluproar 2 2,353 08-12-2021, 04:58 AM
Last Post: igorp
  Other boot options than Sdcard for linux 5.x kernel? MisterA 2 2,904 07-14-2021, 02:37 PM
Last Post: TRS-80
  Official Debian release won't boot!?! Faradn 4 6,554 07-06-2020, 09:29 AM
Last Post: Bullet64
  Mainline U-Boot with Arch Linux PKGBUILD mmatyas 0 1,970 04-17-2020, 03:49 AM
Last Post: mmatyas

Forum Jump:


Users browsing this thread: 1 Guest(s)