Insert MMC card and check which device it appear as:
First, lets clear the partition table:
# fdisk /dev/sdb Command (m for help): o Building a new DOS disklabel. 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)
Print card info:
Command (m for help): p Disk /dev/sdb: 128 MB, 128450560 bytes ....
Note card size in bytes. Needed later below. Then go into "Expert mode":
Command (m for help): x
Now we want to set the geometry to 255 heads, 63 sectors and calculate the number of cylinders required for the particular SD/MMC card:
Expert command (m for help): h Number of heads (1-256, default 4): 255 Expert command (m for help): s Number of sectors (1-63, default 62): 63 Warning: setting sector offset for DOS compatiblity Expert command (m for help): c Number of cylinders (1-1048576, default 1011): 15
In this case 128MB card is used (reported as 128450560 bytes by fdisk above), thus 128450560 / 255 / 63 / 512 = 15.6 rounded down to 15 cylinders. Numbers there are 255 heads, 63 sectors, 512 bytes per sector. For 2G Card this works out at Now, return to main mode and create a new partition:
Expert command (m for help): r Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-15, default 1): 1 Last cylinder or +size or +sizeM or +sizeK (1-15, default 15): 15
Mark it bootable:
Command (m for help): a Partition number (1-4): 1
And change its type to FAT32:
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))
The result is:
Command (m for help): p Disk /dev/sdb: 128 MB, 128450560 bytes 255 heads, 63 sectors/track, 15 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdb1 * 1 15 120456 c W95 FAT32 (LBA)
Now, really write configuration to card (until here, card is not changed):
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.
Done! What's left is to format our partition as FAT32 to be mounted and populated:
# umount /dev/mmcblk0 # mkfs.vfat -F 32 -n <NAME> /dev/mmcblk0 mkfs.vfat 2.11 (12 Mar 2005)
The SD/MMC card is now ready to be used to boot OMAP3 boards.