In this guide, we will learn how to format a USB-Stick in Linux. This can be useful if the USB-Stick is damaged or if you want to format it for a specific task.
Before we begin formatting, make sure that the USB-Stick is connected to your computer and that it has been recognized by Linux. To do this, open a terminal and enter the following command:
This will show a list of all connected drives, including USB-Sticks. You should see the USB-Stick in the list. Take note of the name of the USB-Stick, as we will need it later. The name of the USB-Stick is typically something like
Formatting the USB-Stick
Important: When you format the USB-Stick, all data stored on it will be deleted. Make sure to backup any important files from the USB-Stick before formatting it.
Um den USB-Stick zu formatieren, werden wir das mkfs-Programm verwenden. Dieses Programm ist in den meisten Linux-Distributionen vorinstalliert.
Öffnen Sie ein Terminal und geben Sie folgenden Befehl ein, um den USB-Stick zu formatieren:
sudo mkfs -t vfat /dev/[Name of USB-Stick]
Replace Name of USB-Stick with the name of the USB-Stick that you noted in the preparation phase. For example, the command for a USB-Stick with the name /dev/sdc would be:
sudo mkfs -t vfat /dev/sdc
-t vfat flag specifies that the USB-Stick should be formatted in the FAT32 format. This is the most widely-used filesystem for USB-Sticks and is supported by most operating systems.
When you run the command, the USB-Stick will be formatted. This may take some time depending on the size and speed of the USB-Stick. When formatting is complete, you should receive a message that the USB-Stick has been successfully formatted.
Once formatting is complete, you can use the USB-Stick as you normally would. You can copy files to the USB-Stick, use it as a boot drive, or do whatever else you want with it.