Pen-drive / USB-Drive not working after installing ubuntu in it
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 here
Related videos on Youtube
![user1735921](https://i.stack.imgur.com/3xEka.jpg?s=256&g=1)
user1735921
Updated on September 18, 2022Comments
-
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 almost 10 yearsWhich filesystem is there on the USB drive?
-
Steve almost 10 yearsThere is probably a wonky partition layout on it with non-Windows filesystems.
-
user1735921 almost 10 yearsI used gparted now on a linux machine, it doesn't even detect the USB Flash drive.
-
-
user1735921 almost 10 yearsgparted failed... any other solution ?
-
Ruslan Gerasimov almost 10 yearsWhat makes you think it failed? Here at SU is a commonly reciting error messages in posts, or screen shots. Could you please include
-
user1735921 almost 10 yearsIt 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 almost 10 yearswhen you plug this drive what does
demsg
show? -
user1735921 almost 10 yearsSorry for trouble, I have edited my post, and included all information you have asked. Please see the paste bin links.
-
Ruslan Gerasimov almost 10 yearsnow it's time to try fdisk, so first run
sudo fdisk /dev/sdb
pressp
and tell what it says, you can try to delete/create partition in there. -
user1735921 almost 10 yearsI 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 almost 10 yearsIt 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, withfdisk
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 almost 10 yearsI 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 almost 10 yearsand what if after
fdisk
you finally get back to thegparted
and try to create a partition in there? -
user1735921 almost 10 yearsdid not work, unable to format
-
user1735921 almost 10 yearsGot the same error which I got in gparted, unable to create partition table.
-
piernov almost 10 yearsI 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 almost 10 yearsAh! I think you are right... that is what happened, I overwrote the ubuntu setup twice using unetbootin without formatting the drive.