Root partition on Harddisk

Hello friends,

after not being able to boot from eMMC with Ubuntu and considering that 8 GB eMMC are not that much anyway I remembered my Banana Pro booting from mmcblk0P1 and having the root-filesystem on /dev/sda1 which works like a charm.

Doing this by changing uenv.txt on th R2 led me to nothing else but “waiting for /dev/sda1” on the debug uart. This kind of waiting will take endless :slight_smile:

I can only imagine that there is no sata code in the kernel.

Is there a way to run / from a harddisk?

thanks much

ntech

have you build sata-driver and your filesystem-driver fixed (no module) in your kernel?

have you tried to boot booting from SD-Card to check if hdd is found correctly?

You just need to build the SATA support directly into the kernel and it’ll work fine - I’m using it as such right now. You can cross compile from another box or you can compile directly on the R2 (note you can’t compile u-boot on the R2 without making some minor modifications to the tool chain - a quick google will point you to the instructions if you really want to)

just replace the uImage on the boot partition with your new compiled one from linux-mt/arch/arm/boot and then replace the /lib/modules/4.4.70-BPI-R2-Kernel directory structure with the one located at linux-mt/output/lib/modules/4.4.70-BPI-R2-Kernel (in your build tree)

Alternatively tag your own version onto the kernel (you’ll see the ‘BPI-R2-Kernel’ tag inside the ‘make menuconfig’ interface - call it ‘BPI-R2-testing’ or whatever) so you can retain different builds for different purposes and then use different SD cards to boot the different uImage’s which in turn will do the init from the partition you specify (after you’ve made the change inside the uEnv.txt file - rather than /dev/sdx etc you should use PARTUUID - although I’ve found that with SATA compiled in? the first SATA drive is always sda - but with SATA support as modules? things such as USB drives will take precedence - don’t assume the /dev/sdx allocations are static - they’re not)

I have a standard build with SATA compiled in and another preemptible, 1000hz timer build for real-time audio processing + MIDI (which the R2 handles beautifully I may add)

I expect there’s some form of initrd for uboot or there’s grub for uboot - but I’ve still not played around with that yet.

I have however successfully used Kexec to boot a different kernel and by proxy other root installs - so even if there’s no uboot functionality to do as such, or grub for uboot isn’t what I think it is - you can still do something like petitboot or kexec-loader and have a little linux setup for booting your different kernels/distros if you so desire.

I expect that one day, ‘linux as a bootloader’ will be the standard - anything else given the ever increasing number of hardware devices that have to be supported? is just an unnecessary duplication of effort.

You can totally kexec into Grub4DOS and then chainload windows for example - I do that on my laptop so I can use the linux kernel to patch my DSDT table for using an external graphics card. Yeah that took a while to figure out :wink:

Hi Frank,

you may be disappointed. What I actually did is the following: I moved the root partition to one single partition on the eMMC-Chip. In the uenv.txt I declared root=/dev/emmblk1p1. This works. Due to no sata-drivers in the kernel it is not possible to put root on /dev/sda1. (unless you want to do ‘make menuconfig’

As the 8GB of eMMC ist not that big anyway i moved /var and /home to /dev/sda1 and /dev/sda2 (20 GB each) I mounted /dev/sda3 as /data for storage. That way, I have about 4 GB left on eMMC left (which isn’t much but it is reasonable fast).

With Samba, I see transfer rates of about 85 MB/s with a somewhat aged harddrive. That is not that bad after all.

Booting still takes place from the sd-card, but only emmcblk0p1 aka /boot. /root ist running fine from emmc.

Yet, if it was possible to boot from emmc, I wouldn’t care much because of the limited size. And I am far from understanding why BPI advertises the board with up to 64GB of emmc while the only thing we can actually buy has the ridiculous amount of 8 GB which is almost useless.

Why don’t you want make menuconfig / building kernel? You must only change some drivers “m” to “*”,build it and copy it to your boot-partition. With the code from github it’s easy. Currently imho 8gb emmc is enough if it holds only operating system and no “user data”. As you done before /home and /var have to be outsourced

Yep - might do that and did it long ago when SCSI and microchannel was the real thing. Yeah, I am THAT old :slight_smile: But not tonight. For the time being I’m quite confident with root on the eMMC chip for it seems faster than my outdated harddisk. Anyway, that way I made things work. Maybe not the most sophisticated way. But in the end, i got it working.

As for the size of the emmc. I paid 76 Euros for that boardie - how much more would it take for a 64GB Board? :wink: