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 on June 01, 2020 Linux Switching from Windows Tweet Share Email USB drives are handy devices when you're on-the-go, but these devices can get corrupted or damaged. Some errors are common, especially if you use Ubuntu and installed Linux to the USB using either the DD command or a Windows tool such as Win32 Disk Imager. Despite the drive being a certain size (for example, 16 gigabytes), you often only see one partition, which is smaller, or the Disk Utility and GParted show a message stating the block size is incorrect. In this guide, you'll learn how to get a USB drive into a state where you can access it from GParted or the Ubuntu Disk Utility without getting errors. bluehill75 / Getty Images Don't be alarmed if the drive has some strange partitioning, or the block size is incorrectly reported when you open GParted. You might see errors when running the Disk Utility program within Ubuntu. The USB drive isn't broken; it's confused. How to Install and Run GParted GParted isn't installed in Ubuntu by default. You need to take care of that before you can proceed. The fix used in this guide re-formats the USB drive, which erases existing data. Before you go any further, be aware that by following this guide, files on the USB drive will be lost. You can install GParted in a number of ways, but the easiest is to run the following command in the Linux terminal: sudo apt-get install gparted Press the super key or press the application launcher on the desktop to open the GNOME applications menu. Search for GParted and select the GParted icon when it appears. Select the disk representing the USB drive from the menu in the upper-right corner of the screen. How to Create a Partition Table Once GParted is installed, you should see a large area of unallocated space. If not, that's all right. Sometimes partitions get corrupted. This fix will work in that case too. To create a partition table, select the Device menu, and then choose Create Partition Table. A window appears warning that all data will be erased. Leave the partition type as msdos. Select Apply. How to Create a Partition The final step toward fixing the USB drive is to create a new partition. Here's how: Right-click the unallocated space, then choose New from the menu. The two key fields in the box that appears are File System and Label. If you only use the USB drive with Linux, leave the default file system as EXT4. If you also use it on Windows, change the file system to FAT32. Enter a descriptive name in the Label field. Select Add. Select the green arrow or checkmark icon in the toolbar to apply the changes. Another message appears asking whether you're sure you wish to continue as data will be lost. When you get to this point, any data that was on that drive is gone. Select Apply to finish. The USB drive should appear in the Ubuntu Launcher, and you should be able to load files onto it again. If you have access to a Windows computer, try it out to make sure it works correctly. What to Do If the Above Steps Don't Work If the above steps don't fix your USB drive, try 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. Enter the following command in the terminal, replacing /dev/sdb with the path to the problem drive: dd if=/dev/zero of=/dev/sdb bs=2048 This completely clears all data and all partitions from the USB drive. The command takes time to run, as it's a low-level format of the drive. It may take up to a few hours, depending on the size of the drive. When the dd command finishes, use the instructions above to create a new partition table and partition. Was this page helpful? Thanks for letting us know! Get the Latest Tech News Delivered Every Day Email Address Sign up There was an error. Please try again. You're in! Thanks for signing up. There was an error. Please try again. Thank you for signing up. Tell us why! Other Not enough details Hard to understand Submit