Thursday, November 10, 2016

Formatting USB Drive via terminal in Ubuntu

1. Open up the terminal in your ubuntu device using either Ctrl+Alt+T or  by searching for keyword Terminal in Ubuntu Dash.

2. Type lsblk or sudo fdisk -l and hit enter in terminal to identify your usb device
Here is an example of identifying usb using lsblk command. I have used already known size of my usb to identify it. If you get confused, you can identify it by entering lsblk command first without inserting usb and again entering the same command after inserting usb and noticing the difference in result.

3. After this we have to unmount the device. For unmounting the device use the command sudo umount /dev/sdb1(usb name)

4. Now format the partition using the command sudo mkdosfs -F 32 -I /dev/sdb1(usb name). This command format the usb as FAT32.