Often times I find myself using Live ISO's to either test out a new OS or to do a fresh install on my device. Either way, after I am done using the thumbdrive, I usually want it back to the way it was. Here is a step-by-step:

Step 0 - Find Your Device:

Find your device with 'lsblk'. Typically the device starts with 'sd', and a letter. Your system might be differnt.

$ lsblk

Step 1 - Open With FDisk:

Open your device with fdisk:

$ fdisk /dev/sdX

Where 'X' is dependant on your device

Step 2 - Create an Empty Dos Partition:

Press 'o', not a zero, to create an empty DOS partition.

Step 3 - Add A New Partition:

  1. Press 'n' to add the new partition.
  2. Press '1' to select primary partition.
  3. Now press 'Enter', followed by 'Enter' to use the entire disk.

Step 4 - Change the Partition ID:

  1. Press 't' to change the partition system id.
  2. Then press '6' to select 'FAT16'.

Step 5 - Write Changes to Disk:

Write the changes to the disk by pressing 'w'.

Step 6 - Write the Filesystem:

To finalize the change, write the filesystem to the disk with the following command:

$ mkfs.msdos -n SOME_NAME /dev/sdX1

Again, replacing the 'X' with the letter on your devide, and SOME_NAME with whatever name you wish to give your thumbdrive.

Last updated: 2023-01-06