8

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,890
  • 56
  • 97
  • 151
Ramvignesh
  • 1,862
  • 6
  • 20
  • 31

5 Answers5

7

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
  • 17,808
3

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,890
  • 56
  • 97
  • 151
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
  • 19,049
0

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

Stephen Rauch
  • 1,156
  • 6
  • 15
  • 21
John
  • 1
  • 2
0

You're getting the error "open failed: /media/harry/HARRY, Is a directory" because mkfs.exfat requires a device path, not a mounted directory.

How to Properly Format Your USB to exFAT on Ubuntu

Follow these steps to fix it:

1. Unmount the USB Drive

Before formatting, unmount the USB to prevent issues:

sudo umount /media/harry/HARRY

2. Identify the Correct USB Device

Run the following command to find your USB device name:

lsblk

Look for a device like /dev/sdb or /dev/sdc, not a mounted directory like /media/harry/HARRY.

Example Output:

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 500G  0 disk
├─sda1   8:1    0 250G  0 part /
└─sda2   8:2    0 250G  0 part /home
sdb      8:16   1  32G   0 disk 
└─sdb1   8:17   1  32G   0 part /media/harry/HARRY

Your USB is likely /dev/sdb (without the number).

3. Format USB to exFAT

⚠️ WARNING: This will erase all data on the USB drive!
Replace /dev/sdX with your actual device name (e.g., /dev/sdb):

sudo mkfs.exfat -n "HARRY" /dev/sdX

Example:

sudo mkfs.exfat -n "HARRY" /dev/sdb

4. Re-mount the USB

After formatting, unplug and replug the USB, or manually mount it:

sudo mount /dev/sdb1 /media/harry/HARRY

Now you should be able to copy files larger than 4.3GB without issues.
Let me know if you need more help!