First of all type the below command for know the name of your pen drive or memory card"
1.) dmesg | tail
Then unmount your pen drive using the following command.
2.) sudo umount /dev/sdb1 (here sdb1 is your pendrive name)
Then enter the following command to format your pen drive with FAT32 partition.:
3.) sudo mkfs.vfat -n 'Ubuntu' -I /dev/sdb1
Your pen drive is now formatted and ready to use.