Prerequisite: The SD card has been partitioned and linked to the ubuntu system through a card reader or TF card sleeve
1 Use the df -h command to view the partition information and mount information of the sd card
E.g:
/dev/sdb1 mount point is /media/label1
/dev/sdb2 mount point is /mdeia/label2
2 Unmount SD card
umount /media/label1
umount /media/label2
3 Format the SD card
sudo fdisk /dev/sdb
Enter option m for a list of commands
Enter command p, see SD card specific information
Delete all SD cards, enter command d, it will display Partition number (1-4): 1 (here refers to sdb1); similarly delete sdb2
4 Execute w to make the delete command take effect
Content reference: http://blog.sina.com.cn/s/blog_68e596750100jx9m.html
5 Clear the SD card boot area
card=/dev/sdb
sudo dd if=/dev/zero of=${card} bs=1024 seek=544 count=128