How to format pen drive from terminal in Ubuntu

Many times it happens that your pen drive or memory cards does not formatted from file manager so you have to format it from terminal. In this tutorial, it is shown that how to format pen drive or any other hard-disk or memory card from terminal using commands in Ubuntu.

This tutorial gives you a complete idea of how to format pen drive from terminal and which commands you have to type.

I also attached the screenshots of this commands from terminal window step by step

pendrive

[1]  First of all type the below command for know the

name of your pen drive or memory card.

[here | (pipe) operator is used which is given above your enter key in most of keyboards.]

        dmesg | tail
pendrive2
  [2]  Then unmount your pen drive using the following command.
            sudo umount /dev/sdb1
           And enter your password.
pendrive3
 [3]  Then enter the following command to format your pen drive with
           FAT32 partition.
pendrive4
       
  sudo mkfs.vfat -n ‘Ubuntu’ -I /dev/sdb1
pendrive5
 Your pen drive is now formatted and ready to use.

Leave a comment