Software & Apps Linux How to Fix a USB Drive Using Ubuntu Use a free graphical tool to erase and reset your USB drive By Gary Newell Writer Gary Newell was a freelance contributor, application developer, and software tester with 20+ years in IT, working on Linux, UNIX, and Windows. our editorial process Gary Newell Updated March 20, 2020 Linux Switching from Windows Tweet Share Email As the title implies, this guide assumes that the USB drive is already broken. Because the drive is presumed broken, this guide isn't going to make any attempt to save data. Instead, it's going to press forward and try to save the physical device. This fix used in this guide re-formats your USB drive, erasing any existing data. Before you go any further, be aware that by following this guide, any files on the USB drive will be lost. Don't be alarmed if the drive has some strange partitioning going on or the block size is reported incorrectly when you open GParted. You might see strange errors when running the Disk Utility within Ubuntu, but the USB drive isn't really broken. It is just a little bit confused. In this guide, you'll learn how to get a USB drive into a state where you can access it again from GParted or the Ubuntu Disk Utility without getting errors. The Errors bluehill75 / Getty Images Some errors are common on a USB drive, especially if you have installed Linux to it using either the DD command or a Windows tool such as Win32 Disk Imager. Often, you'll see that, despite the drive being a certain size (e.g.16 gigabytes), you can only see one partition which is much smaller, or the Disk Utility and GParted show a message stating that you have an incorrect block size. The following steps will help to fix your USB drive. Install and Run GParted By default, GParted isn't installed in Ubuntu. You're going to need to install it before you can get started. You can install GParted in a number of ways, but the easiest is to run the following command in the Linux terminal: sudo apt install gparted Press the super key or press the application launcher on your desktop to bring up the GNOME applications menu, and search for "GParted". Select the GParted icon when it appears. Select the disk that represents your drive from the list in the top right corner of the screen. Create a Partition Table You should now see a large area of unallocated space. If not, that's alright too. Sometimes partitions get corrupted, and this fix will work in that case too. To create a partition table select the Device menu and then Create Partition Table. A window will appear stating all data will be erased. Leave the partition type as "msdos," and press Apply. Create a Partition The final step is to create a new partition. Right-click on the unallocated space, and choose New from the menu. The two key fields in the box that appears are File System and Label. If you are only ever going to use the USB drive with Linux then you can leave the default file system as EXT4, but if you plan to use it on Windows as well, then change the file system to FAT32. Enter a descriptive name into the label field. Press Add. Finally, press the green arrow or checkmark icon in the toolbar to apply the changes. Another message will appear asking whether you are sure you wish to continue as data will be lost. Of course, by the time you get to this point any data that used to be on that drive is well and truly gone. Press Apply to finish. Summary Your USB drive should now appear in the Ubuntu Launcher, and you should be able to load files onto it again. If you have access to a Windows computer it is worth trying it out to make sure it works correctly. Troubleshooting If the above steps don't work do the following: Open a terminal window by pressing CTRL+ALT+T at the same time. Alternatively, press the super key on the keyboard (Windows key) and search for "TERM" in the Ubuntu Dash search box. When the icon appears, select it. In the terminal enter the following command, replacing /dev/sdb with the path to the problem drive: dd if=/dev/zero of=/dev/sdb bs=2048 This will completely clear all data and all partitions from the USB drive. The command will take quite some time to run as it is a low-level format of the drive. Depending on the size of the drive it may take up to a few hours. When the dd command has finished, repeat steps 2 to 4.