Preparing a bootable SD card (Linux Ubuntu)

If your SD card does not already contain a bootable (active) FAT32 partition, you can create one from a Linux Ubuntu host.

Creating a bootable FAT32 partition in a Linux Ubuntu environment

The following procedure provides a quick, step-by-step example of the procedure you can use from a Linux Ubuntu terminal to prepare an SD card with a bootable DOS / FAT32 filesystem.

Note:
  • This example uses the SD card /dev/sdd. You can use the mount command to determine your SD card's actual device name.
  • We are working with the SD card as a whole (/dev/sdd), not a partition on the SD card (e.g. /dev/sdd1).
  1. Display disk information and show the existing partitions, if any:
    /home/user/> sudo fdisk /dev/sdd
            
    Command (m for help): p
            
    Disk /dev/sdd: 15.9 GB, 15931539456 bytes
    64 heads, 32 sectors/track, 15193 cylinders, total 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
    Disk identifier: 0x938b698a
            
    Device Boot      Start         End      Blocks   Id  System
  2. Change default unit to cylinders:
    Command (m for help): u
    Changing display/entry units to cylinders
  3. Create a new, empty DOS partition table:
    Command (m for help): o
    Building a new DOS disklabel with disk identifier 0xdf0e79d5.
    Changes will remain in memory only, until you decide to write them.
    After that, of course, the previous content won't be recoverable.
            
    Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
  4. Add a new partition (Instructions and comments are in parenthesis):
    Command (m for help): n
    Partition type:
    p   primary (0 primary, 0 extended, 4 free)
    e   extended
    Select (default p): p    (The new partition is a primary partition.)
    Partition number (1-4, default 1): (Press Enter for default.)
    Using default value 1
    First cylinder (2-15193, default 2): (Press Enter for default.)
    Using default value 2
    Last cylinder, +cylinders or +size{K,M,G} (2-15193, default 15193): (Press Enter for default.)
    Using default value 15193
  5. Make a partition active, or bootable:
    Command (m for help): a
    Partition number (1-4): 1   (Select Partition 1 to be active.)
  6. Change the partition type to FAT32. (The value c is hexadecimal (decimal 12), the type for a FAT32 partition.):
    Command (m for help): t
    Selected partition 1
    Hex code (type L to list codes): c 
    Changed system type of partition 1 to c (W95 FAT32 (LBA))
  7. Write the new partition information:
    Command (m for help): w
    The partition table has been altered!
            
    Calling ioctl() to re-read partition table.
            
    WARNING: If you have created or modified any DOS 6.x
    partitions, please see the fdisk manual page for additional
    information.
    Syncing disks.
  8. Format the new partition with a DOS FAT32 filesystem. Note that now we specify the partition number (/dev/sdd1):
    /home/user> sudo mkfs.vfat -F32 /dev/sdd1
    mkfs.vfat 3.0.13 (30 Jun 2012)
    /home/user>

Your SD card should now be ready to use with the BSP boot images.