Skip to content

orange pi zero sd card layout

Hien Nguyen edited this page Jan 23, 2019 · 7 revisions

SD card layout:

Partition Type Size Contents
1 RAW 4 MB Boot loader: u-boot.bin copied from build/orange_pi_zero/uboot/u-boot.bin
Clean & keep the partition table: dd if=/dev/zero of=/dev/sdX bs=1k count=1023 seek=1
Copy u-boot.bin to disk: dd if=build/orange_pi_zero/uboot/u-boot.bin of=/dev/sdX bs=1024 seek=8
NOTE: If the SD card is connected via USB and is sdX (replace X for a correct letter)
2 FAT 220 MB boot.scr: U-boot start up script
firmware_selected: text file determine which firmware will be loaded
firmware_0: firmware #0 (<=100MB)
firmware_1: firmware #1 (<=100MB)
3 Ext4 Remaining of SD card Config data

Create the above partitions with fdisk:

$ fdisk /dev/sdc

Welcome to fdisk (util-linux 2.31.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-1953791, default 2048): 7812
Last sector, +sectors or +size{K,M,G,T,P} (7812-1953791, default 1953791): 445310

Created a new partition 1 of type 'Linux' and of size 213.6 MiB.

Command (m for help): n
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (2-4, default 2): 2
First sector (2048-1953791, default 2048): 445311
Last sector, +sectors or +size{K,M,G,T,P} (445311-1953791, default 1953791): 

Created a new partition 2 of type 'Linux' and of size 736.6 MiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

Format new created partitions:

$ mkfs.fat /dev/sdc1
mkfs.fat 4.1 (2017-01-24)

$ mkfs.ext4 /dev/sdc2
mke2fs 1.44.1 (24-Mar-2018)
Creating filesystem with 188560 4k blocks and 47232 inodes
Filesystem UUID: 61b2be88-9c61-46ca-a124-4c8eeeea24e3
Superblock backups stored on blocks: 
	32768, 98304, 163840

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
Clone this wiki locally