Pen-drive / USB-Drive not working after installing ubuntu in it

9,557

Solution 1

Your USB key might be dead if you're getting an I/O error… Look at what dmesg says after trying the dd command again.

Another thing you can try is creating a filesystem on the whole memory (and checking bad sectors with -c):

mkfs.vfat -c -F32 -I -v.

Solution 2

Use HP format tool. It run only on windows. Download from here and install. More Information for the HP format Tool here.

Insert the flash to the computer and start the HP Format Tool as shown hereenter image description here

Share:
9,557

Related videos on Youtube

user1735921
Author by

user1735921

Updated on September 18, 2022

Comments

  • user1735921
    user1735921 almost 2 years

    I put in ubuntu in pendrive and made pendrive bootable by unetbootin. Now the pendrive doesn't work anymore due to that, it is not opening, when I put in windows OS, it doesn't show its total space and free space, it says Total Space: 0MB, Free Space 0MB and its not opening.

    I tried all possible softwares like SD Formatter, Yumi, PW (partition wizard), windows disk management, etc. but nothing has been successful, tried formatting from CMD too, nothing is able to format it or read it. Please help.

    edit: I used gparted and it is unable to detect usb-flash drive. It detects two drives.. one sda1 20gb and other is sda2 200gb, but my USB-Flash Drive is 8GB only. It was not able to detect it and USB port is working fine.

    edit#2: On Linux dmesg (without the USB): http://pastebin.com/R8UMMnrD

    dmesg (with USB Drive Inserted): http://pastebin.com/ZCnymsUu

    Screenshot of gparted: (I can't post more than 2 links, so here is the link which you cannot click, just copy paste in browser) i.imgur.com/72UCk72.png

    edit #3: I tried command fdisk in ubuntu:

    It says me this:

    Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
    Building a new DOS disklabel with disk identifier 0x22ea62b2.
    Changes will remain in memory only, until you decide to write them.
    After that, of course, the previous content won't be recoverable.
    
    Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
    
    Command (m for help): 
    

    edit#4: After running command sudo dd if=/dev/zero of=/dev/sdb i got following:

    dd: writing to ‘/dev/sdb’: Input/output error
    8193+0 records in
    8192+0 records out
    4194304 bytes (4.2 MB) copied, 2.57164 s, 1.6 MB/s
    

    Still no solution...

    edit #5: I am unable to create partition table. I get this error on all softwares like gparted.

    Edit:#6

    It says me this: (dmesg after dd) pastebin.com/dq6ACvKc

    Then I tried second solution:

    sudo mkfs.vfat -c -F32 -I -v /dev/sdb
    

    And I got this error:

    mkfs.fat 3.0.26 (2014-03-07)
    /dev/sdb has 239 heads and 62 sectors per track,
    hidden sectors 0x0000;
    logical sector size is 512,
    using 0xf8 media descriptor, with 15131636 sectors;
    drive number 0x80;
    filesystem has 2 32-bit FATs and 8 sectors per cluster.
    FAT size is 14749 sectors, and provides 1887763 clusters.
    There are 32 reserved sectors.
    Volume ID is 6a9b70f8, no volume label.
    Searching for bad blocks 4080... mkfs.vfat: bad blocks before data-area: cannot make fs
    

    Looks like no software can help, is there any way that I may reset the pendrive from hardware by physically opening it?

    • MariusMatutiae
      MariusMatutiae almost 10 years
      Which filesystem is there on the USB drive?
    • Steve
      Steve almost 10 years
      There is probably a wonky partition layout on it with non-Windows filesystems.
    • user1735921
      user1735921 almost 10 years
      I used gparted now on a linux machine, it doesn't even detect the USB Flash drive.
  • user1735921
    user1735921 almost 10 years
    gparted failed... any other solution ?
  • Ruslan Gerasimov
    Ruslan Gerasimov almost 10 years
    What makes you think it failed? Here at SU is a commonly reciting error messages in posts, or screen shots. Could you please include
  • user1735921
    user1735921 almost 10 years
    It just didn't detect it... I opened gparted and it showed sda1 and sda2, and none of them is my pendrive actually (not sda1 nor sda2), I am really worried now. No error messages were there. If you see my question I have edited about gparted.
  • Ruslan Gerasimov
    Ruslan Gerasimov almost 10 years
    when you plug this drive what does demsg show?
  • user1735921
    user1735921 almost 10 years
    Sorry for trouble, I have edited my post, and included all information you have asked. Please see the paste bin links.
  • Ruslan Gerasimov
    Ruslan Gerasimov almost 10 years
    now it's time to try fdisk, so first run sudo fdisk /dev/sdb press p and tell what it says, you can try to delete/create partition in there.
  • user1735921
    user1735921 almost 10 years
    I did fdisk as you said, I have edited my question above and mentioned the output there, it gave me a warning. It says to type w, but I didn't wanna screw up something, so I thought I should wait for your response first.
  • Ruslan Gerasimov
    Ruslan Gerasimov almost 10 years
    It is only about data loss, so it's all right, you said you have done with unetbootin so assuming you have no anything to save from the drive, then go for writing changes. Feel free, with fdisk you are free to make experiments. Forget about data on the drive, first try to return it to a working condition. It's an aim for now.
  • user1735921
    user1735921 almost 10 years
    I made a lot of experiments with fdisk and ultimately I have been stuck to this error: Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) I can't make new partitions, when I make new partition using fdisk, then I do w and reload the pendrive and again check if the partition is created, and it tells that it has no partition.. gparted shows it as "unallocated" .. I am stuck at this..
  • Ruslan Gerasimov
    Ruslan Gerasimov almost 10 years
    and what if after fdisk you finally get back to the gparted and try to create a partition in there?
  • user1735921
    user1735921 almost 10 years
    did not work, unable to format
  • user1735921
    user1735921 almost 10 years
    Got the same error which I got in gparted, unable to create partition table.
  • piernov
    piernov almost 10 years
    I don't think it was caused directly by unetbootin. There are a few factors: a bad-quality flash and a repeated number of writing on the same sectors. unetbootin just overwrote a sector already in a bad state, and it "broke".
  • user1735921
    user1735921 almost 10 years
    Ah! I think you are right... that is what happened, I overwrote the ubuntu setup twice using unetbootin without formatting the drive.