6

I have been striving hard to format my USB drive. I cannot format it. Whenever I try it using the disks utility I get the following error message:

Error unmounting /dev/sdc: Command-line `umount  "/media/ramvignesh/AGALYA SRI"' exited with non-zero exit status 1: umount: /media/ramvignesh/AGALYA SRI: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
 (udisks-error-quark, 14)

Whenever I try it using GParted, it wasn't opening normally. I got the following window:

Libparted Bug Found! - window

Help me resolve the issues and reuse my USB drive.

David Foerster
  • 36,264
  • 56
  • 94
  • 147
Ramvignesh
  • 1,812
  • 6
  • 20
  • 31
  • It seems that your USB drive itself (likely) or something else in the USB stack (less likely) is broken. Does the USB drive work on other machines? Can your machine read and write other USB drives? – David Foerster Sep 30 '14 at 16:50
  • My machine writes and reads other usb drives with no issues. The usb drive isn't working well in any machine. – Ramvignesh Sep 30 '14 at 16:55
  • I recently inserted my pendrive into a pc with windows 7 ultimate. As soon as I inserted it, an avast antivirus application detected a virus in my pendrive. LNK:Jenxcus-D[Trj]. Can this be a reason for the I/O error? – Ramvignesh Oct 03 '14 at 05:09
  • Weird… I don't see how the two can be related. If Linux isn't even able to read from the drive, it cannot read and execute potentially existing malware on it – and that is before disregarding the fact that in general Windows malware doesn't run on Linux even if the hardware is intact. – David Foerster Oct 03 '14 at 14:59
  • So, is my pendrive alive or dead? – Ramvignesh Oct 03 '14 at 15:54
  • Probably. See the update to my answer. – David Foerster Oct 03 '14 at 16:05
  • I just solved the similar problem: https://askubuntu.com/a/1478086/849328 – luisito_36 Jul 16 '23 at 02:48

4 Answers4

6

Test this:

Plug Your usb drive.

Open a terminal:

Run it:

sudo -i
#Verify that your device is /dev/sdc with fdisk:
fdisk -l
umount /dev/sdc
fdisk /dev/sdc
o ---#Create a new empty partition table
n ---#Create a new partition  
w ---#Write the new partition table and exit 
#Format partition in ext4 filesystem 
mkfs.ext4 /dev/sdc1

The fdisk menu:

Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)
kyodake
  • 15,401
  • It isn't working. fdisk /dev/sdb shows an error message: fdisk: unable to read /dev/sdb: Input/output error – Ramvignesh Sep 30 '14 at 15:30
2

According to your comment the USB drive is broken. It looks as if one cannot format it or write to it in this state.

Some commands that are able to verify this by trying to read the drive are (assuming the device node is /dev/sdc):

sudo fdisk -l /dev/sdc
sudo dd if=/dev/sdc of=/dev/null bs=1m count=1

If they abort with an I/O error, the device is likely broken.

David Foerster
  • 36,264
  • 56
  • 94
  • 147
1

After giving up on the USB stick, instead of throwing it away, you may try to disassemble it to see if its memory is in the form of an sd card (micro). Sometimes the USB reader electronics will fail, but the memory is still OK. Try using the card in an adapter or card reader to see if it is usable. I have successfully saved one micro sd card this way from a completely dead USB.

ubfan1
  • 17,838
0

You might want to try a "Slow Erase" with "Empty Partitioning". That was how I solved it when I came across this problem.

John
  • 1