0
dottgonzo

prepare sd for orangepi (mbr+partitions) don't work

Recommended Posts

Hi!

 

I've coded a script that allows me to create a bootable disk of my favorite systems for different boards.

 

it does a dd of the mbr (446 kb), then with fdisk and mkfs create the partitions, and at the end copy all the data for the root partition and others.

 

This works for raspberry pi2 pi3, but for the orange pi it works only if the sd card is the same of the one used to backup the system, so i've investigated if the fstab or boot.cmd has some uuid of the disk but everywhere i found the device name instead of the uuid identifier. I don't understand why the orange pi lite don't boot with a different sd card if it have the same mbr and the same partitions. apparently everithing is the same of the original sd! The same method works for other boards!

Share this post


Link to post
Share on other sites

Without a bootloader you can't get a bootable SD card: http://linux-sunxi.org/Bootable_SD_card#SD_Card_Layout

 

This is more or less the same for thousands of different ARM devices out there with just a few exceptions (RPi for example where the VideoCore VPU/GPU boots and the ARM core(s) are brought up later -- this is why you need there a FAT16 or FAT32 partition where the proprietary bootloader BLOBs have to reside on)

Share this post


Link to post
Share on other sites

when i do the dd of the first 446 kb (the mbr) i'm coping the bootloader that is inside, or not!?

 

update

 

i'm reading the link that you suggested, seems that the part of the sd that i need to backup and restore is more then 446kb, seems like 1mb, or something like that..

 

thanks for your answer i will test it

Share this post


Link to post
Share on other sites

thanks for your answer i will test it

 

I would believe you find some information already using a google search for 'backup sd card site:armbian.com' or something like that. And you should also keep in mind that we're currently (starting with 5.22 release) change boot scripts from using device nodes to UUID instead. Since Armbian contains a script nand_sata_install to transfer a whole OS image from SD card to eMMC, USB, SATA in different modes I would also look into this.

 

BTW: I personally create sometimes compressed device images (no need to fiddle around with partitions and so on and if you use an Armbian image made within the last 3 months partition layout also ensures that you can re-image the compressed file to any SD card or eMMC 'of the same size'). We have a nice tool to FEL boot H3 devices now: http://forum.armbian.com/index.php/topic/2454-fel-mass-storage-or-writing-images-directly-to-emmc/ (and you find some information about compressed device images the same way as with the other google search above)

Share this post


Link to post
Share on other sites

i want to try to use buildroot in the future, for now i use a script that create partitions, add the mbr, copy the file from a previously backupped / partition and from other partitions with all my programs and configurations just installed, and all works in 2-10 minutes, depends on sd speed

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
0