Format SD card for eSD Boot

When writing the necessary files for the board, microSD card needs to have appropriate format. Note that you need to run this procedure only once as long as you use the same microSD card.
Follow the instruction below to format the microSD card partitions.

1. Check the SD card connection

  1. Before inserting the microSD card to your Linux PC, open the terinal on Linux PC and run the following command to check the devices without microSD card.
    lsblk
    Following is the example output.
    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    sda 8:0 0 30.9G 0 disk
    ├─sda1 8:1 0 512M 0 part /boot/efi
    ├─sda2 8:2 0 1K 0 part
    └─sda5 8:5 0 30.3G 0 part /
    sr0 11:0 1 1024M 0 rom

  2. Insert the microSD card to your Linux PC and run the following command again.
    lsblk

  3. Check the output and confirm the name appeared. This would be your microSD card device name.
    • Following is the example output.
      NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
      sda 8:0 0 30.9G 0 disk
      ├─sda1 8:1 0 512M 0 part /boot/efi
      ├─sda2 8:2 0 1K 0 part
      └─sda5 8:5 0 30.3G 0 part /
      sdb 8:16 1 29.7G 0 disk
      └─sdb1 8:17 1 29.7G 0 part
      sr0 11:0 1 1024M 0 rom

    • In this case, followings are your microSD card configuration.
      • /dev/sdb: The device name for the entire microSD card.
      • /dev/sdb1: The paritition name in microSD card. There may be multiple sdb* depending on the microSD card.
      Warning Be careful not to use the name of other device since it may destruct your computer filesystem.

  4. Run the following command to check the automatically mounted microSD card partitions.
    df

  5. Check the output and find the mount point, which is "/media/user/A8D3-393D" in the following example.
    Filesystem 1K-blocks Used Available Use% Mounted on
    udev 745652 0 745652 0% /dev
    :
    snip
    :
    /dev/sdb1 511720 4904 506816 1% /media/user/A8D3-393B

  6. Unmount the automatically mounted partitions.
    sudo umount /media/user/A8D3-393B
    • If there are more than one partitions on microSD card, unmount all partitions.


2. Create SD card partition

  1. Run fdisk command as shown below to change the partition table according to the following table.
    Type/Number Size Filesystem Contents
    Primary #1 500MB (minimum 128MB) Ext4 Linux kernel
    Device tree
    Primary #2 All remaining Ext4 root filesystem
    Note "File system" of "Primary #1 containing Linux kernel and Device tree" is Ext4.
    sudo fdisk /dev/sdb
    Warning Use device name. Do NOT use partition name such as /dev/sdb1.
    • Following log will be shown.
      Welcome to fdisk (util-linux 2.34).
      Changes will remain in memory only, until you decide to write them.
      Be careful before using the write command.
      
      Command (m for help):
    • Type "o" to console. The log continues.
      Created a new DOS disklabel with disk identifier 0x6b6aac6e.
      
      Command (m for help):
    • Type "n" to console. The log continues.
      Partition type
      p primary (0 primary, 0 extended, 4 free)
      e extended (container for logical partitions)
      Select (default p):
    • Type "p" to console. The log continues.
      Partition number (1-4, default 1):
    • Press ENTER key. The log continues.
      First sector (2048-62333951, default 2048):
    • Press ENTER key. The log continues.
      Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-62333951,
      default 62333951):
    • Type "+500M" to console. The log continues.
      Created a new partition 1 of type 'Linux' and of size 500 MiB.
      Partition #1 contains a vfat signature.
      
      Do you want to remove the signature? [Y]es/[N]o:
    • Type "Y" to console. The log continues.
      The signature will be removed by a write command.
      
      Command (m for help):
    • Type "n" to console. The log continues.
      Partition type
      p primary (1 primary, 0 extended, 3 free)
      e extended (container for logical partitions)
      Select (default p):
    • Type "p" to console. The log continues.
      Partition number (2-4, default 2):
    • Press ENTER key. The log continues.
      First sector (1026048-62333951, default 1026048):
    • Press ENTER key. The log continues.
      Last sector, +/-sectors or +/-size{K,M,G,T,P} (1026048-62333951,
      default 62333951):
    • Press ENTER key. The log continues.
      Created a new partition 2 of type 'Linux' and of size 29.2 GiB.
      
      Command (m for help):
    • Type "p" to console. The log continues.
      Disk /dev/sdb: 29.74 GiB, 31914983424 bytes, 62333952 sectors
      Disk model: Transcend
      Units: sectors of 1 \* 512 = 512 bytes
      Sector size (logical/physical): 512 bytes / 512 bytes
      I/O size (minimum/optimal): 512 bytes / 512 bytes  
       Disklabel type: dos
      Disk identifier: 0x6b6aac6e
      
      Device Boot Start End Sectors Size Id Type
      /dev/sdb1 2048 1026047 1024000 500M 83 Linux
      /dev/sdb2 1026048 62333951 61307904 29.2G 83 Linux
      
      Filesystem/RAID signature on partition 1 will be wiped.
      
      Command (m for help):

    • Type "w" to console. The fdisk interface will end.
      The partition table has been altered.
      Syncing disks.

  2. Check the partition table with the command below.
    partprobe
    sudo fdisk -l /dev/sdb
    Output would be as follows. Note that there are two partitions.
    Disk /dev/sdb: 29.74 GiB, 31914983424 bytes, 62333952 sectors
    Disk model: Maker name etc.
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    Disk identifier: 0x6b6aac6e
    Device Boot Start End Sectors Size Id Type
    /dev/sdb1 2048 1026047 1024000 500M 83 Linux 
    /dev/sdb2 1026048 62333951 61307904 29.2G 83 Linux

  3. Run the command below to format and mount the partitions 1.
    Note If the partitions were automatically mounted after the procedure 6 of "Check the SD card connection", please unmount them again.
    sudo mkfs.ext4 -L boot /dev/sdb1
    Following log will be shown.
    mke2fs 1.45.5 (07-Jan-2020)
    Creating filesystem with 128000 4k blocks and 128000 inodes
    Filesystem UUID: 0d2b995c-dd96-4ff6-953c-66a4701fa034
    Superblock backups stored on blocks:
      32768, 98304
    Allocating group tables: done
    Writing inode tables: done
    Creating journal (4096 blocks): done
    Writing superblocks and filesystem accounting information: done

  4. Run the command below to format and mount the partitions 2.
    sudo mkfs.ext4 -L rootfs /dev/sdb2
    Following log will be shown.
    mke2fs 1.45.5 (07-Jan-2020)
    Creating filesystem with 7663488 4k blocks and 1916928 inodes
    Filesystem UUID: 63dddb3f-e268-4554-af51-1c6e1928d76c
    Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
    4096000
    Allocating group tables: done
    Writing inode tables: done
    Creating journal (32768 blocks): done
    Writing superblocks and filesystem accounting information: done

  5. Eject the microSD card and insert it again to remount the partitions.


After this procedure, you can write the necessary data for the board into microSD card.
Go to “Set up RZ/V2L Evaluation Board Kit” to prepare a micro SD card for booting.