USB Restauration in Linux

USB Restauration in Linux

Restoring a USB Key to its Original State Using Linux

This tutorial, goes through the process of wiping, resetting, partitioning, and formatting a USB drive using a Linux terminal.

Step 1: Deleting Old Partitions

The first step is to delete any old partitions that remain on the USB key. Follow these steps to do it:

  1. Open a terminal by pressing Ctrl+Alt+T.
  2. Type sudo su to get root access.
  3. Type fdisk -l to list the drives and note the letter assigned to your flash drive.
  4. Type fdisk /dev/sdx (replace x with your drive letter).
  5. Type d to delete a partition.
  6. Select the partition to delete by typing 1 and pressing enter.
  7. Repeat steps 5-6 if there are other partitions to be deleted.

Step 2: Creating a New Partition

Next, we will create a new partition on the USB key:

  1. Type n to make a new partition.
  2. Type p and press enter to make this partition primary.
  3. Type 1 and then press enter to make this the first partition.
  4. Press enter to accept the default first sector.
  5. Press enter again to accept the default last sector.
  6. Type w to write the new partition information to the USB key.
  7. Type umount /dev/sdx1 (replace x with your drive letter).

Step 3: Creating a Filesystem

Lastly, we create the filesystem, either fat32 or exFAT:

  • For Fat32: type mkfs.vfat -F 32 /dev/sdx1 (replace x with your drive letter)
  • For exFAT (on Ubuntu or Debian): first, install the necessary utilities by typing apt install exfat-utils. Then, type mkfs.exfat /dev/sdx1 (replace x with your drive letter)

That’s it! You now have a restored USB key with a single exFAT or fat32 formatted partition that can be read from any computer. This method works on Windows, Linux, or MacOS operating systems for formatting a USB to restore USB drives back to full capacity.


Original Source: Restore USB drives back to full capacity


© 2023. All rights reserved.