Print
  1. Insert the microSD Card into your computer and observe which device it registers as by typing ls /dev/sd*. If you are uncertain, remove the microSD Card and the entry should go away. Once you know which device your microSD Card is, follow the instructions below replacing /dev/sdX with the name of the microSD Card in your system. do sudo fdisk -l to make sure you have identified correct device.
  2. Begin partitioning the microSD Card by typing  sudo fdisk /dev/sdX
      1. Initialize a new partition table by selecting o, then verify the partition table is empty by selecting p.
      2. Create a boot partition by selecting n for ‘new’, then p for ‘primary’, and 1 to specify the first partition. Press enter to accept the default first sector and specify 1050624 for the last sector.
      3. Change the partition type to FAT16 by selecting t for ‘type’ and 6 for ‘W95 FAT16'.
      4. Set the partition bootable by selecting a 
      5. Next, create the data partition for the root filesystem by selecting n for ‘new’, then p for ‘primary’, and 2 to specify the second partition. Accept the default values for the first and last sectors by pressing enter twice.
      6. Change the partition type to FAT32 by selecting t for ‘type’ and b for ‘W95 FAT32'.
      7. Press p to ‘print’ the partition table. It should look similar to the one below.
    Disk /dev/sde: 14.9 GiB, 15931539456 bytes, 31116288 sectors
    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: 0x7d07ed18

    Device Boot Start End Sectors Size Id Type
    /dev/sde1 * 2048 1050624 1048577 512M 6 FAT16
    /dev/sde2 1052672 31116287 30063616 14.3G b W95 FAT32
    1. Finally, commit the changes by selecting w to ‘write’ the partition table and exit fdisk.
  3. Format the Partitions
    1. Format partition 1 as FAT by typing  sudo mkfs.vfat /dev/sdX1
    2. Format partition 2 as ext4 by typing sudo mkfs.ext4 /dev/sdX2
    3. sudo mount -t vfat /dev/sdX1 /mnt
    4. sudo umount /mnt

      sudo e2label /dev/sdX1 BOOT
      sudo e2label /dev/sdX2 ROOT

U-Boot > mmcinfo
U-Boot > mmc part
U-Boot > fatls mmc 0 
U-Boot > ext4ls mmc 0:2 

Category: Linux