my R2 is booting from the SD-card at the moment.
Would be great to use the R2 without the SD-Card.
I read that booting with Kernel 5.4 is possible via SD or emmc only.
As my Ubuntu 20.4.03 is bigger than 8gb, i can’t use the emmc.
So my idea is, to copy the small BOOT-partition on the emmc,
and copy the ROOT-partition on a SSD connected via SATA.
So i started to copy the ROOT-partition on the SSD and connected it to the R2.
I still used the SD-card for the BOOT-partition (no emmc for now). There was no “uEnv.txt” in “bananapi/bpi-r2/linux/” so i created one and wrote:
root=/dev/sdb rw rootfstype=ext4 rootwait
in it.
When i boot it, i get:
Partition Map for MMC device 1 -- Partition Type: DOS
Part Start Sector Num Sectors UUID Type
1 204800 524288 54fd6008-01 0c
2 729088 32768000 54fd6008-02 83
mmc1 is available
Interface: MMC
Device 1: Vendor: Man 000003 Snr b1569c01 Rev: 1.5 Prod: SC32G�
Type: Removable Hard Disk
Capacity: 30436.5 MB = 29.7 GB (62333952 x 512)
Filesystem: FAT16 "BPI-BOOT "
Boot from SD
reading bananapi/bpi-r2/linux/uEnv.txt
** Unable to read file bananapi/bpi-r2/linux/uEnv.txt **
reading uEnv.txt
** Unable to read file uEnv.txt **
## Error: "uenvcmd" not defined
reading bananapi/bpi-r2/linux/uImage
8250159 bytes read in 1057 ms (7.4 MiB/s)
bootm flag=0, states=70f
## Booting kernel from Legacy Image at 84000000 ...
Image Name: Linux Kernel 5.4.0-main
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 8250095 Bytes = 7.9 MiB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
why can’t the R2 not read the uEnv.txt? I got the same error message when the file is empty or deleted.
Is it necessary to define uenvcmd?
The R2 is booting up usually (fully from SD not SSD).
of course you can boot from sdcard and use ssd for rootfs, but you cannot boot directly from sata. you need either sdcard or emmc to get into uboot
then you can change rootfs passed to linux kernel
just override root and change it to the ssd (/dev/sdxy)
if you want to have uEnv.txt/kernel on ssd too it is a bit more difficult as you need to adjust device and partition and make sure sata is correctly intialized…as your uEnv.txt then is already on sata you need to change uboots builtin environment (= change the file from my repo and recompile/reflash uboot)
“you can boot from sdcard and use ssd for rootfs, but you cannot boot directly from sata. you need either sdcard or emmc to get into uboot”
Ok great, this is what im trying at the moment.
“then you can change rootfs passed to linux kernel”
Ok but where i need to change this? Where is the file located that you attached? Is it somewhere on the Boot-Partition? Sorry, i was not able to find it.
your log says that my script detects SD boot so it will try to load from sdcard. if you remove sdcard it
should print emmc
ok i moved the Boot-Partition from SD to MMC, and removed the SD-Card.
It is not booting, without the SD, and there is no output on the UART.
Check out this post about fstab
i don’t really understand how “fstab” help me in this case. Should i mount the emmc here so that uEnv.txt will be found by uBoot on bootup?
basicly my debian images support emmc too with some adjustments like changing root in uEnv.txt and in fstab
I have Ubuntu 20.4.03 installed at the moment. I don’t really want to downgrade to an older version, and setup everything else from the beginning.
you have to put bootheaders, uboot and the boot-partition to emmc and there a uEnv.txt
is there any manual how to do this? I found this http://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r2:storage from you Frank. But i’m unsure what i need to install first (preloader?, uboot?)
And i’m also not sure if this manual for ubuntu 14.x is still up to date.
basicly you need only the steps to fill the boot0 partition with the emmc preloader, then flash my debian-image to emmc userpartition (/dev/mmcblkX), change uenv.txt (for uboot - root passed to linux kernel) and fstab (mount of rootfs)
I did the first 3 steps without any errors. In step 4 i moved the unzipped Image to the sd card and moved it via “dd” to the mmc. I just don’t know what to do here:
Where do i get the Zip-File and where should move it to? Or is it not necessary?
I skipped this point for now, and tried to boot the R2 without SD-Card. But uBoot is still not displayed. I also checked the bootswitch. But it the same result when its switched to SD or EMMC.
Is there anything i forgot?
this is dd’ing the image to user-partition, if you have the image already uncompressed, you can do
dd if=image | pv | dd of=.....
or if you don’t need status or have not installed pv
dd if=image of=device ...
maybe adding status=progress (newer dd imho have it) instead of noxfer
as i said, you should see at least bootrom (~10 lines of output before any other header is read)…for uboot you have to write the image. if you see bootrom but no further output maybe partition config is wrong or preloader on boot0 is missing
ok, i used your image (linked above) and put it on a sd-card. I changed uEnv.txt and fstab to my ssd with the ROOT-partition on it - and it works! yeah! Thanks for that!
Then i tried to move the image on the emmc (https://bananapi.gitbook.io/bpi-m3/zh/howtoburnlinuximagetoemmc) and removed the sd card. It does not boot anymore. As long as i press the power-button, the leds are on. When i release ti after 15seconds, all leds are off. No message on UART. Boot-switch does not change anything.
As i said above,you have to flash the image to emmc main partition…if you have uncompressed it before you need no (g)unzip,simply dd if=image of=targetdevice