Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

For SD booting, we need to have 2 partitions on the SD card. One partition(referred to as boot going forward) will be used to put the images like fsbl, linux image etc. The other partition (referred to as root going forward) will be used to hold the root file system.

Table of Contents

Table of Contents
excludeTable of Contents

Create partitions

...

This pages provides information related to formatting and SD card for a two partition configuration.

Table of Contents

Table of Contents
excludeTable of Contents

Introduction

While some Linux systems only require a single FAT-formatted boot partition (e.g. those that use a ramdisk), some systems require a second ext4 formatted partition to hold the root filesystem.   In this tutorial, the FAT partition will be referred to as the "boot" partition, which is used to hold the boot image (BOOT.BIN) and Linux image (image.ub or Image + .dtb).  The ext4 partition for the root filesystem will be referred to as "root".


Based upon the device that you are booting with the SD card, refer to the following family features:


Zynq-7000 SoC Boot ROM Features

  • Boot from standard SD or SDHC cards
  • FAT 16/32 file system
  • Up to 32 GB boot partition sizes

Note: The SD card boot mode is not supported in 7z010 dual core and 7z007s single core CLG225 devices.
Note: The SD card boot mode does not support header search or multiboot.

For more information, please refer to the Zynq-7000 SoC Technical Reference Manual (UG585) section entitled “SD Card Boot”


Zynq UltraScale+ MPSoC Boot ROM Features

  • Boot from standard SD 3.0 or SDHC cards
  • FAT 16/32 file system
  • Up to 32 GB boot partition sizes

Note: The SD card boot mode supports multiboot.

For more information, please refer to the Zynq UltraScale+ Device Technical Reference Manual (UG1085) section entitled “Boot Modes”


Versal Adaptive SoC Boot ROM Features

  • Boot from standard SD 3.0 or SDHC cards
  • FAT 16/32 file system
  • Up to 32 GB boot partition sizes

Note: The SD card boot mode supports multiboot.

For more information, please refer to the Versal ACAP Technical Reference Manual (AM011) section entitled “Boot Modes”


Following the instructions on this page will result in an SD card being partitioned with the following Boot ROM compatible configuration:

Image Added

Creating Two Partitions

These steps assume you're using a blank, unformatted SD card with no existing partitions on it. We'll use the fdisk utility in Linux to create the new partitions. Fdisk is text based tool used to create partitions on a disk.

One

You can also use gparted which is gui base partitioning tool.

  • This tutorial assumes you are using a new SD card with no partition on it. Unmount First, unmount your disk and start fdisk with your device name. In my case my SD card is at /dev/sdc. If you type p, you will


Code Block
languagebash
themeMidnight
$ sudo fdisk /dev/sdc


  • Type p, to see your current partition table.
  • If you have existing partitions, you can delete them by typing 'd'


fdisk - check partition


  • Make a new partition by typing 'n'.
  • Make it primary by selecting 'p', use
  • Use default partition number and first sector .
  • Set aside 1G for this partition by typing +1G (this value can differ based on your needs - the rest of the card will be used for the second partition)
    • For alternate partition sizes refer to the Boot ROM features for your device family outlined in the Introduction section.
fdisk - new partition

  • Make this partition bootable. Set the bootable flag on this partition by typing 'a'.
  • Now if you print out the partition table with 'p', you should see your new partition with a * under Boot.
fdisk - Bootable flag setting

  • Make the root partition by typing 'n'.
  • Select primary partition, leave
  • Leave the first and last sector default.
fdisk - new partition

  • If you check your partition table now, you should see the 2 partitions you just created.
  • After verification type 'w' to write to disk and exit.
fdisk - print partition table

Format partitions

  • Always format the bootable partition using fat. And 2nd partition can be ext2/ext4.

  • mkfs.vfat -F 32 -n boot /dev/sdc1 - this will format the first partitions using FAT.
  • mkfs.ext4 -L root /dev/sdc2 - this will format 2nd partitions using ext4.
Mount the partitions and copy the needed files.

Formatting the Partitions

After creating the partitions, the next step is to format them with the appropriate files system. 

Boot Partition

The boot partition should always be formatted as FAT.  To format the first partition as FAT, use the following command:

Code Block
languagebash
themeMidnight
$ mkfs.vfat -F 32 -n boot /dev/sdc1 

Root Partition

The root partition can be formatted as ext2/ext4 depending on your Linux configuration. To format the second partition as ext4, use the following command: 


Code Block
languagebash
themeMidnight
$ mkfs.ext4 -L root /dev/sdc2 


Info

If your root file system build artifact is an uncompressed ext4 image (i.e. rootfs.ext4) you can skip this step


Copying the Images to the New Partitions

Mount the partitions so you can copy your boot images and root file system to the card. 

Boot Partition

For the boot images, simply copy the files to the FAT partition.  This typically will include BOOT.BIN, image.ub, and boot.scr (2020.1 and later). However, your system may require additional files on the FAT file system. 

Root Partition

For the root file system, the process will depend on the format of your root file system image. 


roofts.ext4 -  This is an uncompressed ext4 file system image. To copy the contents to the root partition, you can use the following command: 


Code Block
dd if=rootfs.ext4 of=/dev/sdc2


Related Links