1

This question is not a duplicate. I followed the thread showing how to format usb but it didn't help (see below for details). Please also read the comments section

I tried to follow How to format a USB stick thread to format my USB drive. However, sudo mkfs.vfat /dev/sdb1 still produces the following error.

mkfs.fat 4.1 (2017-01-24)
mkfs.vfat: unable to discover size of /dev/sdb1

The size of USB pendrive seems to be incorrect:

$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
--truncated--
sdb      8:16   1   7.2G  0 disk 
└─sdb1   8:17   1   239M  0 part 

As you can see, the USB has size of 7,2G but there is one partition of size 239M.

I also tried wipefs -a /dev/sdb to erase all the partitions in USB thumb. Still, no luck.

Neither sudo dd if=/dev/zero of=/dev/sdb bs=512 count=1 or sudo dd if=/dev/zero of=/dev/sdb bs=512 has worked as I'm still getting mkfs.vfat: unable to discover size of /dev/sdb1.

menteith
  • 271

1 Answers1

0

Probably your partition table is corrupted. The easy way to move forward is to open gparted and and in the top right go to /dev/XdYand select the disk you want to edit:

enter image description here

This will destroy everything on the USB stick!

  1. Go to the menu Device
  2. Then Create Partition Table
  3. Then msdos
  4. Press OK

Now you can create new partitions the way you want them...

If the above fails: Your USB stick is toast! Throw it away and buy a new one!

Fabby
  • 34,259