Problem cloning the sdCard where I have FreeBSD 13.2 for Raspberry Pi 4

Hello,
i downloaded FreeBSD 13.2 for Raspberry Pi 4 and it works perfectly!!! ---> https://download.freebsd.org/ftp/releases/arm64/aarch64/ISO-IMAGES/13.2/

But now I want to backup my sdCard doing dd, and, when it finish... I put the new sdCard on the Raspberry Pi 4 and u-boot doesn't work and I the boot stops showing "mountroot>"

Can somebody tell me why I cloned the sdcard nº2 and it doesn't not boot when my sdcard nº1 it boots perfectly on the Rasbperry?
 

Attachments

  • problem-boot-freebsd-13.2-raspberry-pi-4.jpg
    problem-boot-freebsd-13.2-raspberry-pi-4.jpg
    280.4 KB · Views: 108
I used "dd" o Ubuntu (and also Rufus on Windows 10) and the problem was the same on both systems. I used three differents 64 Gb sdCards in case the problem was the card.

On Ubuntu I did:

dd if=/dev/sdb of=/home/joan/backup.img bs=1M
 
Ok, that image looks good. You can try and use mdconfig(8) to check the resulting image file. But it looks fine on first glance. Next question, how did you write that image back to an SD card?
 
That looks good too. I was afraid you may had dd'ed the partition instead of the disk itself.

Let's look at the image itself. You can load it; mdconfig -a -f backup.img. That should create an md0 device, that's the disk 'image'. Then check gpart show md0 (assuming it was md0 that got created).
 
I did what you said, but I don't know how can this help:

Code:
root@:/mnt/usb # mdconfig -a -f freebsd-13.2-18juny-v3.img
md0
root@:/mnt/usb # gpart show md0
=>       63  124735425  md0  MBR  (59G)
         63       1985       - free -  (993K)
       2048     102400    1  fat32lba  [active]  (50M)
     104448  124626944    2  freebsd  (59G)
  124731392       4096       - free -  (2.0M)
 
I did what you said, but I don't know how can this help:
It's to verify the image is correct. And it looks like it's good. Partition table looks correct, so that can't be the cause of the problem. Maybe try gpart show -l md0s2 too and check if the bsdlabel is correct inside the freebsd slice.
 
It's to verify the image is correct. And it looks like it's good. Partition table looks correct, so that can't be the cause of the problem. Maybe try gpart show -l md0s2 too and check if the bsdlabel is correct inside the freebsd slice.

I think it's fine the partition table of the SD Card.
 

Attachments

  • Screenshot from 2023-06-19 16-28-17.png
    Screenshot from 2023-06-19 16-28-17.png
    26.6 KB · Views: 85
I think it's fine the partition table of the SD Card.
It's 'missing' the rootfs label on md0s2a. So /dev/ufs/rootfs doesn't exist. Therefor it cannot be found by the loader. You can get it to boot if you enter ufs:/dev/da0s2a but I'm a little worried, it looks like the bootloader doesn't even recognize the SD card at all (the ? output only shows an MMC device).

Edit: Apparently that's the SD card on a Pi4 (don't have one at hand at the moment). It seems to show up as mmcsd0. So at the mountroot prompt, try entering ufs:/dev/mmcsd0s2a and see if that boots it.
 
When doing that checkout the disk labels with tunefs.
FreeBSD Arm images use labels instead of disks in /etc/fstab and would cause a stop at mountroot:.

Both SD Cards are 64 GB, but maybe I should repeat the "dd" comand adding at the end "conv=sync,noerror"?
 
I'm going to do two new tests:
- 1, adding conv=sync,noerror at the end of "dd" command.
- 2, cloning a 128 GB SD Card, not a 64 GB.
 
the output of "?" is consistent with a missing/invalid/broken partition table
can you scroll back the output and see if it complains about something like this ?
 
the output of "?" is consistent with a missing/invalid/broken partition table
can you scroll back the output and see if it complains about something like this ?
I can't scroll up, the only I see on this screen is: "mounting from ufs:/dev/ufs/rootfs failed with error 19."
 

Attachments

  • IMG_20230619_162501(2).jpg
    IMG_20230619_162501(2).jpg
    1.8 MB · Views: 85
the output of "?" is consistent with a missing/invalid/broken partition table
can you scroll back the output and see if it complains about something like this ?
Perhaps i could use a bigger screen, my TV, for example, if you want to see more messages.
 
Little known FreeBSD trick, press the Scroll-Lock key, then you can scroll the console with the cursor keys or page up/down. Press Scroll-Lock again to release it.
No, it does not work this here on this boot screen, I saw the cursor and I can move it up and down, but there is no scroll, the cursor finish at the top of the screen. Have a look:
 

Attachments

  • IMG_20230619_170610.jpg
    IMG_20230619_170610.jpg
    1.7 MB · Views: 115
Solved... not exactly I solved with the 64 GB SD Card as I wanted, but I can boot the Raspberry Pi 4.
Finally, I did my test number 2, I cloned a new 128 GB, and this time not from a Ubuntu but from a laptop using FreeBSD 13.2, and it works, now I put the SD Card and I can boot the Raspberry Pi 4.

So, it seems there was some differences of size on both 64 GB kingston cards.
Anyways, this evening I will try, again from FreeBSD and not from Ubuntu, to clone a 64 GB sd card, just in case :)

Thanks for your comments and ideas.
 
Back
Top