Get rid of junk partitions in a USB falsh drive

I used to use a USB flash drive to install Windows or Linux to my machines. After I used a USB flash drive several times, something went wrong. One time after I put Linux (Ubuntu) to the drive, my machine refused to boot from it. Under Windows condition, I only get 1.78GB when I formated it even though it is a 2GB flash drive. I use my Xubuntu machine to look at the flash drive. I can read files in its partition with 1.78GB space. I knew something wrong in its partition table. I was intended to use fdisk to repartition it. Somehow I could not apply fdisk to the drive. In my case, it is /dev/sdb. fdisk could not work on that device.

Fortunately I had experiences of using LinSpire to do that job. I rebooted my machine by LinSpire CD (v5.0.59). After the system was alive, I opened a terminal window and execute the following commands:

df
# this cammand can help me to find out what is the device name for the flash drive
# I found mine is /dev/sda
umount /mnt/sda4
# sda4 is for my case
# you should check the df output to find out yours
fdisk /dev/sda
# use this tool, I deleted the existing partitions, a total mess
# create new partition and change the system id to fat16 (6)
# then write the partition table to the flash drive

Once the messed up partition table was cleaned, I switched back to Windows and formated the flash drive. Once again, I got 1.91GB space. This is correct space value.

If you encountered similar problem, you may adopt a similar strategy to get it straight.

  • Share/Bookmark

Leave a Response

You must be logged in to post a comment.