Usb boot device totally unable to be formatted

20,991

Solution 1

Yeah, this is a pain in the butt and it caused me many head-aches too. I finally figured out how to get mine working again by doing the following.

First we're going to be using the terminal and the command dd. This can be dangerous so take it slow and double check everything. Triple check actually because this will delete everything on your usb key and it can delete everything on your computer if you mess this up.

First run:

sudo fdisk -l

This will show you the devices that are plugged into your computer. You want to find the name of the usb key you want to format. It will probably be sdb, BUT IT MAY NOT. Look for a device with two partitions and with the size of your usb key.

Next run:

sudo dd if=/dev/zero of=/dev/sdx

replace x with the letter of the usb key from the last command. We don't care about the numbers following that letter. Make sure you get this part right; otherwise you may kill your computer!

This will make your usb key all zero. This command will take some time to run.

Now use Gparted and format it to whatever you want. If it gives any error just click through it and try again until it does it.

Solution 2

This might be a controversial suggestion, but if all else fails I'd try formatting the USB using a Windows PC! I'm no Ubuntu expert, but I've had problems using GParted and other tools to format a USB stick after messing up the files on it. However, Windows always seems to somehow get the drive back to plain FAT32. Don't ask me why, it's just my personal experience.

Please bear in mind that this could very well be my limited knowledge of all the options GParted has to offer, rather than Windows doing a better job!

Share:
20,991

Related videos on Youtube

fuqda
Author by

fuqda

Updated on September 18, 2022

Comments

  • fuqda
    fuqda over 1 year

    I'm really upset by now, I've been trying 2hours straight to format a stupid usb drive (I'm new to ubuntu and I don't know if I will last long at this rate)

    Basically this was the lubuntu boot usb key

    I tried to remove files with sudo rm
    I tried to format disk with disk utility
    I tried to format disk with gparted (with unmounting beforehand)

    Nothing works. I can't delete a file. I can't move a file to the usb key. I can't do anything. This is really infuriating.. I don't know what to do!

    Here are some gparted errors while trying to format to fat32 after unmounting

    error fsyncing/closing/dev/sdb: input/output error 
    input/output error during write on /dev/sdb
    

    When I try to remove by hand, it says "read-only file"

    • Panther
      Panther over 10 years
      perhaps the usb drive is bad ?
    • Wilf
      Wilf over 10 years
      How is the device connected (I know by USB, but in what way - Is it a USB hard disk)? Also, what formatting is the drive currently?. Has the drive worked previously, how was it made to its current state etc (installation, formatting....).
    • fuqda
      fuqda over 10 years
      well I installed lubuntu yesterday with it so I guess it's supposed to work. its in fat32 ad was created with universal boot installer. I also just tried to format it with fdisk : doesnt work. THe only mistake I maybe made wast try to alt+del everything in the usb drive (first think I tried, some files got actually deleted). Its just a 2gb usb drive
    • minigeek
      minigeek over 7 years
      Well..last end solution.. delete partition create new ntfs partition using gparted!...i doubt..ur usb disk got write protected..then you should search for how to remove read-only property of usb
  • fuqda
    fuqda over 10 years
    ok thanks just tried the comand line, for now the @host line didnt show up againI guess that means its running
  • Paul Tanzini
    Paul Tanzini over 10 years
    Try restarting your computer, and trying this again if the drive is still showing Lubuntu on it.
  • fuqda
    fuqda over 10 years
    yea its still showing up on the drive.. gonna try again
  • fuqda
    fuqda over 10 years
    actually I can see the disk in the xplorer but the system doesnt recognzie it (doesnt appear in fdisk -l, doesnt appear in gparted) actually gparted is just stuck on scanning device indefinitly
  • Paul Tanzini
    Paul Tanzini over 10 years
    take it out and put it in a different usb port and see if anything changes.
  • fuqda
    fuqda over 10 years
    ok I did that and now I'm trying to unmount it with gparted, and apparently it's stuck on that operation. thanks for your help but 3 hours and still couldnt format a 2gb usb drive even with a command that set all data to 0.. thats too much for me. Will do it with w7 when I can
  • Paul Tanzini
    Paul Tanzini over 10 years
    If Gparted doesn't want to work you can try this command instead sudo mkfs.vfat /dev/sdx replace x with letter of usb. It will format it to fat32.
  • Paul Tanzini
    Paul Tanzini over 10 years
    and use sudo umount /dev/sdx to unmount it first. sorry.
  • fuqda
    fuqda over 10 years
    well I cant do that, the drive seems quite messed up since even sudo fdisk -l cant see it (so I cant mount/unmount or anything) -even if the explorer actually recognize it when I plug it
  • fuqda
    fuqda over 10 years
    actually mkfs gives "device or ressource busy" (managed to get to the disk with an other usb port)
  • Paul Tanzini
    Paul Tanzini over 10 years
    Gparted may be screwing with it. You may need to reboot again and just use those command line commands.
  • fuqda
    fuqda over 10 years
    for now the command line seems to be running as no new @host appeared
  • Marcel
    Marcel over 8 years
    I tried this and it still didn't work. I had a hard time even formatting the thing; I kept getting write protection errors. Then, when it was formatted, I still couldn't mount it!